/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e7a8c 0%, #5fb3d4 100%);
    min-height: 100vh;
    color: #333;
}

/* Page Management */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Login Page Styles */
.login-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header .logo-container {
    margin-bottom: 20px;
}

.login-header .giscaruso-logo {
    width: 100px;
    height: auto;
    margin-bottom: 15px;
}

.login-header i {
    font-size: 3rem;
    color: #1e7a8c;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #1e7a8c;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e7a8c 0%, #0891b2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
}

/* Header Styles */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.logo .giscaruso-logo {
    width: 100px;
    height: auto;
    margin-right: 5px;
}

.logo i {
    color: #1e7a8c;
    font-size: 2rem;
}

.back-btn {
    background: none;
    border: none;
    color: #1e7a8c;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background-color: #f0f0f0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: #ff5252;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    background: linear-gradient(135deg, #1e7a8c 0%, #0891b2 100%);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.card-content p {
    color: #666;
    line-height: 1.5;
}

.card-url {
    color: #1e7a8c;
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85rem;
}

.card-action {
    color: #1e7a8c;
    font-size: 1.5rem;
}

/* Applications Page Styles */
.applications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.applications-header h2 {
    color: white;
    font-size: 2rem;
}

.refresh-btn {
    background: white;
    color: #1e7a8c;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

/* Applications Grid */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.app-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.app-icon {
    background: linear-gradient(135deg, #1e7a8c 0%, #0891b2 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.app-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #333;
}

.app-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.app-status.published {
    background: #e8f5e8;
    color: #2e7d32;
}

.app-status.draft {
    background: #fff3e0;
    color: #f57c00;
}

.app-status.published-with-changes {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.app-build-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #f5f5f5;
    color: #666;
    align-self: flex-start;
    margin-top: 8px;
}

.app-build-status.draft {
    background: #b6b6c0;
    color: white;
}

.app-build-status.published {
    background: #02b311;
    color: white;
}

.app-build-status.published {
    background: #34c759;
    color: white;
}

.app-build-status.published-with-changes {
    background: #ff9800;
    color: white;
    font-weight: 600;
}

.app-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin: 10px 0;
    color: #999;
    font-size: 0.8rem;
}

.app-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.action-btn {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.action-btn.open {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn.edit {
    background: #f3e5f5;
    color: #7b1fa2;
}

.action-btn.publish {
    background: #e8f5e8;
    color: #2e7d32;
}

.action-btn.unpublish {
    background: #ffebee;
    color: #d32f2f;
}

.action-btn:hover {
    transform: translateY(-1px);
    opacity: 0.8;
}

/* No Apps State */
.no-apps {
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.no-apps i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.no-apps h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.no-apps p {
    margin-bottom: 30px;
    opacity: 0.8;
}

.create-app-btn {
    background: white;
    color: #1e7a8c;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.create-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 15px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .card {
        flex-direction: column;
        text-align: center;
    }
    
    .applications-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .applications-grid {
        grid-template-columns: 1fr;
    }
    
    .app-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        min-width: calc(50% - 5px);
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e7a8c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* GISCARUSO Footer - Only for main content pages */
.footer {
    background: linear-gradient(135deg, #0891b2 0%, #1e7a8c 100%);
    color: white;
    padding: 25px 30px;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    width: 100px;
    height: auto;
}

.footer-text {
    line-height: 1.4;
}

.footer-text .brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.footer-text .tagline {
    color: #b3e5fc;
    font-size: 0.8rem;
}

.footer-info {
    text-align: right;
    color: #b3e5fc;
    font-size: 0.75rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .footer-info {
        text-align: center;
    }
}

/* AGOL Integration Styles */
.agol-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.agol-status.uploaded {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
}

.agol-status.not-uploaded {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: white;
}

.agol-status.disabled {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
}

.agol-link {
    color: white;
    text-decoration: none;
    margin-left: auto;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s ease;
}

.agol-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* AGOL Action Buttons */
.action-btn.agol-upload {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    color: white;
    font-size: 0.8rem;
}

.action-btn.agol-upload:hover {
    background: linear-gradient(135deg, #388e3c, #4caf50);
    transform: translateY(-2px);
}

/* Removed agol-update and agol-remove button styles - not needed anymore */

/* AGOL Status Icons */
.agol-status i {
    font-size: 1rem;
}

.agol-status.uploaded i {
    color: #c8e6c9;
}

.agol-status.not-uploaded i {
    color: #ffe0b2;
}

.agol-status.disabled i {
    color: #bdbdbd;
}

/* Responsive adjustments for AGOL elements */
@media (max-width: 768px) {
    .agol-status {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .action-btn.agol-upload {
        min-width: 100%;
        margin: 2px 0;
    }
}
