@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&family=Teko:wght@400;700&display=swap');

@font-face {
    font-family: 'UFCSans-Regular';
    src: url('https://www.ufc.com/themes/custom/ufc/fonts/UFCSans-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'UFCSans-Regular', sans-serif; /* Updated primary font */
    font-size: 1.2em;
    margin: 0;
    background-color: #121212; /* Dark background */
    color: #e0e0e0; /* Light grey text */
    line-height: 1.6;
}

header {
    background-color: #000000; /* Black header */
    color: white;
    padding: 3em 0 1em 0; /* More top padding to accommodate auth container */
    text-align: center;
    border-bottom: 3px solid #d90429; /* UFC Red accent */
    position: relative;
}

header h1 {
    margin: 0;
    font-family: 'Teko', sans-serif; /* Impactful UFC-style font */
    font-size: 3em;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Authentication Styles */
#auth-container {
    position: absolute;
    top: 1em;
    right: 1em;
    display: flex;
    align-items: center;
    gap: 1em;
}

#sign-in-btn, #sign-out-btn, #user-btn {
    background-color: #d90429;
    color: white;
    border: none;
    padding: 0.5em 1em;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

#sign-in-btn:hover, #sign-out-btn:hover, #user-btn:hover {
    background-color: #b80020;
}

#auth-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-message {
    text-align: center;
    background-color: #1e1e1e;
    padding: 3em;
    border-radius: 8px;
    border: 2px solid #d90429;
    box-shadow: 0 5px 20px rgba(0,0,0,0.7);
    max-width: 500px;
}

.auth-message h2 {
    font-family: 'Teko', sans-serif;
    color: #d90429;
    text-transform: uppercase;
    margin-bottom: 1em;
    font-size: 2.5em;
}

.auth-message p {
    margin-bottom: 2em;
    font-size: 1.1em;
    color: #e0e0e0;
}

.primary-btn {
    background-color: #d90429;
    color: white;
    border: none;
    padding: 1em 2em;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.primary-btn:hover {
    background-color: #b80020;
}

main {
    padding: 1.5em;
    max-width: 1200px;
    margin: auto;
}

#fighter-shortlist-section, #ufc-events-section { /* Renamed for clarity if needed, or use existing IDs */
    background-color: #1e1e1e; /* Slightly lighter dark shade for sections */
    margin-bottom: 2em;
    padding: 1.5em;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* More pronounced shadow for depth */
}

#fighter-shortlist-section h2, #ufc-events-section h2 {
    font-family: 'Teko', sans-serif;
    text-transform: uppercase;
    color: #d90429;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5em;
    margin-top: 0;
}


#fighter-search {
    padding: 0.8em;
    margin-right: 0.5em;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #e0e0e0;
    font-size: 1em;
}

#add-fighter-btn {
    padding: 0.8em 1.5em;
    background-color: #d90429; /* UFC Red */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

#add-fighter-btn:hover {
    background-color: #b80020; /* Darker UFC Red on hover */
}

/* Fighter Shortlist Pill Styles */
#shortlisted-fighters {
    list-style-type: none;
    padding: 0;
    display: flex; /* Arrange pills in a row */
    flex-wrap: wrap; /* Allow pills to wrap to the next line */
    gap: 8px; /* Spacing between pills */
    margin-top: 10px;
}

.fighter-pill {
    background-color: #444444; /* Dark gray background for pills */
    color: white;
    padding: 4px 8px; /* Reduced padding */
    border-radius: 12px; /* Slightly smaller border-radius */
    display: inline-flex; /* Align items in a row */
    align-items: center; /* Vertically center content */
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.remove-fighter-btn {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #e0e0e0; /* Lighter color for the 'x' */
    transition: color 0.2s ease;
}

.remove-fighter-btn:hover {
    color: #ffffff; /* White on hover */
}

#shortlisted-fighters li {
    padding: 0.7em;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#shortlisted-fighters li:last-child {
    border-bottom: none;
}

#shortlisted-fighters li button {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 0.3em 0.6em;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}
#shortlisted-fighters li button:hover {
    background-color: #d90429;
}


.event-card {
    background: #2a2a2a; /* Darker card background */
    /* Optional: Add a subtle background pattern or gradient if desired */
    /* background-image: linear-gradient(145deg, #2a2a2a 0%, #1e1e1e 100%); */
    border: 2px solid #d90429; /* UFC Red border */
    border-radius: 8px;
    margin-bottom: 2em;
    padding: 1.5em;
    box-shadow: 0 5px 20px rgba(0,0,0,0.7);
    transition: transform 0.2s ease-in-out;
}

.event-card:hover {
    transform: translateY(-5px); /* Slight lift on hover */
}

.event-card h3 {
    margin-top: 0;
    margin-bottom: 0.8em;
    color: #ffffff; /* White event title */
    font-family: 'Teko', sans-serif; /* Impactful font */
    font-size: 2.2em;
    text-transform: uppercase;
    border-bottom: 2px solid #d90429;
    padding-bottom: 0.3em;
    letter-spacing: 1px;
}

.event-card dl {
    margin-bottom: 1.5em;
    display: grid;
    grid-template-columns: 120px auto; /* For a two-column layout */
    gap: 0.5em 1em;
}
.event-card dt {
    font-weight: bold;
    color: #aaaaaa; /* Lighter grey for keys */
    text-transform: uppercase;
    font-size: 0.9em;
}
.event-card dd {
    margin-left: 0; /* Reset margin as grid handles spacing */
    color: #e0e0e0;
    font-size: 0.95em;
}
.event-card dl br { /* Remove the <br> styling if it was used for spacing */
    display: none;
}


.fights-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5em;
}

.fights-table th, .fights-table td {
    border: 1px solid #444; /* Darker borders */
    padding: 0.8em;
    text-align: left;
}

.fights-table th {
    background-color: #d90429; /* UFC Red for table headers */
    color: #ffffff;
    text-transform: uppercase;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.95em;
    letter-spacing: 0.5px;
}

.fights-table tbody tr:nth-child(odd) td {
    background-color: #333333; /* Zebra striping for dark theme */
}
.fights-table tbody tr:nth-child(even) td {
    background-color: #2c2c2c;
}


.fight-card-header {
    background-color: #1a1a1a !important; /* Very dark for card type headers */
    font-family: 'Teko', sans-serif;
    font-size: 1.4em;
    text-transform: uppercase;
    text-align: center !important;
    color: #d90429; /* UFC Red text */
    letter-spacing: 1px;
}

.highlight {
    background-color: #d90429; /* UFC Red */
    color: #ffffff; /* White text for contrast */
    font-weight: bold;
}

/* Style for fighter cells to ensure consistent padding/alignment */
.fighter-cell {
    padding: 10px 8px;
}

/* Specific highlight style for shortlisted fighters */
.fighter-cell.highlight {
    background-color: #28a745 !important; /* A vibrant green color */
    color: #fff !important;
    font-weight: bold;
    border-radius: 4px; /* Optional: rounded corners for the highlight */
    /* Add a subtle glow or border if desired */
    /* box-shadow: 0 0 8px rgba(217, 4, 41, 0.7); */
}

/* British fighter highlighting */
.fighter-cell.british-fighter {
    background-color: #2196F3 !important; /* Blue for British fighters */
    color: #fff !important;
    font-weight: bold;
    border-radius: 4px;
}

/* Combined style for fighters who are both shortlisted AND British */
.fighter-cell.highlight.british-fighter {
    background: linear-gradient(135deg, #28a745 0%, #2196F3 100%) !important;
    color: #fff !important;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(33, 150, 243, 0.5);
}

/* Mobile-optimized sticky fighter bar */
#fighter-shortlist-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    border-bottom: 2px solid #d90429;
    padding: 12px 15px;
    margin: -1.5em -1.5em 1.5em -1.5em;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.fighter-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

.fighter-count-badge {
    background: #d90429;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.expand-btn {
    background: transparent;
    border: 2px solid #d90429;
    color: #d90429;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expand-btn:active {
    transform: scale(0.95);
    background: rgba(217, 4, 41, 0.1);
}

.fighter-preview {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
}

.fighter-preview::-webkit-scrollbar {
    display: none;
}

.preview-pill {
    background: #444;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Full-screen overlay */
.fighter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #121212;
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.fighter-overlay.active {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.overlay-header {
    background: #000;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #d90429;
    gap: 10px;
}

.overlay-header h2 {
    margin: 0;
    color: #d90429;
    font-family: 'Teko', sans-serif;
    font-size: 2em;
    text-transform: uppercase;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-overlay-btn {
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.overlay-add-section {
    padding: 12px 15px;
    background: #1e1e1e;
    border-bottom: 2px solid #333;
}

.overlay-add-section .fighter-search-container {
    width: 100%;
    margin-bottom: 10px;
}

.overlay-add-section #fighter-search {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1em;
    box-sizing: border-box;
}

.overlay-add-section #add-fighter-btn {
    width: 100%;
    padding: 12px;
    font-size: 1em;
}

.overlay-fighters-list {
    overflow-y: auto;
    padding: 15px;
    list-style: none;
    margin: 0;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 200px); /* Fixed height instead of flex: 1 */
}

.overlay-fighters-list .fighter-pill {
    background: #2a2a2a;
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px; /* Fixed height instead of min-height */
    border: 1px solid #444;
}

.overlay-fighters-list .fighter-name-pill {
    font-size: 1em;
    flex: 1;
    cursor: pointer;
    padding-right: 10px;
}

.overlay-fighters-list .remove-fighter-btn {
    width: 36px;
    height: 36px;
    background: #d90429;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-left: 10px;
    flex-shrink: 0;
}

/* Custom fighter search dropdown styles */
.fighter-search-container {
    position: relative;
    display: inline-block;
    width: auto;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background-color: #d90429;
    color: #ffffff;
}

.suggestion-item.no-results {
    color: #999;
    font-style: italic;
    cursor: default;
}

.suggestion-item.no-results:hover {
    background-color: #1e1e1e;
    color: #999;
}

.refresh-btn {
    margin-left: 10px;
    font-size: 14px;
    padding: 4px 14px;
    border-radius: 5px;
    background: #2d3748;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
}
.refresh-btn:hover, .refresh-btn:focus {
    background: #4a5568;
    color: #fff;
    border: 1px solid #90cdf4;
    outline: none;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background-color: #2d3748;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background-color: #d90429;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    body {
        font-size: 1em;
    }
    
    main {
        padding: 0;
    }
    
    #fighter-shortlist-bar {
        margin: 0 0 1em 0;
        border-radius: 0;
    }
    
    .fighter-bar-header {
        padding: 0 5px;
    }
    
    .overlay-add-section {
        flex-direction: column;
    }
    
    .overlay-add-section .fighter-search-container {
        width: 100%;
    }
    
    .overlay-add-section #add-fighter-btn {
        width: 100%;
        padding: 15px;
        font-size: 1.1em;
    }
    
    .event-card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    #auth-container {
        position: static;
        margin-top: 10px;
        justify-content: center;
    }
    
    header {
        padding: 1em 0;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    #ufc-events {
        padding: 1em;
    }
}
