/* Padel Scorer - CSS Styles */

@font-face {
    font-family: 'AdvancedLEDBoard';
    src: url('../fonts/advanced_led_board-7.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.font-advanced-led {
    font-family: 'AdvancedLEDBoard', sans-serif;
}

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

body {
    font-family: 'AdvancedLEDBoard', sans-serif;
    background: url('../images/scoreboard-bg.jpg') center/cover no-repeat fixed;
    min-height: 100vh;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
}

.container {
    width: min(96vw, 1120px);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(24px, 4vw, 48px);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #6b7280;
    font-size: 1.1rem;
}

.trophy-icon {
    display: inline-block;
    font-size: 2rem;
    margin-right: 10px;
    color: #fbbf24;
}

/* Cards */
.card {
    width: 100%;
    border-radius: 20px;
    padding: clamp(20px, 3vw, 36px);
    margin: 0;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}
.card2 {
    width: 100%;
    border-radius: 20px;
    padding: clamp(20px, 3vw, 36px);
    margin: 0;
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
}

#current-match-view .card {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.card-header {
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Score Display */
.score-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.americano-score-grid {
    grid-template-columns: 2fr 1fr;
}

.score-header {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-name {
    font-family: 'AdvancedLEDBoard', sans-serif;
    font-weight: bold;
    font-size: 3.125rem;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-a { color: #ffffff; }
.team-b { color: #ffffff; }

.score-number {
    font-family: 'AdvancedLEDBoard', sans-serif;
    font-size: 5rem;
    font-weight: regular;
    color: #1f2937;
}

.americano-meta {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 20px 0;
    border-top: 1px solid #e5e7eb;
    color: #f70fe8;
    font-size: 1.875rem;
    font-weight: 600;
}

.americano-meta .meta-title {
    font-weight: 600;
    color: #374151;
    margin-right: 4px;
}

@media (max-width: 640px) {
    .americano-meta {
        flex-direction: column;
        padding: 12px 0 0;
    }
}

/* Current Game Score */
.current-game {
    text-align: center;
    padding: 0;
    background: transparent;
}

.scoreboard-frame {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px);
    display: flex;
    justify-content: center;
}

.current-game h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.game-score {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 5vw, 64px);
}

.game-team {
    flex: 1 1 45%;
    max-width: 45%;
    min-width: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(24px, 6vw, 48px);
}

.game-team-name {
    font-size: clamp(2rem, 3.8vw, 4.5rem);
    font-weight: 400;
    margin: 0;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: clamp(0.03em, 0.35vw, 0.08em);
    line-height: 1.1;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-points {
    font-size: clamp(10rem, 26vw, 20rem);
    font-weight: 400;
    color: #b3f700;
    line-height: 0.9;
}

.game-separator {
    font-size: clamp(4rem, 12vw, 8.5rem);
    font-weight: 200;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Padel Court */
.court-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.padel-court {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 20/10;
    background: #059669;
    border-radius: 12px;
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.court-outline {
    position: absolute;
    inset: 8px;
    border: 2px solid white;
    border-radius: 4px;
}

/* Court lines */
.center-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: white;
    transform: translateX(-50%);
}

.service-line-top {
    position: absolute;
    left: 0;
    right: 0;
    top: 25%;
    height: 2px;
    background: white;
}

.service-line-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 25%;
    height: 2px;
    background: white;
}

.service-center-top {
    position: absolute;
    left: 50%;
    top: 25%;
    bottom: 75%;
    width: 2px;
    background: white;
    transform: translateX(-50%);
}

.service-center-bottom {
    position: absolute;
    left: 50%;
    top: 75%;
    bottom: 25%;
    width: 2px;
    background: white;
    transform: translateX(-50%);
}

.net {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background: #374151;
    transform: translateY(-50%);
    z-index: 10;
}

/* Clickable areas */
.court-side {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.court-side:hover {
    background: rgba(255, 255, 255, 0.2);
}

.court-side.team-a {
    top: 0;
}

.court-side.team-b {
    bottom: 0;
}

.court-side:hover .team-label {
    opacity: 1;
}

.team-label {
    color: white;
    font-weight: bold;
    font-size: 1.125rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.court-instruction {
    text-align: center;
    margin-top: 16px;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Corner decorations */
.corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
}

.corner.top-left {
    top: 4px;
    left: 4px;
    border-right: none;
    border-bottom: none;
}

.corner.top-right {
    top: 4px;
    right: 4px;
    border-left: none;
    border-bottom: none;
}

.corner.bottom-left {
    bottom: 4px;
    left: 4px;
    border-right: none;
    border-top: none;
}

.corner.bottom-right {
    bottom: 4px;
    right: 4px;
    border-left: none;
    border-top: none;
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1d4ed8;
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover:not(:disabled) {
    background: #f9fafb;
}

.btn-destructive {
    background: #dc2626;
    color: white;
}

.btn-destructive:hover:not(:disabled) {
    background: #b91c1c;
}

/* Status indicators */
.status-finished {
    background: #dcfce7;
    color: #166534;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 20px;
}

.status-tiebreak {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input {
    width: 16px;
    height: 16px;
}

/* Saved games list */
.saved-game {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.saved-game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.saved-game-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.saved-game-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.saved-game-score {
    text-align: right;
}

.saved-game-actions {
    display: flex;
    gap: 8px;
}

.saved-game-actions .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

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

    .container {
        width: 100%;
        gap: 24px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .score-grid {
        gap: 12px;
    }
    
    .scoreboard-frame {
        padding: clamp(20px, 8vw, 32px);
    }

    .game-score {
        gap: clamp(16px, 8vw, 36px);
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .modal {
        padding: 16px;
    }
    
    .saved-game-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .saved-game-score {
        text-align: left;
    }
}

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

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

/* Hidden class */
.hidden {
    display: none !important;
}
.font-advanced-led {
    font-family: 'AdvancedLEDBoard', sans-serif;
}
