/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
}

.notification-icon-container {
    position: relative;
    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c314a;
    z-index: 100;
}
.notification-icon-container:hover {
    max-height: 80px; /* ensure the SVG does not overflow the slot */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 191, 193, 0.25);
    background: rgba(14, 191, 193, 0.05);
}
/* Dark mode variants to ensure the icon has a visible border/background */
body.dark-mode .notification-icon-container {
    background: #2d2d2d;
    border-color: #404040;
    color: #e0e0e0;
}
body.dark-mode .notification-icon-container:hover {
    background: #3a3a3a;
    border-color: #0EBFC1;
}
.notification-badge {
    position: absolute;
    /* Position badge outside the icon (top-right corner) */
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 102;
}
.notification-badge.show { display: flex; }
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 101;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.notification-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}
.notification-dropdown-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0C314A;
}
.notification-dropdown-header .mark-all-read {
    font-size: 0.85rem;
    color: #0EBFC1;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.notification-dropdown-header .mark-all-read:hover { background: rgba(14, 191, 193, 0.1); }
.notification-dropdown-body { flex: 1; overflow-y: auto; max-height: 400px; }
.notification-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 0.75rem;
    position: relative;
}
.notification-item:hover { background: #f8f9fa; }
.notification-item.unread { background: #f0f9ff; }
.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #0EBFC1;
    border-radius: 0 4px 4px 0;
}

/* Page header layout and controls (port from main app) */
.page-header-with-user {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 0;
    gap: 1.5rem;
    position: relative; /* Ensure proper positioning context */
}

.page-header-with-user > div {
    position: relative; /* Ensure included components have proper positioning context */
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
    position: relative;
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
    width: 60px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(14, 191, 193, 0.25);
}

.theme-switcher-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0EBFC1 0%, #0C314A 100%);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.theme-switcher[data-theme="dark"] .theme-switcher-slider {
    transform: translateX(30px);
}

/* User Profile (header) */
.header-user-info {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 3px 12px rgba(14, 191, 193, 0.15);
    cursor: pointer;
    overflow: visible;
    width: auto;
    min-width: 80px;
    z-index: 1000;
    transition: all 0.3s ease;
    margin: 0;
}

.user-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    white-space: nowrap;
}

.user-expanded {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 10px;
    border: 1px solid #0c314a;
    box-shadow: 0 6px 20px rgba(14, 191, 193, 0.25);
    white-space: nowrap;
    width: auto;
    min-width: 200px;
    z-index: 1006;
    transform: translateY(-50%) scale(0.95);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.header-user-info:hover .user-compact {
    opacity: 0;
    pointer-events: none;
}

.header-user-info:hover .user-expanded {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    pointer-events: all;
}

.header-user-info:hover {
    z-index: 1005;
}

.user-avatar-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c314a;
    background: rgba(14, 191, 193, 0.1);
    border-radius: 8px;
    padding: 6px;
}

.user-avatar-icon svg { width: 18px; height: 18px; }

.user-initials {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 20px;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    white-space: nowrap;
    line-height: 1.3;
}

.logout-btn {
    background: none;
    border: 1px solid rgba(14, 191, 193, 0.3);
    color: #718096;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: #e53e3e;
    color: white;
    border-color: #e53e3e;
    transform: scale(1.05);
}

.logout-btn svg { width: 16px; height: 16px; }

/* Dark-mode variants for new header elements */
body.dark-mode .header-user-info {
    background: rgba(45, 45, 45, 0.95);
    border-color: #505050;
}

body.dark-mode .user-expanded {
    background: rgba(45, 45, 45, 0.98);
    border-color: #505050;
}

body.dark-mode .user-name,
body.dark-mode .user-initials { color: #e0e0e0; }

body.dark-mode .theme-switcher {
    background: rgba(45, 45, 45, 0.95);
    border-color: #505050;
}

@media (max-width: 768px) {
    .page-header-with-user {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        margin-bottom: 0.3rem;
    }
    .header-controls { margin-left: 0; justify-content: center; }
}

.notification-icon-circle { width: 36px; height: 36px; border-radius: 50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size: 1.1rem; }
.notification-icon-circle.info { background: rgba(59,130,246,0.1); color:#3b82f6; }
.notification-icon-circle.success { background: rgba(16,185,129,0.1); color:#10b981; }
.notification-icon-circle.warning { background: rgba(245,158,11,0.1); color:#f59e0b; }
.notification-icon-circle.error { background: rgba(239,68,68,0.1); color:#ef4444; }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; color: #0C314A; font-size: 0.9rem; margin-bottom: 0.25rem; line-height: 1.3; }
.notification-message { color: #6b7280; font-size: 0.85rem; line-height: 1.4; margin-bottom: 0.25rem; }
.notification-time { color: #9ca3af; font-size: 0.75rem; }
.notification-dropdown-footer { padding: 0.75rem 1.25rem; border-top: 1px solid #e0e0e0; background: #f8f9fa; text-align: center; }
.notification-dropdown-footer a { color: #0EBFC1; text-decoration: none; font-size: 0.9rem; font-weight: 500; display: inline-block; padding: 0.25rem 0.5rem; border-radius: 4px; transition: all 0.2s ease; }
.notification-dropdown-footer a:hover { background: rgba(14, 191, 193, 0.1); }
.notification-empty { padding: 3rem 2rem; text-align: center; color: #9ca3af; }
.notification-empty-icon { font-size: 3rem; margin-bottom: 0.5rem; opacity: 0.5; }
