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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
#app-header {
    background: #2d2d2d;
    padding: 1rem 2rem;
    border-bottom: 2px solid #4a4a4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#app-header h1 {
    color: #4CAF50;
    font-size: 1.8rem;
}

/* Main Content */
#main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Screen Headers */
.screen-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.screen-header h2 {
    color: #4CAF50;
    font-size: 2rem;
}

/* Dashboard */
.dashboard {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
}

.dashboard h2 {
    color: #4CAF50;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.button-grid {
    display: grid;
    gap: 1rem;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    padding: 0.75rem 1.5rem;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #555;
    color: white;
    padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
    background: #666;
}

.btn-danger {
    background: #d32f2f;
    color: white;
    padding: 0.75rem 1.5rem;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-large {
    padding: 1.5rem 2rem;
    font-size: 1.3rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: #2d2d2d;
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.sub-form {
    margin-left: 2rem;
    padding: 1rem;
    background: #252525;
    border-radius: 6px;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.radio-group input[type="number"] {
    width: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Player Registration */
.registration-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.roster-panel,
.selected-panel {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 12px;
}

.roster-panel h3,
.selected-panel h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

#roster-search {
    width: 100%;
    padding: 0.75rem;
    background: #1a1a1a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    color: #e0e0e0;
    margin-bottom: 1rem;
}

.player-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #252525;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.player-item:hover {
    background: #333;
}

.player-item input[type="checkbox"] {
    width: auto;
}

.player-count {
    background: #4CAF50;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

/* Chip Configuration */
.chip-config-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chip-inventory,
.chip-distribution,
.chip-validation {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 12px;
}

.chip-inventory h3,
.chip-distribution h3,
.chip-validation h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

.chip-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr 40px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chip-row input {
    padding: 0.5rem;
    background: #1a1a1a;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    color: #e0e0e0;
}

.chip-row span {
    font-weight: 500;
}

.validation-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #252525;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.status-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.status-message.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.status-message.error {
    background: rgba(211, 47, 47, 0.2);
    color: #f44336;
}

/* Game Running Screen - Split Layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    min-height: calc(100vh - 250px);
}

/* Left Side - Timer Display */
.game-timer-section {
    background: #2d2d2d;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.timer-header {
    margin-bottom: 2rem;
}

.blinds-display-large {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.current-blinds-large {
    flex: 1;
}

.current-blinds-large .label {
    display: block;
    color: #b0b0b0;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.blinds-value-large {
    display: block;
    font-size: 4rem;
    font-weight: 700;
    color: #4CAF50;
    line-height: 1;
}

.next-blinds-small .label {
    display: block;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.blinds-value-small {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: #888;
}

.timer-main {
    text-align: center;
    margin: 3rem 0;
}

.time-remaining-large {
    font-size: 6rem;
    font-weight: 700;
    color: #4CAF50;
    font-family: 'Courier New', monospace;
    line-height: 1;
}

.level-info-large {
    color: #b0b0b0;
    font-size: 1.5rem;
    margin-top: 1rem;
}

.timer-controls-inline {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.game-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-box-inline {
    background: #252525;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-box-inline .stat-label {
    display: block;
    color: #b0b0b0;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-box-inline .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4CAF50;
}

/* Right Side - Admin Controls */
.game-admin-section {
    background: #252525;
    border-radius: 12px;
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.admin-panel {
    background: #2d2d2d;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.admin-panel-header {
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #333;
    user-select: none;
}

.admin-panel-header:hover {
    background: #3a3a3a;
}

.admin-panel-header h4 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.1rem;
}

.toggle-icon {
    color: #4CAF50;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.admin-panel-content {
    padding: 1rem;
    border-top: 1px solid #4a4a4a;
}

.btn-block {
    width: 100%;
    margin-bottom: 0.5rem;
}

.player-stats-inline,
.rebuy-stats-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-item-inline {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #252525;
    border-radius: 6px;
}

.rebuy-status-box {
    background: #252525;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
}

/* Bottom Action Bar */
.game-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #2d2d2d;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 2px solid #4a4a4a;
    z-index: 100;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .game-layout {
        grid-template-columns: 1fr;
    }
    
    .game-admin-section {
        max-height: none;
    }
    
    .game-footer-bar {
        position: static;
        margin-top: 2rem;
    }
}

/* Old game header styles - keeping for backwards compatibility but overridden above */
.game-header {
    background: #2d2d2d;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.blinds-display {
    display: flex;
    gap: 2rem;
}

.current-blinds,
.next-blinds {
    flex: 1;
}

.current-blinds .label,
.next-blinds .label {
    display: block;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.blinds-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #4CAF50;
}

.next-blinds .blinds-value {
    font-size: 2rem;
    color: #888;
}

.timer-display {
    text-align: right;
}

.time-remaining {
    font-size: 4rem;
    font-weight: 700;
    color: #4CAF50;
    font-family: 'Courier New', monospace;
}

.level-info {
    color: #b0b0b0;
    font-size: 1.2rem;
    margin-top: 0.5rem;
}

/* Tabs */
.game-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #2d2d2d;
    padding: 0.5rem;
    border-radius: 12px;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: transparent;
    color: #b0b0b0;
    border-radius: 8px;
}

.tab-button.active {
    background: #4CAF50;
    color: white;
}

.tab-button:hover {
    background: #3d3d3d;
}

.tab-button.active:hover {
    background: #45a049;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Game Content */
.game-content {
    background: #2d2d2d;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    min-height: 400px;
}

.timer-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.player-stats,
.rebuy-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: #252525;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4CAF50;
}

/* Sidebar */
.game-sidebar {
    position: fixed;
    right: 2rem;
    top: 200px;
    width: 250px;
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 12px;
}

.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: #252525;
    border-radius: 6px;
}

/* Game Footer */
.game-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem;
}

/* Results */
.results-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.final-standings,
.game-stats {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 12px;
}

.final-standings h3,
.game-stats h3 {
    color: #4CAF50;
    margin-bottom: 1rem;
}

#standings-table {
    width: 100%;
    border-collapse: collapse;
}

#standings-table th,
#standings-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #4a4a4a;
}

#standings-table th {
    color: #4CAF50;
    font-weight: 600;
}

.stat-grid {
    display: grid;
    gap: 1rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2000;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    width: min(620px, 100%);
    background: #1f1f1f;
    border-radius: 16px;
    border: 1px solid #333;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-dialog {
    transform: translateY(0);
}

.modal-header,
.modal-footer {
    padding: 1.5rem;
    background: #262626;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.modal-header h3 {
    margin: 0;
    color: #4CAF50;
}

.modal-subtitle {
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #b0b0b0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #b0b0b0;
    cursor: pointer;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #b0b0b0;
    font-weight: 500;
}

.modal-field input,
.modal-field textarea {
    background: #151515;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0.75rem;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 1rem;
}

.modal-player-list {
    max-height: 240px;
    border: 1px solid #333;
    border-radius: 12px;
    background: #151515;
    overflow-y: auto;
}

.player-radio-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #1f1f1f;
    cursor: pointer;
}

.player-radio-row:last-child {
    border-bottom: none;
}

.player-radio-row:hover {
    background: #202020;
}

.player-radio-row input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

.player-name {
    font-weight: 600;
    color: #e0e0e0;
}

.player-meta {
    color: #9e9e9e;
    font-size: 0.85rem;
}

.player-stack {
    font-weight: 600;
    color: #4CAF50;
    font-size: 0.9rem;
}

.empty-state {
    margin: 1.5rem;
    text-align: center;
    color: #9e9e9e;
}

.elimination-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    background: #151515;
    border: 1px solid #333;
}

.meta-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: #9e9e9e;
}

.meta-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #e0e0e0;
}

.modal-footer {
    justify-content: flex-end;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 1024px) {
    .registration-container,
    .chip-config-container,
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .game-sidebar {
        position: static;
        width: 100%;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    #main-content {
        padding: 1rem;
    }
    
    .game-header {
        grid-template-columns: 1fr;
    }
    
    .blinds-value {
        font-size: 2rem;
    }
    
    .time-remaining {
        font-size: 3rem;
    }
    
    /* Mobile Admin Controls */
    .game-layout {
        grid-template-columns: 1fr;
    }
    
    .game-admin-section {
        max-height: none;
        margin-top: 1rem;
    }
    
    .game-timer-section {
        padding: 1rem;
    }
    
    .time-remaining-large {
        font-size: 4rem;
    }
    
    .blinds-display-large {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .game-stats-summary {
        grid-template-columns: 1fr;
    }
}
