/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary-color: #0891b2;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.info-card h3,
.info-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.info-card p {
    color: var(--text-light);
}

/* Section Title */
.section-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

/* Tabs */
.event-tabs,
.gender-tabs,
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn,
.gender-tab-btn,
.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.tab-btn:hover,
.gender-tab-btn:hover,
.admin-tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active,
.gender-tab-btn.active,
.admin-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Leaderboard Content */
.leaderboard-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.leaderboard-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-section:last-child {
    border-bottom: none;
}

.leaderboard-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Data Tables */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--bg-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

.rank-other {
    background: var(--bg-light);
    color: var(--text-light);
}

/* Medal Badge */
.medal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
}

.medal-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.medal-silver {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: white;
}

.medal-bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

/* Registration Form */
.registration-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Scores Grid */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.scores-grid .form-group {
    margin-bottom: 0;
}

.scores-grid label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.scores-grid input {
    text-align: center;
    font-weight: 600;
}

/* Score Summary */
.score-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.summary-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.summary-item span {
    color: var(--text-light);
}

.summary-item strong {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Admin Section */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Participants List */
.participants-list {
    display: grid;
    gap: 1rem;
}

.participant-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.participant-card:hover {
    box-shadow: var(--shadow-md);
}

.participant-info {
    flex: 1;
}

.participant-info h4 {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.participant-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.participant-scores {
    min-width: 280px;
    flex-shrink: 0;
    margin-left: 1.5rem;
}

/* Scores Container */
.participant-scores .scores-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Score Rows */
.participant-scores .scores-row {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.participant-scores .scores-row-secondary {
    justify-content: flex-start;
}

/* Score Items */
.participant-scores .score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.625rem;
    min-width: 52px;
    transition: all 0.2s ease;
}

.participant-scores .score-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.participant-scores .score-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.participant-scores .score-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Score Total Section */
.participant-scores .score-total {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

.participant-scores .score-total-empty {
    background: var(--bg-light);
    color: var(--text-light);
}

.participant-scores .total-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.125rem;
}

.participant-scores .total-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.participant-scores .total-avg {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.participant-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    justify-content: center;
    margin-left: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.participant-info {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.participant-info p {
    margin-bottom: 0.25rem;
}

.participant-info strong {
    color: var(--text-dark);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--text-dark);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .registration-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-summary {
        flex-direction: column;
        gap: 0.75rem;
    }

    .participant-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .participant-scores {
        min-width: 100%;
        width: 100%;
    }

    .participant-scores .scores-row {
        justify-content: center;
    }

    .participant-scores .score-item {
        min-width: 48px;
    }

    .participant-actions {
        margin-left: 0;
        width: 100%;
        align-items: flex-start;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-filters {
        width: 100%;
    }

    .admin-filters select {
        flex: 1;
        min-width: 150px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

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

    .nav-brand span {
        font-size: 1rem;
    }
}

/* Score Status Styles */
.score-empty {
    background: var(--bg-light);
    color: var(--text-light);
    font-style: italic;
}

.text-muted {
    color: var(--text-light);
    opacity: 0.7;
}

/* Table Action Button Visibility */
.data-table td:last-child {
    white-space: nowrap;
    width: 1%;
}

.data-table .btn-sm {
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
}

/* Fix button colors in tables/white backgrounds */
.data-table .btn-secondary,
.participant-actions .btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.data-table .btn-secondary:hover,
.participant-actions .btn-secondary:hover {
    background-color: var(--primary-color);
}

.data-table .btn-primary,
.participant-actions .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.data-table .btn-primary:hover,
.participant-actions .btn-primary:hover {
    background-color: var(--primary-dark);
}
/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary-color: #0891b2;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-brand i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.info-card h3,
.info-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.info-card p {
    color: var(--text-light);
}

/* Section Title */
.section-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
}

/* Tabs */
.event-tabs,
.gender-tabs,
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tab-btn,
.gender-tab-btn,
.admin-tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.tab-btn:hover,
.gender-tab-btn:hover,
.admin-tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tab-btn.active,
.gender-tab-btn.active,
.admin-tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Leaderboard Content */
.leaderboard-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.leaderboard-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-section:last-child {
    border-bottom: none;
}

.leaderboard-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Data Tables */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--bg-light);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Rank Badge */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.rank-2 {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

.rank-other {
    background: var(--bg-light);
    color: var(--text-light);
}

/* Medal Badge */
.medal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
}

.medal-gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.medal-silver {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
    color: white;
}

.medal-bronze {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: white;
}

/* Registration Form */
.registration-form {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Scores Grid */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.scores-grid .form-group {
    margin-bottom: 0;
}

.scores-grid label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.scores-grid input {
    text-align: center;
    font-weight: 600;
}

/* Score Summary */
.score-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.summary-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.summary-item span {
    color: var(--text-light);
}

.summary-item strong {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Admin Section */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-filters select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Participants List */
.participants-list {
    display: grid;
    gap: 1rem;
}

.participant-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.participant-card:hover {
    box-shadow: var(--shadow-md);
}

.participant-info {
    flex: 1;
}

.participant-info h4 {
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.participant-info p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.participant-scores {
    min-width: 280px;
    flex-shrink: 0;
    margin-left: 1.5rem;
}

/* Scores Container */
.participant-scores .scores-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Score Rows */
.participant-scores .scores-row {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-start;
}

.participant-scores .scores-row-secondary {
    justify-content: flex-start;
}

/* Score Items */
.participant-scores .score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem 0.625rem;
    min-width: 52px;
    transition: all 0.2s ease;
}

.participant-scores .score-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.participant-scores .score-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.125rem;
}

.participant-scores .score-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Score Total Section */
.participant-scores .score-total {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    box-shadow: var(--shadow-sm);
}

.participant-scores .score-total-empty {
    background: var(--bg-light);
    color: var(--text-light);
}

.participant-scores .total-label {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.125rem;
}

.participant-scores .total-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.participant-scores .total-avg {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.participant-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
    justify-content: center;
    margin-left: auto;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

.participant-info {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.participant-info p {
    margin-bottom: 0.25rem;
}

.participant-info strong {
    color: var(--text-dark);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--text-dark);
    color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .main-content {
        padding: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .registration-form {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-summary {
        flex-direction: column;
        gap: 0.75rem;
    }

    .participant-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .participant-scores {
        min-width: 100%;
        width: 100%;
    }

    .participant-scores .scores-row {
        justify-content: center;
    }

    .participant-scores .score-item {
        min-width: 48px;
    }

    .participant-actions {
        margin-left: 0;
        width: 100%;
        align-items: flex-start;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-filters {
        width: 100%;
    }

    .admin-filters select {
        flex: 1;
        min-width: 150px;
    }

    .toast {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

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

    .nav-brand span {
        font-size: 1rem;
    }
}

/* Score Status Styles */
.score-empty {
    background: var(--bg-light);
    color: var(--text-light);
    font-style: italic;
}

.text-muted {
    color: var(--text-light);
    opacity: 0.7;
}

/* Table Action Button Visibility */
.data-table td:last-child {
    white-space: nowrap;
    width: 1%;
}

.data-table .btn-sm {
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
}

/* Fix button colors in tables/white backgrounds */
.data-table .btn-secondary,
.participant-actions .btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.data-table .btn-secondary:hover,
.participant-actions .btn-secondary:hover {
    background-color: var(--primary-color);
}

.data-table .btn-primary,
.participant-actions .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.data-table .btn-primary:hover,
.participant-actions .btn-primary:hover {
    background-color: var(--primary-dark);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--primary-color);
}

.loading-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem;
    color: var(--danger-color);
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Berkumpulan Team Members Styles */
.berkumpulan-card {
    border-left: 4px solid var(--accent-color);
}

.event-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.event-badge-small {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

.team-members-list {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.team-members-list strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.team-members {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
}

.team-members li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background-color: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.member-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.member-name {
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
}

.member-ic {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Modal participant info adjustments */
#modalParticipantInfo .team-members-list {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
}

/* Score edit page team members */
.score-edit .team-members-list {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
