/* ================================================
   3DScenario Platform - Dashboard Layout
   ================================================ */

/* ---- Dashboard Layout ---- */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base), transform var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid var(--border);
    min-height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-lg);
    color: white;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: var(--font-size-lg);
    font-weight: 700;
    white-space: nowrap;
}

.sidebar-logo .logo-text span {
    color: var(--primary);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-md) var(--space-sm);
}

.sidebar-section {
    margin-bottom: var(--space-md);
}

.sidebar-section-title {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    position: relative;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-link .badge {
    margin-left: auto;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.sidebar-user:hover {
    background: rgba(0, 0, 0, 0.04);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.page-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Search */
.header-search {
    position: relative;
}

.header-search input {
    width: 240px;
    padding: 8px 16px 8px 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    width: 300px;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

/* Notification bell */
.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* ---- Page Content ---- */
.page-content {
    padding: var(--space-xl);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-header-left h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-xs);
}

.page-header-left p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

/* ---- Welcome Banner ---- */
.welcome-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-banner h2 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-sm);
}

.welcome-banner p {
    color: var(--text-secondary);
    max-width: 600px;
}

/* ---- Eco/Environmental Cards ---- */
.eco-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.eco-card .eco-icon {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.eco-card .eco-value {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--accent-light);
    margin-bottom: var(--space-xs);
}

.eco-card .eco-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ---- Quick Actions ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
}

.quick-action:hover {
    background: rgba(5, 150, 105, 0.04);
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--text-primary);
}

.quick-action i {
    font-size: 28px;
    color: var(--primary);
}

.quick-action span {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ---- Responsive Sidebar ---- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        display: none;
    }

    .sidebar-backdrop.active {
        display: block;
    }

    .header-search input {
        width: 160px;
    }

    .header-search input:focus {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: var(--space-md);
    }

    .top-header {
        padding: 0 var(--space-md);
    }

    .welcome-banner {
        padding: var(--space-lg);
    }

    .page-header {
        flex-direction: column;
        align-items: stretch; /* Stretch buttons to full width on mobile */
    }
    
    .page-header-right .btn {
        width: 100%;
    }
}

/* ---- Auth Layout (Login/Register) ---- */
.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.5s ease;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: white;
    margin-bottom: var(--space-md);
}

.auth-logo h1 {
    font-size: var(--font-size-2xl);
}

.auth-logo h1 span {
    color: var(--primary);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-top: var(--space-xs);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* Google Sign-in Button */
.btn-google {
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
}

.btn-google:hover {
    background: #f8f8f8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Multi-step form */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all var(--transition-base);
}

.step.active .step-circle {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.step.completed .step-circle {
    background: var(--accent);
    color: white;
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--bg-tertiary);
    transition: background var(--transition-base);
}

.step.completed + .step-line,
.step.completed ~ .step-line {
    background: var(--accent);
}

/* Form step content */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Consent check items */
.consent-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.consent-item .consent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.consent-item .consent-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.consent-item .consent-link {
    font-size: var(--font-size-xs);
    color: var(--primary);
    cursor: pointer;
}

.consent-item .consent-link:hover {
    text-decoration: underline;
}
