/* Authenticated Layout Styles */

/* Fix body padding for fixed header */
body.authenticated-layout {
    padding-top: 60px; /* Height of header */
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Authenticated Header */
.auth-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.auth-header-container {
    max-width: 100%;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-header-left {
    display: flex;
    align-items: center;
}

.auth-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    color: #1a202c;
}

.user-menu-trigger:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.user-menu-trigger.active {
    background: #f3f4f6;
    border-color: #3182ce;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.user-menu-trigger.active .menu-arrow {
    transform: rotate(180deg);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.user-email {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.user-tier-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #3182ce;
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.user-tier-badge.free {
    background: #9ca3af;
}

.user-tier-badge.professional {
    background: #3182ce;
}

.user-tier-badge.enterprise {
    background: #7c3aed;
}

.user-tier-badge.admin {
    background: #dc2626;
}

.user-menu-section {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.user-menu-section:last-child {
    border-bottom: none;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.user-menu-item:hover {
    background: #f9fafb;
    color: #1a202c;
}

.user-menu-item i {
    width: 16px;
    text-align: center;
    color: #9ca3af;
}

.user-menu-item:hover i {
    color: #3182ce;
}

.user-menu-item.logout {
    color: #dc2626;
}

.user-menu-item.logout i {
    color: #dc2626;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    color: #4b5563;
    cursor: pointer;
    font-size: 0.875rem;
    text-align: left;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    background: #f9fafb;
    color: #1a202c;
}

/* Main Container */
.authenticated-container {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 60px - 60px); /* Minus header and footer */
}

/* Streamlined Sidebar */
.auth-sidebar {
    width: 200px;
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.primary-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    position: relative;
}

.nav-item:hover {
    background: #f9fafb;
    color: #1a202c;
}

.nav-item.active {
    background: #eff6ff;
    color: #3182ce;
    border-left: 3px solid #3182ce;
    padding-left: calc(1.5rem - 3px);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #1a202c;
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
}

.nav-item:hover .nav-tooltip {
    display: block;
}

/* Main Content */
.auth-main {
    flex: 1;
    padding: 2rem;
    background: #f9fafb;
    overflow-y: auto;
}

/* Authenticated Footer */
.auth-footer {
    height: 60px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.auth-footer-container {
    max-width: 100%;
    width: 100%;
    padding: 0 2rem;
}

.auth-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.auth-footer-left a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer-left a:hover {
    color: #3182ce;
}

.separator {
    color: #d1d5db;
}

.auth-footer-right {
    display: flex;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.status-dot {
    color: #10b981;
    font-size: 8px;
}

/* Dark mode support */
body.dark-mode .auth-header {
    background: rgba(26, 32, 44, 0.95);
    border-bottom-color: rgba(75, 85, 99, 0.5);
}

body.dark-mode .user-menu-trigger {
    color: #e5e7eb;
    border-color: #4b5563;
}

body.dark-mode .user-menu-trigger:hover {
    background: #374151;
    border-color: #6b7280;
}

body.dark-mode .user-menu-dropdown {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .user-menu-header {
    border-bottom-color: #374151;
}

body.dark-mode .user-email {
    color: #9ca3af;
}

body.dark-mode .user-menu-section {
    border-bottom-color: #374151;
}

body.dark-mode .user-menu-item {
    color: #d1d5db;
}

body.dark-mode .user-menu-item:hover {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .user-menu-item i {
    color: #6b7280;
}

body.dark-mode .user-menu-item:hover i {
    color: #60a5fa;
}

body.dark-mode .theme-toggle-btn {
    color: #d1d5db;
}

body.dark-mode .theme-toggle-btn:hover {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .auth-sidebar {
    background: #1f2937;
    border-right-color: #374151;
}

body.dark-mode .nav-item {
    color: #d1d5db;
}

body.dark-mode .nav-item:hover {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .nav-item.active {
    background: #1e3a5f;
    color: #60a5fa;
    border-left-color: #60a5fa;
}

body.dark-mode .auth-main {
    background: #111827;
}

body.dark-mode .auth-footer {
    background: #1f2937;
    border-top-color: #374151;
}

body.dark-mode .auth-footer-left,
body.dark-mode .auth-footer-left a,
body.dark-mode .status-indicator {
    color: #9ca3af;
}

body.dark-mode .auth-footer-left a:hover {
    color: #60a5fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-sidebar {
        width: 60px;
    }
    
    .nav-item span:not(.nav-tooltip) {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 0.75rem;
    }
    
    .nav-item.active {
        padding-left: calc(0.75rem - 3px);
    }
    
    .nav-tooltip {
        display: block !important;
        opacity: 0;
        visibility: hidden;
    }
    
    .nav-item:hover .nav-tooltip {
        opacity: 1;
        visibility: visible;
    }
    
    .auth-header-container {
        padding: 0 1rem;
    }
    
    .auth-main {
        padding: 1rem;
    }
    
    .user-name {
        display: none;
    }
    
    .auth-footer-left .separator,
    .auth-footer-left a:not(:first-of-type) {
        display: none;
    }
}

/* Admin Navigation Group */
.admin-nav-group {
    margin-top: 20px;
    padding-top: 20px;
}

.nav-group-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    padding-top: 20px;
}

.nav-group-title {
    padding: 0 20px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    opacity: 0.7;
}

body.dark-mode .nav-group-divider {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .nav-group-title {
    color: #cbd5e0;
}