html, body {
    height: 100%;
    margin: 0;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#map {
    height: 100%;
    width: 100%;
}

/* Position Leaflet zoom controls to avoid sidebar overlap */
.leaflet-top.leaflet-left {
    left: 440px;
    top: 20px;
    transition: left 0.3s ease;
}

/* When sidebar is hidden, move zoom controls to the left */
#clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left {
    left: 20px;
}

/* Ensure zoom controls are above sidebar when sidebar is hidden */
.leaflet-control-zoom {
    transition: left 0.3s ease;
}

/* Enhanced frosted glass effects for popups */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    color: #333;
    animation: popupSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Club icon styling */
.club-icon {
    transition: transform 0.3s ease;
}

.club-icon:hover {
    transform: scale(1.1);
}

/* Placeholder icon styling */
.placeholder-icon {
    background: rgba(52, 152, 219, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.placeholder-club-icon {
    font-size: 16px;
    color: white;
    text-align: center;
    line-height: 1;
}

/* Popup content styling */
.popup-content {
    text-align: center;
    padding: 10px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.popup-info {
    margin: 8px 0;
    color: #34495e;
}

.popup-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(52, 152, 219, 0.2);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: 20px;
    text-decoration: none;
    color: #2980b9;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.popup-link:hover {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.popup-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.edit-button {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 20px;
    color: #c0392b;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 14px;
    font-family: inherit;
}

.edit-button:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: rgba(231, 76, 60, 0.5);
    transform: translateY(-2px);
}

.equipment-container {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.equipment-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px;
}

.equipment-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.equipment-type {
    font-size: 10px;
    margin-top: 3px;
    color: #7f8c8d;
    text-transform: capitalize;
}

/* Repository button */
#repo-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

#repo-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#repo-button a:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

/* Left Sidebar */
#clubs-sidebar {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 380px;
    height: calc(100vh - 40px);
    z-index: 1000;
    transition: transform 0.3s ease;
}

#clubs-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-content {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 20px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.sidebar-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sidebar-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.filter-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
}

/* Tri-phased dropdown system */
.dropdown-container {
    position: relative;
    margin-bottom: 10px;
}

.dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.dropdown:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.dropdown:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.8);
    background: rgba(255, 255, 255, 0.85);
}

.dropdown::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: rgba(44, 62, 80, 0.7);
    transition: transform 0.3s ease;
}

.dropdown.open::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-sizing: border-box;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 5px;
    color: #2c3e50;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-option:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #1a252f;
}

.dropdown-option.selected {
    background: rgba(52, 152, 219, 0.4);
    color: #1a252f;
    font-weight: 500;
}

.option-text {
    white-space: nowrap;
}

.option-flag {
    font-size: 16px;
    margin-left: 8px;
}

.option-logo {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: contain;
    flex-shrink: 0;
}

.dropdown-label {
    font-size: 12px;
    color: #34495e;
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#club-search {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #2c3e50;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#club-search:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.8);
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#club-search::placeholder {
    color: rgba(44, 62, 80, 0.6);
}

.clubs-list-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 20px 20px 20px;
    overflow: hidden;
}

.clubs-list-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
    flex-shrink: 0;
}

.clubs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

/* Custom scrollbar for clubs list */
.clubs-list::-webkit-scrollbar {
    width: 6px;
}

.clubs-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.clubs-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    transition: background 0.3s ease;
}

.clubs-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.club-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.club-item:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(52, 152, 219, 0.4);
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.club-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: contain;
}

.club-info {
    flex: 1;
    min-width: 0;
}

.club-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-stadium {
    font-size: 12px;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submit button */
#submit-button {
    position: fixed;
    top: 20px;
    right: 200px;
    z-index: 1000;
}

#submit-button button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(52, 152, 219, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#submit-button button:hover {
    background: rgba(52, 152, 219, 1);
    transform: scale(1.05);
}

/* Ko-fi button */
#kofi-button {
    position: fixed;
    top: 20px;
    right: 140px;
    z-index: 1000;
}

#kofi-button button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 94, 77, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#kofi-button button:hover {
    background: rgba(255, 94, 77, 1);
    transform: scale(1.05);
}

/* Filter button */
#filter-button {
    position: fixed;
    top: 20px;
    right: 80px;
    z-index: 1000;
}

#filter-button button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(46, 204, 113, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#filter-button button:hover {
    background: rgba(46, 204, 113, 1);
    transform: scale(1.05);
}

/* Competition filter panel - now hidden since moved to sidebar */
#competition-filter {
    display: none;
}

.filter-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-content h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    text-align: center;
}

/* Hide old filter elements */
.filter-options,
.filter-btn {
    display: none;
}

/* Submission form */
#submission-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

#submission-form.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#submission-form.hidden .form-content {
    transform: translateY(-50px) scale(0.9);
}

#edit-form.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#edit-form.hidden .form-content {
    transform: translateY(-50px) scale(0.9);
}

/* Edit form */
#edit-form {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.form-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(0) scale(1);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.form-content h2 {
    margin-top: 0;
    color: #2c3e50;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #34495e;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* Highlight style for missing coordinates */
.form-group.highlight-missing {
    animation: highlightMissing 2s ease-in-out;
}

.form-group.highlight-missing input {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

.form-group.highlight-missing label {
    color: #e74c3c;
    font-weight: 700;
}

@keyframes highlightMissing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.form-actions button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-actions button[type="button"] {
    background: #95a5a6;
    color: white;
}

.form-actions button[type="button"]:hover {
    background: #7f8c8d;
}

.form-actions button[type="submit"] {
    background: #3498db;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: #2980b9;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    /* Sidebar adjustments for mobile */
    #clubs-sidebar {
        top: 10px;
        left: 10px;
        width: calc(100vw - 20px);
        height: calc(100vh - 20px);
        transform: translateX(-100%);
    }
    
    #clubs-sidebar.hidden {
        transform: translateX(-100%);
    }
    
    #clubs-sidebar:not(.hidden) {
        transform: translateX(0);
    }
    
    /* Show close button on mobile */
    .sidebar-close-btn {
        display: flex !important;
    }
    
    /* Adjust zoom controls for mobile */
    .leaflet-top.leaflet-left {
        left: 20px;
        top: 20px;
    }
    
    #clubs-sidebar.hidden ~ #map .leaflet-top.leaflet-left {
        left: 20px;
    }
    
    /* Adjust button positions for mobile */
    #repo-button {
        top: 10px;
        right: 10px;
    }
    
    #submit-button {
        top: 10px;
        right: 130px;
    }
    
    #kofi-button {
        top: 10px;
        right: 85px;
    }
    
    #filter-button {
        top: 10px;
        right: 175px;
    }
    
    /* Smaller buttons on mobile */
    #repo-button a,
    #submit-button button,
    #kofi-button button,
    #filter-button button {
        width: 40px;
        height: 40px;
    }
    
    /* Form adjustments for mobile */
    .form-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
}

@media screen and (max-width: 480px) {
    /* Extra small screens */
    #clubs-sidebar {
        top: 5px;
        left: 5px;
        width: calc(100vw - 10px);
        height: calc(100vh - 10px);
    }
    
    /* Stack buttons vertically on very small screens */
    #submit-button {
        top: 65px;
        right: 10px;
    }
    
    #kofi-button {
        top: 120px;
        right: 10px;
    }
    
    #filter-button {
        top: 175px;
        right: 10px;
    }
}

/* Tutorial panel */
.tutorial-panel {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tutorial-panel h4 {
    margin: 0 0 10px 0;
    color: #1976D2;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-panel p {
    margin: 5px 0;
    color: #424242;
    font-size: 14px;
    line-height: 1.4;
}

.tutorial-panel ol {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: #424242;
    font-size: 14px;
}

.tutorial-panel li {
    margin: 5px 0;
    line-height: 1.4;
}

.tutorial-panel .tutorial-icon {
    width: 18px;
    height: 18px;
    fill: #1976D2;
}

/* Footer styles */
footer {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 999;
}