/* ============================================
   PETANQUE TOURNAMENT MANAGER - STYLES
   ============================================ */

:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
}

.home-page-shell {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

.home-hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 2rem;
    padding: clamp(2rem, 4vw, 3.5rem);
    min-height: 430px;
    background: linear-gradient(135deg, #8b0f1a 0%, #c2182d 45%, #f04f4f 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 28px 28px;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: auto -8% -25% auto;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    filter: blur(6px);
}

.home-hero-content {
    position: relative;
    z-index: 1;
}

.home-hero-content h1 {
    font-size: clamp(2rem, 3.3vw, 3.2rem);
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: #fff;
    letter-spacing: -0.02em;
}

.home-hero-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 560px;
    margin-bottom: 1.25rem;
    color: rgba(255,255,255,0.92);
}

.hero-badge {
    display: inline-block;
    margin-bottom: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.home-hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.home-hero-visual img {
    max-width: 360px;
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.home-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 0;
}

.feature-box {
    padding: 20px;
    transition: transform 0.3s;
}

.feature-box:hover {
    transform: translateY(-5px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    padding-bottom: 70px;
}

/* ============================================
   MOBILE FIRST RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .dashboard-widget .number {
        font-size: 1.8rem;
    }
    
    .score-input {
        font-size: 1.5rem;
        height: 60px;
    }
    
    .steps-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .steps-indicator::before {
        display: none;
    }
}

/* ============================================
   SCORE INPUT
   ============================================ */

.score-input {
    font-size: 2rem;
    text-align: center;
    font-weight: bold;
    height: 80px;
    border: 2px solid #dee2e6;
    border-radius: 10px;
}

.score-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ============================================
   DASHBOARD WIDGETS
   ============================================ */

.dashboard-widget {
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
    transition: transform 0.3s;
}

.dashboard-widget:hover {
    transform: translateY(-5px);
}

.dashboard-widget .number {
    font-size: 2.5rem;
    font-weight: bold;
}

.dashboard-widget .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ============================================
   MATCH CARDS
   ============================================ */

.match-card {
    border-left: 4px solid var(--secondary);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.match-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.match-card.completed {
    border-left-color: var(--success);
}

.match-card.scheduled {
    border-left-color: var(--warning);
}

.match-card.in_progress {
    border-left-color: var(--danger);
    animation: pulse-border 1.5s infinite;
}

@keyframes pulse-border {
    0% { border-left-color: var(--warning); }
    50% { border-left-color: var(--danger); }
    100% { border-left-color: var(--warning); }
}

/* ============================================
   STANDINGS TABLE
   ============================================ */

.standing-table th {
    background-color: var(--primary);
    color: white;
    text-align: center;
}

.standing-table td {
    text-align: center;
    vertical-align: middle;
}

/* ============================================
   BRACKET
   ============================================ */

.knockout-bracket {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
}

.knockout-bracket .stage {
    margin-bottom: 20px;
}

.knockout-bracket .stage h6 {
    color: var(--primary);
    font-weight: bold;
    padding: 8px;
    background: #e9ecef;
    border-radius: 5px;
}

.knockout-bracket .match-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.knockout-bracket .match-card .team {
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 4px;
    background: #f8f9fa;
}

.knockout-bracket .match-card .team.winner {
    background: #d4edda;
    border-left: 4px solid var(--success);
    font-weight: bold;
}

.knockout-bracket .match-card .score {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin: 8px 0;
}

/* ============================================
   POULE 2 WIN / LOSS DIAGRAM
   ============================================ */

.poule-diagram-group {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

.poule-diagram-group h5 {
    margin-bottom: 14px;
    color: var(--primary);
}

.poule-bracket {
    display: grid;
    grid-template-columns: minmax(155px, 1fr) 28px minmax(155px, 1fr) 28px minmax(170px, 1fr) 28px minmax(150px, 1fr);
    gap: 8px;
    align-items: center;
    min-width: 760px;
}

.poule-round {
    display: flex;
    min-height: 176px;
    flex-direction: column;
    justify-content: space-around;
    gap: 12px;
}

.poule-round-title {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: center;
    text-transform: uppercase;
}

.poule-flow-arrow {
    color: var(--secondary);
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
}

.poule-match {
    overflow: hidden;
    border: 1px solid #ced4da;
    border-left: 4px solid var(--warning);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.poule-match.completed {
    border-left-color: var(--success);
}

.poule-match-label {
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    font-size: 0.72rem;
    font-weight: 700;
}

.poule-team {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    border-top: 1px solid #edf0f2;
    font-size: 0.82rem;
}

.poule-team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.poule-team.winner {
    background: #d1e7dd;
    color: #0f5132;
    font-weight: 700;
}

.poule-bye,
.poule-empty-round {
    padding: 10px;
    border: 1px dashed #adb5bd;
    border-radius: 6px;
    color: #6c757d;
    font-size: 0.82rem;
    text-align: center;
}

.poule-qualifiers {
    justify-content: center;
}

.poule-qualifier {
    padding: 10px;
    border: 1px solid #a3cfbb;
    border-left: 4px solid var(--success);
    border-radius: 6px;
    background: #d1e7dd;
    color: #0f5132;
}

.poule-qualifier small,
.poule-qualifier strong {
    display: block;
}

.poule-qualifier strong {
    margin-top: 2px;
    font-size: 0.82rem;
}

.poule-adaptive-bracket {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    min-width: 0;
}

@media (max-width: 991px) {
    .poule-diagram-group {
        overflow-x: auto;
    }
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.progress {
    height: 25px;
    border-radius: 15px;
    background-color: #e9ecef;
}

.progress-bar {
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 25px;
    transition: width 0.6s ease;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    font-size: 0.8rem;
    padding: 5px 10px;
}

/* ============================================
   FORMS
   ============================================ */

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ============================================
   NAVIGATION
   ============================================ */

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .nav-link {
    font-weight: 500;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .navbar, .footer, .btn, .no-print {
        display: none !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid var(--secondary);
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   STEPS INDICATOR
   ============================================ */

.steps-indicator {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    background: white;
    padding: 0 10px;
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dee2e6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 5px;
}

.step.active .step-num {
    background: var(--secondary);
}

.step.active .step-label {
    color: var(--secondary);
    font-weight: bold;
}

.step-label {
    font-size: 0.8rem;
    color: #6c757d;
}

/* ============================================
   TOURNAMENT FLOW
   ============================================ */

.flow-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    flex-wrap: wrap;
}

.flow-step {
    text-align: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 120px;
    margin: 5px;
}

.flow-step .step-icon {
    font-size: 2rem;
    display: block;
}

.flow-step .step-text {
    font-weight: bold;
    display: block;
    margin: 5px 0;
}

.flow-step .step-status {
    font-size: 0.8rem;
    color: #666;
}

.flow-step.completed {
    border-left: 4px solid var(--success);
}

.flow-step.active {
    border-left: 4px solid var(--secondary);
    background: #e3f2fd;
}

.flow-arrow {
    font-size: 1.5rem;
    color: #999;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .flow-arrow {
        display: none;
    }
    .flow-step {
        width: 100%;
    }
}

/* ============================================
   MISC
   ============================================ */

.feature-box {
    padding: 20px;
    transition: transform 0.3s;
}

.feature-box:hover {
    transform: translateY(-5px);
}

.btn {
    border-radius: 8px;
}

.list-group-item {
    cursor: pointer;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}
