/* ==============================================
   ETERON Platform - Main Styles
   Version: 35 - Clean, works with design system
   ============================================== */

/* ==============================================
   LAYOUT
   ============================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width, 280px);
    padding: 2rem;
    background: var(--bg-body, #ffffff);
    min-height: 100vh;
}

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

/* ==============================================
   SIDEBAR OVERRIDES
   ============================================== */

.glass-sidebar {
    width: var(--sidebar-width, 280px);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-sidebar, #1a1a1a);
    color: #ffffff;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Sidebar text must be white */
.glass-sidebar,
.glass-sidebar *,
.glass-sidebar h6,
.glass-sidebar small,
.glass-sidebar label,
.glass-sidebar .form-label {
    color: #ffffff !important;
}

.glass-sidebar .opacity-75 {
    opacity: 0.75 !important;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
}

.sidebar-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Entity Selector in Sidebar */
.entity-selector .form-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    border-radius: 8px;
}

.entity-selector .form-select option {
    background: #1a1a1a;
    color: #ffffff;
}

/* Sidebar Navigation */
.glass-sidebar .nav-pills .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.glass-sidebar .nav-pills .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

.glass-sidebar .nav-pills .nav-link.active {
    background: var(--color-primary, #475569);
    color: #ffffff !important;
}

.glass-sidebar .nav-pills .nav-link i {
    color: inherit !important;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
}

/* ==============================================
   DASHBOARD CARDS
   ============================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.dashboard-card h5 {
    color: var(--text-primary, #111827);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dashboard-card-icon {
    font-size: 2.5rem;
    color: var(--color-primary, #475569);
    margin-bottom: 1rem;
}

.dashboard-card-icon i {
    color: var(--color-primary, #475569);
}

/* ==============================================
   GLASS CARD (Generic)
   ============================================== */

.glass-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* ==============================================
   AUTH PAGES (Login/Register)
   ============================================== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f 0%, #0d1b2a 100%);
    padding: 2rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.auth-card h2, .auth-card h3 {
    color: #1f2937 !important;
}

.auth-card p {
    color: #6b7280 !important;
}

.auth-card label {
    color: #374151 !important;
}

.auth-card .text-white-50 {
    color: #6b7280 !important;
}

.auth-card .text-white {
    color: var(--color-primary, #475569) !important;
}

/* Language selector in auth card */
.auth-card .form-select,
.auth-card select {
    color: #1f2937 !important;
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
}

.auth-card .form-select option {
    color: #1f2937 !important;
    background: #ffffff !important;
}

.auth-logo {
    max-width: 200px;
    margin: 0 auto 1.5rem;
}

.auth-logo img {
    max-width: 100%;
    height: auto;
}

.btn-auth {
    background: var(--color-primary, #475569);
    color: #ffffff !important;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-auth:hover {
    background: var(--color-primary-dark, #334155);
    transform: translateY(-1px);
}

/* ==============================================
   MOBILE RESPONSIVE
   ============================================== */

.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-sidebar, #1a1a1a);
    padding: 0 1rem;
    align-items: center;
    z-index: 999;
}

.mobile-logo {
    height: 35px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

@media (max-width: 768px) {
    .glass-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .glass-sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 70px;
    }

    .mobile-topbar {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================================
   ANIMATIONS
   ============================================== */

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==============================================
   INVOICE STATS CARD
   ============================================== */

.invoice-stats-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.invoice-stats-card:hover {
    box-shadow: var(--shadow-md);
}

/* ==============================================
   RESTRICTED MODULE
   ============================================== */

.restricted-module {
    opacity: 0.6;
    position: relative;
}

.restricted-module:hover {
    opacity: 0.7;
}

.restriction-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: var(--color-danger, #dc3545);
}

/* ==============================================
   LOADING OVERLAY
   ============================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
}
