:root {
    --primary-color: #FC6D26;
    --primary-hover: #e55a1b;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark: #1a1a1a;
    --gray-900: #212529;
    --gray-800: #343a40;
    --gray-700: #495057;
    --gray-600: #6c757d;
    --gray-500: #adb5bd;
    --gray-400: #ced4da;
    --gray-300: #dee2e6;
    --gray-200: #e9ecef;
    --gray-100: #f8f9fa;
    --white: #ffffff;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --box-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-900);
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
}

/* Default for screens that don't need flex */
.screen.active {
    display: block;
}

/* Specific screens that need flex - will be set to flex when shown */
#loginScreen {
    display: none;
    align-items: center;
    justify-content: center;
}

#loadingScreen {
    display: none;
    align-items: center;
    justify-content: center;
}

#unauthorizedScreen {
    display: none;
    align-items: center;
    justify-content: center;
}

/* Login Screen */
.login-container {
    width: 100%;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--box-shadow-lg);
    text-align: center;
    animation: slideUp 0.5s ease;
}

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

.logo {
    margin-bottom: 24px;
    display: inline-block;
    padding: 16px;
    background: linear-gradient(135deg, rgba(252, 109, 38, 0.1) 0%, rgba(252, 109, 38, 0.2) 100%);
    border-radius: 16px;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--gray-900);
}

.subtitle {
    color: var(--gray-600);
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-family);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(252, 109, 38, 0.3);
}

.btn-secondary {
    background: var(--gray-600);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-700);
}

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-400);
}

.btn-outline:hover {
    background: var(--gray-100);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--info-color);
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.15) 100%);
    border-radius: var(--border-radius);
    color: var(--info-color);
    font-size: 14px;
}

/* Loading Screen */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#loadingMessage {
    color: var(--white);
    font-size: 18px;
    font-weight: 500;
}

/* Unauthorized Screen */
.unauthorized-container {
    width: 100%;
    padding: 20px;
}

.unauthorized-card {
    background: var(--white);
    border-radius: 16px;
    padding: 48px;
    max-width: 520px;
    width: 100%;
    box-shadow: var(--box-shadow-lg);
    text-align: center;
}

.unauthorized-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: var(--danger-color);
}

.user-info-box {
    background: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 24px 0;
    text-align: left;
}

.user-info-box p {
    margin: 8px 0;
    color: var(--gray-700);
}

.user-info-box strong {
    color: var(--gray-900);
}

.help-text {
    color: var(--gray-600);
    margin-bottom: 24px;
}

.contact-admin {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.contact-admin h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--gray-900);
}

.access-request-info {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 14px;
    color: #495057;
}

.contact-admin button {
    margin-top: 15px;
}

/* Documentation Screen */
#docsScreen {
    background: var(--gray-100);
    min-height: 100vh;
}

.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 16px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-color);
    color: var(--white);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gray-300);
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.user-username {
    font-size: 12px;
    color: var(--gray-600);
}

.docs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

#swagger-ui {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--box-shadow);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    min-width: 300px;
    box-shadow: var(--box-shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--gray-900);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .user-menu {
        width: 100%;
        justify-content: space-between;
    }
    
    .docs-container {
        padding: 16px;
    }
    
    #swagger-ui {
        padding: 16px;
    }
}