﻿/* Element styling using the theme variables */
body {
    background-color: var(--background);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.025em;
    transition: var(--transition-normal);
    min-height: 100vh;
    position: relative;
}

/* Header styling - UPDATED for single row layout */
.header-container {
    background: var(--card);
    border-radius: var(--card-border-radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    /* NEW: Single row layout properties */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 60px;
}

/* NEW: Modules container with horizontal scroll */
#header-modules {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    flex: 1;
    padding-bottom: 0.25rem;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Custom scrollbar styling for webkit browsers */
#header-modules::-webkit-scrollbar {
    height: 4px;
}

#header-modules::-webkit-scrollbar-track {
    background: transparent;
}

#header-modules::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

#header-modules::-webkit-scrollbar-thumb:hover {
    background: var(--info-color);
}

/* Module buttons and dropdowns - UPDATED */
.swagger-button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    text-decoration: none;
    white-space: nowrap; /* NEW: Prevents text wrapping */
    flex-shrink: 0; /* NEW: Prevents button shrinking */
}

.swagger-button:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: white;
}

.swagger-button:active {
    transform: translateY(0);
}

.swagger-button i {
    font-size: 1.1rem;
}

/* Dropdown styling - UPDATED */
.dropdown {
    flex-shrink: 0; /* NEW: Prevents dropdown shrinking */
}

.dropdown-menu {
    background: var(--card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: var(--hover);
    color: var(--text);
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--info-color);
}

.dropdown-divider {
    border-color: var(--border-color);
    margin: 0.5rem 0;
}

/* Header controls (theme toggle and network status) - UPDATED */
.header-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0; /* NEW: Prevents shrinking */
}

/* Theme toggle button */
.theme-toggle {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    background: var(--primary-gradient);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    z-index: 1000;
    flex-shrink: 0;
}

.theme-toggle:hover {
    transform: rotate(30deg) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: var(--transition-normal);
}

/* Network status badge */
#network-connection {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    flex-shrink: 0;
}

#network-connection.bg-success {
    background: var(--success-color) !important;
}

#network-connection.bg-danger {
    background: var(--error-color) !important;
}

/* Current time display */
#current-time {
    background: var(--card);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    height: 38px;
    display: flex;
    align-items: center;
    white-space: nowrap; /* NEW: Prevents time from wrapping */
    flex-shrink: 0; /* NEW: Prevents shrinking */
}

/* Alert styling */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert i {
    font-size: 1.25rem;
}

.alert-warning {
    background: linear-gradient(135deg, #ffcc00 0%, #ff9900 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
    color: white;
}

/* Responsive adjustments - UPDATED */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        margin-bottom: 1rem;
        gap: 0.75rem;
    }

    /* Keep single row layout on mobile but adjust sizes */
    #header-modules {
        gap: 0.5rem;
    }

    .swagger-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .header-controls {
        gap: 0.5rem;
    }

    .theme-toggle,
    #network-connection {
        width: 34px;
        height: 34px;
    }

    .theme-toggle i,
    #network-connection i {
        font-size: 1rem;
    }

    #current-time {
        height: 34px;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }

    .dropdown-menu {
        min-width: 180px;
    }
}

/* Extra small screens - stack vertically if absolutely necessary */
@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }

    #header-modules {
        justify-content: center;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .header-controls {
        justify-content: center;
        align-self: center;
    }
}

/* Toast notifications styling */
/*.toast {
    background: var(--card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: var(--card-darker);
    border-bottom: 1px solid var(--border-color);
    color: var(--text);
}

.toast-body {
    color: var(--text);
}*/

/* Spinning overlay */
.spinning-overlay {
    background: var(--background-transparent-80);
    backdrop-filter: blur(4px);
}

.spinner-border {
    color: var(--info-color);
    width: 3rem;
    height: 3rem;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 2rem;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Additional responsive rules for page content */
@media (max-width: 768px) {
    .header-container {
        margin: -1rem -1rem 1rem -1rem;
        border-radius: 0;
    }

    .content-container {
        padding: 0 0.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }
}