/* ========================================
   POKER TOURNAMENT CLOCK - TV OPTIMIZED
   TechTools.cz
   ======================================== */

/* CSS Variables */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --poker-green: #16a34a;
    --gold: #fbbf24;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.2s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1;
}

/* App Container - Full Viewport */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Header - Compact */
.header {
    background: transparent;
    padding: 0.5rem 1rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.header:hover {
    opacity: 1;
}

.fullscreen-mode .header {
    opacity: 0;
}

.fullscreen-mode .header:hover {
    opacity: 0.8;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.back-btn:hover {
    background: var(--surface-hover);
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.tool-title i {
    color: var(--accent);
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

/* Main Content - Fill Screen */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100vh;
    width: 100vw;
}

/* ========================================
   WELCOME SCREEN - TV OPTIMIZED
   ======================================== */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
}

.welcome-icon {
    width: 15vmin;
    height: 15vmin;
    min-width: 100px;
    min-height: 100px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--poker-green) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6vmin;
    color: white;
    box-shadow: 0 0 80px rgba(139, 92, 246, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 80px rgba(139, 92, 246, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 120px rgba(139, 92, 246, 0.7); }
}

.welcome-content h2 {
    font-size: 6vmin;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-info {
    display: flex;
    gap: 4vw;
    color: var(--text-secondary);
    font-size: 3vmin;
}

.welcome-info span {
    display: flex;
    align-items: center;
    gap: 1vmin;
}

.welcome-info i {
    color: var(--gold);
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 2vmin;
    padding: 2.5vmin 6vmin;
    background: linear-gradient(135deg, var(--poker-green) 0%, #15803d 100%);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 4vmin;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 60px rgba(22, 163, 74, 0.5);
    font-family: inherit;
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 80px rgba(22, 163, 74, 0.6);
}

.welcome-hint {
    color: var(--text-secondary);
    font-size: 2vmin;
    opacity: 0.6;
}

/* ========================================
   TOURNAMENT SCREEN - TV FULLSCREEN
   ======================================== */
.tournament-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2vh 2vw;
    gap: 2vh;
}

/* Level Info - Top */
.level-info {
    display: flex;
    align-items: baseline;
    gap: 1.5vw;
}

.level-label {
    font-size: 4vmin;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 600;
}

.level-number {
    font-size: 10vmin;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

/* ========================================
   TIMER DISPLAY - MASSIVE FOR TV
   ======================================== */
.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2vw;
    padding: 2vh 4vw;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.timer-digits {
    font-size: 28vmin;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    line-height: 1;
    text-shadow: 0 0 100px rgba(255, 255, 255, 0.3);
    min-width: 2ch;
    text-align: center;
}

.timer-separator {
    font-size: 24vmin;
    font-weight: 900;
    color: var(--accent);
    animation: blink 1s ease-in-out infinite;
    line-height: 1;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.timer-display.paused .timer-separator {
    animation: none;
    opacity: 0.2;
}

.timer-display.paused .timer-digits {
    color: var(--text-secondary);
    text-shadow: none;
}

.timer-display.warning .timer-digits {
    color: var(--warning);
    text-shadow: 0 0 100px rgba(245, 158, 11, 0.5);
}

.timer-display.danger .timer-digits {
    color: var(--danger);
    text-shadow: 0 0 100px rgba(239, 68, 68, 0.6);
    animation: pulse-danger 0.5s ease-in-out infinite;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   BLINDS DISPLAY - LARGE FOR TV
   ======================================== */
.blinds-display {
    display: flex;
    align-items: center;
    gap: 4vw;
    margin-top: 2vh;
}

.blind-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vh;
}

.blind-label {
    font-size: 3vmin;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.blind-value {
    font-size: 12vmin;
    font-weight: 900;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-shadow: 0 0 60px rgba(251, 191, 36, 0.4);
}

.blind-divider {
    color: var(--text-secondary);
    font-size: 8vmin;
    opacity: 0.3;
}

/* Break Display */
.break-display {
    display: flex;
    align-items: center;
    justify-content: center;
}

.break-text {
    font-size: 12vmin;
    font-weight: 900;
    color: var(--poker-green);
    text-shadow: 0 0 60px rgba(22, 163, 74, 0.5);
    letter-spacing: 0.1em;
}

.break-indicator {
    color: var(--poker-green) !important;
}

.break-duration {
    font-size: 10vmin;
    font-weight: 900;
    color: var(--poker-green);
    text-shadow: 0 0 60px rgba(22, 163, 74, 0.5);
}

/* Ante Display */
.ante-display {
    display: flex;
    align-items: center;
    gap: 2vw;
    padding: 1.5vh 3vw;
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-lg);
    margin-top: 1vh;
}

.ante-label {
    font-size: 3vmin;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ante-value {
    font-size: 6vmin;
    font-weight: 800;
    color: var(--gold);
}

/* Next Level Preview */
.next-level {
    display: flex;
    align-items: center;
    gap: 2vw;
    padding: 1.5vh 3vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    margin-top: 2vh;
}

.next-label {
    font-size: 2.5vmin;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.next-blinds {
    font-size: 4vmin;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   CONTROLS - BOTTOM OF SCREEN
   ======================================== */
.clock-controls {
    display: flex;
    align-items: center;
    gap: 2vw;
    margin-top: auto;
    padding-bottom: 2vh;
}

.control-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vw;
    padding: 2vh 3vw;
    background: var(--surface);
    color: var(--text-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 2.5vmin;
    font-weight: 600;
}

.control-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    transform: scale(1.05);
}

.pause-btn {
    padding: 2.5vh 5vw;
    background: linear-gradient(135deg, var(--poker-green) 0%, #15803d 100%);
    border: none;
    font-size: 3vmin;
}

.pause-btn:hover {
    background: linear-gradient(135deg, #15803d 0%, var(--poker-green) 100%);
}

.pause-btn.paused {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.level-btn {
    width: 8vmin;
    height: 8vmin;
    min-width: 50px;
    min-height: 50px;
    padding: 0;
    border-radius: 50%;
    font-size: 3vmin;
}

.reset-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
}

.fullscreen-btn {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent);
}

.fullscreen-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent);
}

/* Tournament Info Bar - Bottom */
.tournament-info {
    display: flex;
    gap: 4vw;
    padding: 1.5vh 0;
    margin-top: 2vh;
    opacity: 0.6;
}

.fullscreen-mode .tournament-info {
    opacity: 0.4;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1vw;
    color: var(--text-secondary);
    font-size: 2vmin;
}

.info-item i {
    color: var(--accent);
}

/* ========================================
   MODAL - Settings (TV Optimized)
   ======================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-header h3 i {
    color: var(--accent);
}

.close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.close-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

/* Form Elements - Compact for TV */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--accent);
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
}

.form-group input[type="number"] {
    padding: 0.6rem 0.8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-hover);
}

/* Checkbox - Compact */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* ========================================
   LEVEL CHANGE OVERLAY - FULLSCREEN
   ======================================== */
.level-change-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

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

.level-change-content {
    text-align: center;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.level-change-icon {
    width: 15vmin;
    height: 15vmin;
    background: linear-gradient(135deg, var(--accent) 0%, var(--poker-green) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6vmin;
    color: white;
    margin: 0 auto 4vh;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.level-change-content h2 {
    font-size: 10vmin;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 3vh;
    text-shadow: 0 0 60px rgba(255, 255, 255, 0.3);
}

.new-blinds {
    font-size: 15vmin;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 80px rgba(251, 191, 36, 0.5);
}

.blinds-separator {
    margin: 0 2vw;
    color: var(--text-secondary);
}

/* Hidden State */
.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE - MOBILE/TABLET FALLBACK
   ======================================== */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem;
    }

    .back-btn span,
    .action-btn span {
        display: none;
    }

    .tool-title {
        font-size: 1rem;
    }

    .timer-digits {
        font-size: 20vmin;
    }

    .timer-separator {
        font-size: 16vmin;
    }

    .blind-value {
        font-size: 10vmin;
    }

    .clock-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 3vw;
    }

    .control-btn span {
        display: none;
    }

    .pause-btn span {
        display: inline;
    }

    .tournament-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4vw;
    }
}

/* Portrait orientation on TV/large screens */
@media (orientation: portrait) and (min-height: 800px) {
    .timer-digits {
        font-size: 22vmin;
    }

    .blind-value {
        font-size: 10vmin;
    }

    .blinds-display {
        flex-direction: column;
        gap: 3vh;
    }

    .blind-divider {
        display: none;
    }
}

/* Extra large screens (4K TVs) */
@media (min-width: 1920px) {
    .timer-digits {
        font-size: 30vmin;
    }

    .blind-value {
        font-size: 14vmin;
    }

    .level-number {
        font-size: 12vmin;
    }
}

/* ========================================
   SEO CONTENT SECTION
   ======================================== */
.seo-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 0 2rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    z-index: 50;
}

.seo-content.expanded {
    max-height: 60vh;
    padding: 2rem;
    overflow-y: auto;
}

.seo-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-content h3 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--accent);
}

.seo-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.seo-content ul {
    list-style: none;
    padding-left: 0;
}

.seo-content li {
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.seo-content li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: var(--poker-green);
    position: absolute;
    left: 0;
    top: 0.4rem;
}

.seo-content strong {
    color: var(--text-primary);
}

/* Hide SEO content during tournament/fullscreen */
.fullscreen-mode ~ .seo-content,
body:fullscreen .seo-content {
    display: none;
}

/* Show as collapsed drawer when not in tournament */
@media (max-width: 768px) {
    .seo-content {
        font-size: 0.9rem;
    }

    .seo-content h2 {
        font-size: 1.25rem;
    }

    .seo-content h3 {
        font-size: 1rem;
    }
}
