/**
 * ToernooiApp Custom Styles
 * Aanvullend op Bootstrap 5
 */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
}

/* General */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

/* Cards */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.125);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 0.375rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.is-invalid {
    border-color: var(--danger-color);
}

.is-valid {
    border-color: var(--success-color);
}

/* Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 600;
}

/* Tables */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead {
    background-color: #f8f9fa;
}

/* Tournament Cards */
.tournament-card {
    transition: all 0.3s;
    cursor: pointer;
    border-left: 4px solid var(--primary-color);
}

.tournament-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.tournament-card.active {
    border-left-color: var(--success-color);
}

.tournament-card.completed {
    border-left-color: #6c757d;
    opacity: 0.8;
}

/* QR Code Display */
.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 2rem;
    background: white;
    border-radius: 0.5rem;
}

.qr-code-container img {
    max-width: 100%;
    height: auto;
    border: 2px solid #dee2e6;
    padding: 1rem;
}

/* Schedule Grid */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.match-card {
    border-left: 4px solid;
}

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

.match-card.in-progress {
    border-left-color: var(--success-color);
    animation: pulse 2s infinite;
}

.match-card.completed {
    border-left-color: #6c757d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Pool Standings */
.standings-table {
    font-size: 0.9rem;
}

.standings-table .position {
    width: 40px;
    text-align: center;
    font-weight: 700;
}

.standings-table tr:first-child {
    background-color: rgba(var(--success-rgb), 0.1);
    border-left: 4px solid var(--success-color);
}

.standings-table tr:nth-child(2),
.standings-table tr:nth-child(3) {
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* Referee Interface */
.score-display {
    font-size: 5rem;
    line-height: 1;
    font-weight: 700;
    text-align: center;
}

.referee-match-card {
    border: 3px solid var(--primary-color);
    margin-bottom: 2rem;
}

.score-button {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Timer Display */
.timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--dark-color);
}

.timer-display.warning {
    color: var(--warning-color);
}

.timer-display.danger {
    color: var(--danger-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.5; }
}

/* Presentation Mode (Kantine TV) */
.presentation-container {
    background: #000;
    color: #fff;
    min-height: 100vh;
    padding: 2rem;
}

.presentation-slide {
    display: none;
    animation: fadeIn 0.5s;
}

.presentation-slide.active {
    display: block;
}

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

.presentation-header {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.live-match {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.live-match .team-name {
    font-size: 2.5rem;
    font-weight: 700;
}

.live-match .score {
    font-size: 5rem;
    font-weight: 700;
}

.upcoming-matches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.upcoming-match {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.sponsor-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    align-items: center;
}

.sponsor-logo {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.sponsor-logo.main {
    grid-column: span 2;
    min-height: 200px;
}

.sponsor-logo img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

/* Loading Spinner */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--warning-color);
    color: var(--dark-color);
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    z-index: 1050;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.offline-banner.show {
    transform: translateY(0);
}

/* Dark Mode Support (voor presentatie) */
@media (prefers-color-scheme: dark) {
    .presentation-container {
        background: #1a1a1a;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .score-display {
        font-size: 3rem;
    }
    
    .timer-display {
        font-size: 2.5rem;
    }
    
    .score-button {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .presentation-header {
        font-size: 2rem;
    }
    
    .live-match .team-name {
        font-size: 1.5rem;
    }
    
    .live-match .score {
        font-size: 3rem;
    }
    
    .upcoming-matches {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .sponsor-logo.main {
        grid-column: span 1;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer,
    #notification-container {
        display: none !important;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states voor keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Utility Classes */
.text-shadow {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.hover-lift {
    transition: transform 0.2s;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-info {
    border-left: 4px solid #0dcaf0 !important;
}

/* ============================================================================
   TV Display Button Styling - Add to your main CSS file
   ============================================================================ */

/* Purple button voor TV/Display scherm */
.btn-purple {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
    color: white !important;
    transition: all 0.3s ease;
}

.btn-purple:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #0d6efd 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
    color: white !important;
}

.btn-purple:active {
    transform: translateY(0);
}

.btn-purple i {
    margin-right: 5px;
}

/* Alternatief: Als je geen gradient wilt, gebruik deze simpele versie */
.btn-purple-simple {
    background-color: #764ba2;
    border-color: #764ba2;
    color: white !important;
}

.btn-purple-simple:hover {
    background-color: #667eea;
    border-color: #667eea;
    color: white !important;
}