/* Stat Collector Complete Styles */

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

body .bb-stat-collector-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1f2937;
    color: white;
    padding: 1rem;
}

.bb-stat-collector-container .container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.bb-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #374151;
}

.bb-stat-header .game-title h1 {
    color: white;
    font-size: 2rem;
    margin: 0;
}

.bb-stat-header .live-badge {
    color: #f97316;
    font-weight: 700;
    font-size: 1.25rem;
    animation: pulse 1.5s infinite;
}

/* Clock Controls */
.clock-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.clock-btn {
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clock-btn.start {
    background: #10b981;
    color: white;
}

.clock-btn.stop {
    background: #ef4444;
    color: white;
}

.clock-btn.reset {
    background: #f59e0b;
    color: white;
}

.clock-btn:hover {
    transform: scale(1.05);
}

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

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 2fr 1.5fr 2fr;
    gap: 1rem;
    background: #374151;
    padding: 1.5rem;
    border-radius: 1rem;
}

/* Team Column */
.team-column {
    background: #1f2937;
    padding: 1rem;
    border-radius: 0.75rem;
}

.team-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f97316;
    margin-bottom: 1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f97316;
}

.player-item {
    background: #374151;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-item:hover {
    background: #4b5563;
    transform: translateX(4px);
}

.player-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.player-stats {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Stats Column */
.stats-column {
    background: #1f2937;
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.possession-indicator {
    background: #374151;
    padding: 0.5rem;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 700;
}

.possession-indicator.active {
    background: #f97316;
    animation: pulse 1.5s infinite;
}

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

.stat-box {
    background: #374151;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.stat-box.score {
    padding: 1.5rem;
    background: linear-gradient(135deg, #374151, #1f2937);
    border: 2px solid #f97316;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.stat-box.score .stat-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f97316;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 4rem;
    font-weight: 700;
    color: #f97316;
}

.stat-box.score .stat-value {
    font-size: 5rem;
}

.timeout-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.timeout-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.timeout-btn:active {
    transform: scale(0.95);
}

.timeout-btn:disabled {
    background: #6b7280;
    cursor: not-allowed;
    transform: none;
}

/* Center Column - Clocks */
.center-column {
    background: #1f2937;
    padding: 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.clock-display {
    background: #000;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    border: 3px solid #f97316;
    cursor: pointer;
}

.clock-display:hover {
    border-color: #ea580c;
}

.clock-label {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.clock-time {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #f97316;
}

.clock-time.editing {
    background: #374151;
    border: 2px solid #f97316;
    border-radius: 0.25rem;
    padding: 0.25rem;
    outline: none;
    width: 100%;
}

.clock-time.warning {
    color: #ef4444;
    animation: blink 0.5s infinite;
}

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

.period-display {
    background: #374151;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.period-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.25rem;
}

.period-value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Modal/Popup */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1f2937;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: white;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #374151;
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    background: #ef4444;
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #dc2626;
}

/* Stat Categories */
.stat-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-category h3 {
    color: #f97316;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.stat-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.stat-btn {
    padding: 1rem;
    border: 2px solid #374151;
    background: #374151;
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.stat-btn:hover {
    background: #4b5563;
    border-color: #f97316;
}

.stat-btn:active {
    transform: scale(0.95);
}

.stat-btn.made {
    border-color: #10b981;
}

.stat-btn.made:hover {
    background: #10b981;
    border-color: #10b981;
}

.stat-btn.miss {
    border-color: #ef4444;
}

.stat-btn.miss:hover {
    background: #ef4444;
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .clock-time {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 3rem;
    }
    
    .stat-box.score .stat-value {
        font-size: 4rem;
    }
}

/* Notice boxes */
.bb-notice {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid;
}

.bb-notice p {
    margin: 8px 0;
}

.bb-notice-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.bb-notice-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.bb-notice-success {
    background: #f0fdf4;
    border-color: #10b981;
    color: #065f46;
}

.player-stats {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-line {
    display: block;
    font-size: 0.875rem;
}

.stat-line:first-child {
    font-weight: 600;
}

.stat-line:not(:first-child) {
    font-size: 0.8125rem;
    opacity: 0.8;
}

.stat-box.team-totals {
    text-align: center;
    padding: 1rem;
}

.team-totals-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.team-totals-content .stat-line {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}