:root {
    --bg-color:    --text-color: #e0e0e0;
    --text-muted: #999999;
    --border-color: #444;
    --header-bg: #000000;
    --header-text: #ffffff;
    --link-color: #ffffff;
    --link-hover: #005a8a;
    --main-bg: #1a1a1a;
    --main-link-color: #007cba;
    --main-link-hover: #005a8a;
    
    /* Dark theme values for additional CSS variables */
    --primary-color: #007cba;
    --primary-hover: #005a8a;
    --secondary-color: #0099ff;--text-color: #333333;
    --text-muted: #666666;
    --border-color: #ddd;
    --header-bg: #333333;
    --header-text: #ffffff;
    --link-color: #ffffff;
    --link-hover: #005a8a;
    --main-bg: #ffffff;
    --main-link-color: #007cba;
    --main-link-hover: #005a8a;
    
    /* Additional CSS variables for home page and components */
    --primary-color: #007cba;
    --primary-hover: #005a8a;
    --secondary-color: #0099ff;
    --card-background: #ffffff;
    --card-background-dark: #2a2a2a;
    --border-color-dark: #555555;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-muted: #999999;
    --border-color: #444;
    --header-bg: #000000;
    --header-text: #ffffff;
    --link-color: #ffffff;
    --link-hover: #ffb366;
    --main-bg: #1a1a1a;
    --main-link-color: #0099ff;
    --main-link-hover: #00ccff;
    
    /* Dark theme values for additional CSS variables */
    --primary-color: #0099ff;
    --primary-hover: #007acc;
    --secondary-color: #00ccff;
    --card-background: #2a2a2a;
    --card-background-dark: #2a2a2a;
    --border-color-dark: #555555;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 0.5em 2em;
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: center;
    gap: 2em;
}

nav a {
    color: var(--header-text);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

nav a:visited {
    color: var(--header-text);
}

nav a:hover {
    color: var(--link-hover);
}

/* Main content links */
main a {
    color: var(--main-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

main a:visited {
    color: white;
}

main a:hover {
    color: var(--main-link-hover);
}

/* Global link styling to override browser defaults */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:visited {
    color: white;
}

a:hover {
    color: var(--main-link-hover);
}

main {
    padding: 2em;
    background-color: var(--main-bg);
    transition: background-color 0.3s ease;
    margin-top: 0 !important;
}

/* Fix for excessive top margin spacing issue - Global fix */
main, .main-content, .content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Header theme toggle button */
.theme-toggle-header {
    background: transparent;
    color: var(--header-text);
    border: 1px solid var(--header-text);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-header:hover {
    background: var(--header-text);
    color: var(--header-bg);
    transform: scale(1.1);
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--header-bg);
    color: var(--header-text);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Error notification styles */
.error-notification {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: top 0.3s ease;
}

.error-notification.show {
    top: 0;
}

.error-notification.hide {
    top: -100px;
}

.error-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.error-content i:first-child {
    font-size: 1.1rem;
}

.close-error {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 1rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.close-error:hover {
    background: rgba(255,255,255,0.2);
}

.close-error i {
    font-size: 0.9rem;
}

/* Success notification styles */
.success-notification {
    position: fixed;
    top: -100px;
    left: 0;
    right: 0;
    background: #28a745;
    color: white;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: top 0.3s ease;
}

.success-notification.show {
    top: 0;
}

.success-notification.hide {
    top: -100px;
}

.success-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.success-content i:first-child {
    font-size: 1.1rem;
}

.close-success {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 1rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.close-success:hover {
    background: rgba(255,255,255,0.2);
}

.close-success i {
    font-size: 0.9rem;
}

/* Administrator promotion notification styles */
.admin-promotion-notification {
    position: fixed;
    top: -200px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #212529;
    padding: 1.5rem;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: top 0.3s ease;
    border-bottom: 3px solid #ff8c00;
}

.admin-promotion-notification.show {
    top: 0;
}

.admin-promotion-notification.hide {
    top: -200px;
}

.admin-promotion-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.admin-promotion-content i:first-child {
    font-size: 2rem;
    color: #212529;
    flex-shrink: 0;
}

.admin-promotion-text {
    flex: 1;
    text-align: center;
}

.admin-promotion-text strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.admin-promotion-text p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.close-admin-promotion {
    background: transparent;
    border: none;
    color: #212529;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.close-admin-promotion:hover {
    background: rgba(0,0,0,0.1);
}

.close-admin-promotion i {
    font-size: 1rem;
}

/* Login Prompt Styles for Unauthenticated Users - Azure App Service Optimized */
.login-prompt {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.login-prompt h1 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.login-prompt p {
    color: var(--text-color);
    margin-bottom: 2rem;
    font-size: 1.2rem;
    max-width: 600px;
}

/* Responsive design for Azure App Service mobile optimization */
@media (max-width: 768px) {
    .login-prompt {
        padding: 1rem;
        min-height: 50vh;
    }
    
    .login-prompt h1 {
        font-size: 2rem;
    }
    
    .login-prompt p {
        font-size: 1rem;
    }
}

/* Dark theme support for login prompt */
[data-theme="dark"] .login-prompt h1,
[data-theme="dark"] .login-prompt p {
    color: var(--text-color);
}

/* Azure CDN optimization - preload hint for critical CSS */
.login-prompt {
    contain: layout style;
}

/* Profile Dropdown Styles */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: #f8f9fa;
    border: 1px solid #007cba;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #333;
    transition: all 0.2s ease;
}

.profile-btn:hover {
    background: var(--link-hover);
    border-color: var(--link-hover);
    color: #333;
}

.profile-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    z-index: 1000;
    padding: 16px;
    margin-top: 4px;
}

.profile-dropdown-content.show {
    display: block;
}

.profile-header {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
}

.profile-section {
    margin: 12px 0;
}

.profile-section h4 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
}

.profile-section select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85em;
    background: white;
}

.profile-section button {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.profile-section button:hover {
    background: #005a8b;
}

.profile-dropdown-content a {
    color: #666;
    text-decoration: none;
    display: block;
    padding: 8px 0;
    font-size: 0.85em;
    transition: color 0.2s;
}

.profile-dropdown-content a:hover {
    color: #007cba;
}

.profile-dropdown-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 12px 0;
}

/* Dark theme styles for profile dropdown */
[data-theme="dark"] .profile-btn {
    background: #333;
    border-color: #007cba;
    color: #e0e0e0;
}

[data-theme="dark"] .profile-btn:hover {
    background: var(--link-hover);
    border-color: var(--link-hover);
    color: #333;
}

[data-theme="dark"] .profile-dropdown-content {
    background: #2a2a2a;
    border-color: #555;
    color: #e0e0e0;
}

[data-theme="dark"] .profile-dropdown-content hr {
    border-top-color: #555;
}

[data-theme="dark"] .profile-section select {
    background: #333;
    border-color: #555;
    color: #e0e0e0;
}

[data-theme="dark"] .profile-dropdown-content a {
    color: #ccc;
}

[data-theme="dark"] .profile-dropdown-content a:hover {
    color: #007cba;
}