/* FantaScherma - Main Stylesheet */

:root {
    --primary-color: #1a5f7a;
    --secondary-color: #57c5b6;
    --accent-color: #159895;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --muted-text: #6c757d;
    --star-color: #ffc107;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
}

/* Base */
html {
    height: 100%;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 56px;
}

.main-content {
    flex: 1;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color) !important;
}

.navbar-brand {
    font-weight: bold;
}

.nav-link.active {
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--light-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Athlete Cards */
.athlete-card {
    cursor: pointer;
}

.athlete-card .card-body {
    padding: 1rem;
}

.athlete-card .athlete-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.athlete-card .athlete-club {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.athlete-card .athlete-price {
    font-weight: bold;
    color: var(--primary-color);
}

.athlete-card .athlete-stats {
    margin-top: 0.5rem;
}

/* Stats Stars */
.stat-stars {
    display: inline-flex;
    gap: 2px;
}

.stat-stars .bi-star-fill {
    color: var(--star-color);
}

.stat-stars .bi-star {
    color: #dee2e6;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.stat-label {
    color: var(--muted-text);
}

/* Team Builder */
.team-slot {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.team-slot.filled {
    border-style: solid;
    border-color: var(--primary-color);
    background-color: rgba(26, 95, 122, 0.05);
}

.team-slot.reserve {
    border-color: var(--muted-text);
}

.team-slot.reserve.filled {
    border-color: var(--secondary-color);
    background-color: rgba(87, 197, 182, 0.05);
}

.team-slot .slot-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted-text);
    margin-bottom: 0.5rem;
}

.team-slot .athlete-info {
    font-weight: 600;
}

.team-slot .remove-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
}

.team-slot.unavailable {
    opacity: 0.6;
    border-style: dashed;
    background-color: rgba(220, 53, 69, 0.05);
}

.team-slot.unavailable .athlete-info {
    text-decoration: line-through;
}

/* Leaderboard */
.leaderboard-table {
    margin-bottom: 0;
}

.leaderboard-table th {
    border-top: none;
    background-color: var(--light-bg);
}

.leaderboard-table .rank {
    font-weight: bold;
    width: 50px;
}

.leaderboard-table .rank-1 { color: #ffd700; }
.leaderboard-table .rank-2 { color: #c0c0c0; }
.leaderboard-table .rank-3 { color: #cd7f32; }

.leaderboard-table .points {
    font-weight: bold;
    color: var(--primary-color);
}

.leaderboard-table .current-user {
    background-color: rgba(26, 95, 122, 0.1);
}

/* Credits Display */
.credits-display {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.credits-display .credits-value {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(87, 197, 182, 0.25);
}

/* Badges */
.badge-phase {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.badge-registration { background-color: var(--success-color); }
.badge-in-progress { background-color: var(--warning-color); color: #000; }
.badge-ended { background-color: var(--muted-text); }

/* Profile Picture */
.profile-picture {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.profile-picture-sm {
    width: 40px;
    height: 40px;
}

.profile-picture-lg {
    width: 150px;
    height: 150px;
}

/* Team Icon */
.team-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    object-fit: cover;
}

.team-icon-sm {
    width: 30px;
    height: 30px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

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

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Admin Sidebar */
.admin-sidebar {
    min-height: calc(100vh - 56px);
    background-color: var(--light-bg);
}

.admin-sidebar .nav-link {
    color: var(--dark-text);
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link:hover {
    background-color: rgba(26, 95, 122, 0.1);
}

.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }

    .team-slot {
        min-height: 100px;
        padding: 0.75rem;
    }

    .credits-display {
        padding: 0.75rem 1rem;
    }

    .credits-display .credits-value {
        font-size: 1.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .athlete-card .card-body {
        padding: 0.75rem;
    }

    .stat-row {
        font-size: 0.8rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .toast-container,
    .btn {
        display: none !important;
    }

    body {
        padding-top: 0;
    }
}
