/* Base styles */
:root {
    --primary-color: #4a90e2;
    --text-color: #333;
    --background-color: #fff;
    --border-color: #ddd;
}

/* HTMX Indicators */
.htmx-indicator {
    display: none;
}
.loading .htmx-indicator,
.htmx-request .htmx-indicator {
    display: inline-flex;
    align-items: center;
}
.loading.htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
}

/* Layout */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-grid {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 2rem;
    padding: 2rem;
}

@media (max-width: 768px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-right {
        display: none;
    }
}

/* Navigation */
.main-nav {
    background: var(--background-color);
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-color);
    margin: 5px 0;
}

.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
    }
}

/* Search */
.search-container input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
}

.dropdown-menu a:hover {
    background: var(--border-color);
}

.dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 1rem;
    background: var(--background-color);
    border-top: 1px solid var(--border-color);
}

/* Modal Background Styles */
dialog {
    /* Ensure white background on all modals */
    background-color: white !important;

    /* Reset any inherited background styles */
    background: white !important;
}

/* Ensure modal content areas have white backgrounds */
dialog .modal-header,
dialog .modal-body,
dialog .modal-footer {
    background-color: white !important;
}

/* Ensure dialog backdrop overlay */
dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* For browsers that don't support ::backdrop, use a polyfill approach */
dialog[open] {
    /* Ensure dialog has proper z-index */
    z-index: 9999;
}

/* Ensure modal inner containers have white backgrounds */
dialog > div {
    background-color: white !important;
}

/* Fix for any transparent or gray backgrounds in modal sections */
.modal-header,
.modal-body,
.modal-footer {
    background-color: white !important;
}

/* Team Selector Dropdown Styles */
.team-selector-details summary::-webkit-details-marker {
    display: none;
}
.team-selector-details summary {
    list-style: none;
}

/* Rotate chevron when open */
.team-selector-details[open] summary .fa-chevron-down {
    transform: rotate(180deg);
}

/* Fix Safari background and positioning issues */
.team-selector-details > div {
    /* Ensure solid white background for Safari */
    background-color: white !important;
    background: white !important;

    /* Position absolutely to prevent layout shift */
    position: absolute !important;
    top: 100%;

    /* Ensure it's above other content */
    z-index: 50;

    /* Add webkit-specific fixes for Safari */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Ensure dropdown content is visible when open */
.team-selector-details[open] > div {
    display: block;
}

/* Hide content when closed */
.team-selector-details:not([open]) > div {
    display: none;
}

/* Ensure the details element doesn't expand when open */
.team-selector-details {
    /* Prevent layout expansion */
    contain: layout style;
}

/* Utils - Updated to avoid conflicts with Tailwind responsive utilities */
/* Removed .hidden class to avoid conflicts with Tailwind's responsive utilities */

.no-uppercase {
    text-transform: none;
    font-size: 0.9em;
}
