/* Competitions Page Styles */
.competitions-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.competitions-header {
    margin-bottom: 30px;
}

.competitions-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* Tab Buttons */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--secondary);
    background-color: var(--bg-hover);
}

.tab-btn.active {
    color: var(--secondary);
    border-bottom-color: var(--secondary);
    background-color: var(--bg-hover);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

.alert-warning {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning-text);
}

.alert-danger {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger);
    color: var(--danger-text);
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success-text);
}

/* Competitions List */
.competitions-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.no-competitions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Competition Card */
.competition-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-light);
    padding: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.competition-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px var(--shadow-medium);
    border-color: var(--secondary);
}

.competition-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.competition-title {
    flex: 1;
}

.competition-title h3 {
    margin: 8px 0 0 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.competition-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-league {
    background-color: var(--type-league-bg);
    color: var(--type-league);
}

.type-cup {
    background-color: var(--type-cup-bg);
    color: var(--type-cup);
}

.type-mixed {
    background-color: var(--type-mixed-bg);
    color: var(--type-mixed);
}

.level-badge {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Level colors — same scheme as UpcomingMatches */
.level-badge.level-1  { background: rgba(255, 215, 0, 0.18);   color: #ffd700; }
.level-badge.level-2  { background: rgba(192, 192, 192, 0.18); color: #c0c0c0; }
.level-badge.level-3  { background: rgba(205, 127, 50, 0.18);  color: #cd7f32; }
.level-badge.level-4  { background: rgba(76, 175, 80, 0.18);   color: #4caf50; }
.level-badge.level-5  { background: rgba(33, 150, 243, 0.18);  color: #2196f3; }
.level-badge.level-6  { background: rgba(156, 39, 176, 0.18);  color: #9c27b0; }
.level-badge.level-7  { background: rgba(255, 87, 34, 0.18);   color: #ff5722; }
.level-badge.level-8  { background: rgba(96, 125, 139, 0.18);  color: #607d8b; }
.level-badge.level-9  { background: rgba(121, 85, 72, 0.18);   color: #795548; }
.level-badge.level-10 { background: rgba(158, 158, 158, 0.18); color: #9e9e9e; }

/* Competition Info */
.competition-info {
    margin: 15px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    text-align: right;
}

.info-value.money {
    color: var(--money-positive);
    font-weight: 700;
}

/* Competition Actions */
.competition-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--text-light);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--btn-secondary-hover);
}

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--text-light);
}

.btn-danger:hover:not(:disabled) {
    background: var(--btn-danger-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.btn-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background-color: var(--bg-section);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.competition-details {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.competition-details li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.competition-details li:last-child {
    border-bottom: none;
}

.form-group {
    margin-top: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-input);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--bg-input);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--secondary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.spinner-sm {
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--text-light);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Completed Competition Styles */
.final-position {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(46, 204, 113, 0.1));
    border-radius: 8px;
    padding: 12px !important;
    margin-top: 10px;
}

.position-badge {
    font-weight: bold;
    font-size: 1.1rem;
}

.position-badge.position-1 {
    color: #f1c40f;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.position-badge.position-2 {
    color: #bdc3c7;
    text-shadow: 0 0 10px rgba(189, 195, 199, 0.5);
}

.position-badge.position-3 {
    color: #cd7f32;
    text-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.winner-row {
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.1), rgba(230, 126, 34, 0.1));
    border-radius: 8px;
    padding: 12px !important;
    margin-top: 5px;
}

.winner-row .info-value a {
    color: var(--accent);
    font-weight: bold;
    text-decoration: none;
}

.winner-row .info-value a:hover {
    text-decoration: underline;
}

/* Prizes Summary */
.prizes-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    padding: 10px;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.1), rgba(230, 126, 34, 0.1));
    border-radius: 8px;
}

.prize-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: default;
}

.prize-badge.pot {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #1a1a1a;
}

.prize-badge.first {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #1a1a1a;
}

.prize-badge.win {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.prize-badge.draw {
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: white;
}

/* Promotion/Relegation badges */
.promotion-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: default;
}

.promo-badge.up {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.promo-badge.down {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.promo-badge.official {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.promo-badge.no-promo {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

/* No promotion warning in signup modal */
.no-promotion-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 12px 0;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(230, 126, 34, 0.2));
    border: 1px solid #f39c12;
    border-radius: 8px;
    color: #f5a623;
    font-weight: 500;
}

.no-promotion-warning .warning-icon {
    font-size: 1.3rem;
}

/* History Filters */
.history-filters {
    background: var(--bg-section);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 2px solid var(--border-input);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.3s ease;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.filter-group input::placeholder {
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-section);
    border-radius: 8px;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.btn-page {
    padding: 8px 16px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--secondary);
    background: var(--bg-hover);
    color: var(--secondary);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .competitions-list {
        grid-template-columns: 1fr;
    }

    .competitions-header h1 {
        font-size: 2rem;
    }

    .tab-buttons {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        text-align: left;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .prizes-summary {
        justify-content: center;
    }

    .history-filters {
        padding: 16px;
    }

    .filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
}
