/* Modal Styles for Competition Results */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.show {
    opacity: 1;
}

/* Modal Container */
.modal-container {
    background: #ffffff;
    border-radius: 20px;
    max-width: 95vw;
    max-height: 90vh;
    width: 1200px;
    height: 85vh;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) translateY(40px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.show .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1a3f67, #2c5aa0, #4a90c2);
    color: white;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 80px;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
    line-height: 1.3;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

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

.modal-close:active {
    transform: scale(0.95);
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #f8f9fa;
}

/* Results Controls */
.results-controls {
    position: sticky;
    top: 0;
    background: white;
    padding: 1rem 2rem;
    border-bottom: 2px solid #e9ecef;
    z-index: 100;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

.results-search {
    flex: 1;
    min-width: 250px;
}

.results-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.results-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 63, 103, 0.1);
}

.gender-filter {
    display: flex;
    gap: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 12px;
}

.gender-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.gender-btn.active,
.gender-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Modal Results */
.modal-results {
    padding: 1.5rem 2rem 2rem;
    min-height: calc(100% - 150px);
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.results-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.results-header h3 {
    font-size: 1.2rem;
    color: #666;
    font-weight: 500;
    margin: 0;
}

/* Results Section */
.results-section {
    margin-bottom: 2rem;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.results-section.hidden {
    display: none;
}

.results-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(26, 63, 103, 0.1), rgba(26, 63, 103, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(26, 63, 103, 0.1);
}

/* Weight Category */
.weight-category {
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid var(--primary-color);
    border: 1px solid #e9ecef;
}

.weight-category.hidden {
    display: none;
}

.weight-category h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.weight-category h4::before {
    content: '🥋';
    font-size: 1.5rem;
}

/* Results List */
.weight-category ol {
    margin: 0;
    padding-left: 1.25rem;
    counter-reset: result-counter;
    list-style: none;
}

.weight-category li {
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.75rem 0.6rem 2.5rem;
    background: white;
    border-radius: 8px;
    font-weight: 500;
    color: #333;
    position: relative;
    transition: all 0.3s ease;
    counter-increment: result-counter;
    border-left: 3px solid transparent;
    border: 1px solid #e9ecef;
    font-size: 0.95rem;
    line-height: 1.4;
}

.weight-category li.hidden {
    display: none;
}

.weight-category li:hover {
    background: #f0f8ff;
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

/* Medal positions styling */
.weight-category li:nth-child(1) {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #8b5000;
    font-weight: 700;
    border-left-color: #ffd700;
}

.weight-category li:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5);
    color: #4a4a4a;
    font-weight: 700;
    border-left-color: #c0c0c0;
}

.weight-category li:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    color: #5d4037;
    font-weight: 700;
    border-left-color: #cd7f32;
}

/* Position badges */
.weight-category li::before {
    content: counter(result-counter);
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.weight-category li:nth-child(1)::before {
    background: #ffd700;
    color: #8b5000;
    content: '🥇';
    font-size: 1rem;
}

.weight-category li:nth-child(2)::before {
    background: #c0c0c0;
    color: #4a4a4a;
    content: '🥈';
    font-size: 1rem;
}

.weight-category li:nth-child(3)::before {
    background: #cd7f32;
    color: #5d4037;
    content: '🥉';
    font-size: 1rem;
}

/* Empty State */
.results-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    margin: 2rem 0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.results-empty p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Scrollbar Styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Animation for modal content */
.modal-results {
    animation: slideInUp 0.5s ease-out;
}

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

/* Search highlight */
.search-highlight {
    background: yellow;
    font-weight: 700;
    padding: 0 0.25rem;
    border-radius: 3px;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    z-index: 10001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.notification-error {
    border-left-color: #e74c3c;
}

.notification.notification-success {
    border-left-color: #27ae60;
}

.notification.notification-warning {
    border-left-color: #f39c12;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.notification-message {
    flex: 1;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-close:hover {
    background: #f5f5f5;
    color: #666;
}

/* Mobile Adaptations for Modal */
@media (max-width: 768px) {
    .modal-container {
        width: 95vw;
        height: 90vh;
        max-height: 90vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        min-height: 60px;
    }

    .modal-title {
        font-size: 1.2rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
    }

    .results-controls {
        padding: 0.75rem 1.5rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
    }

    .results-search {
        min-width: auto;
    }

    .gender-filter {
        justify-content: center;
    }

    .modal-results {
        padding: 1rem 1.5rem 1.5rem;
    }

    .results-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .results-section h3 {
        font-size: 1.1rem;
        padding: 0.5rem;
    }

    .weight-category {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .weight-category h4 {
        font-size: 1rem;
    }

    .weight-category li {
        padding: 0.5rem 0.6rem 0.5rem 2.2rem;
        font-size: 0.9rem;
    }

    .weight-category li::before {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        left: 0.4rem;
    }
}

@media (max-width: 480px) {
    .modal-container {
        width: 98vw;
        height: 95vh;
        border-radius: 8px;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .results-controls {
        padding: 0.5rem 1rem;
    }

    .modal-results {
        padding: 0.75rem 1rem 1rem;
    }

    .weight-category li {
        padding: 0.4rem 0.5rem 0.4rem 2rem;
        font-size: 0.85rem;
    }
}