/* TikiStats Annotation-Specific Styles */

/* ========================================
   STEP INDICATOR (Wizard Flow)
   Used in: team selection, player selection, parameters
   ======================================== */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 10px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
    color: var(--brand-lime);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--brand-lime);
    color: var(--surface-dark-2);
}

/* ========================================
   SELECTION CARDS (Team/Player Selection)
   Base styles for selectable cards
   ======================================== */
.selection-card {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 2px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.selection-card:hover {
    border-color: var(--brand-lime);
    box-shadow: 0 8px 25px rgba(128, 218, 71, 0.2);
    transform: translateY(-3px);
}

.selection-card.selected {
    border-color: var(--brand-lime);
    background: linear-gradient(135deg, rgba(128, 218, 71, 0.1) 0%, rgba(28, 194, 148, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(128, 218, 71, 0.3);
}

/* Team-specific selection card */
.team-card {
    height: 200px;
    padding: 30px;
}

/* Player-specific selection card */
.player-card {
    height: 180px;
    padding: 20px;
}

/* Unavailable/disabled state */
.selection-card.unavailable,
.unavailable-player {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #3a3a3a 0%, #2f2f2f 100%);
}

.selection-card.unavailable:hover,
.unavailable-player:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(128, 218, 71, 0.2);
}

/* ========================================
   LOGOS & AVATARS
   Team logos, player avatars, placeholders
   ======================================== */
.team-logo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid rgba(128, 218, 71, 0.3);
    background: #fff;
    padding: 5px;
}

.team-placeholder,
.player-jersey {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--brand-lime), var(--brand-emerald));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--surface-dark-2);
}

/* Smaller player jersey variant */
.player-jersey {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

/* Player avatar (smaller) */
.player-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--brand-lime), var(--brand-emerald));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--surface-dark-2);
    font-size: 1.2rem;
}

/* ========================================
   INFO BANNERS & CARDS
   Colored info cards and banners
   ======================================== */
.annotation-info-card,
.team-banner {
    background: linear-gradient(135deg, var(--brand-forest), var(--brand-emerald));
    color: var(--ink-invert-1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.match-info-card {
    background: linear-gradient(135deg, var(--brand-forest) 0%, var(--brand-emerald) 100%);
    border: none;
    color: var(--ink-invert-1);
}

.annotation-card {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.annotation-card:hover {
    border-color: var(--brand-lime);
    box-shadow: 0 4px 20px rgba(128, 218, 71, 0.1);
}

/* ========================================
   STATUS INDICATORS
   Status colors for annotations
   ======================================== */
.status-completed {
    color: var(--brand-lime);
}

.status-in-progress {
    color: #ffc107;
}

.status-not-started {
    color: #6c757d;
}

/* Player-ID modal persistence feedback; kept here so fullscreen keeps its status readable. */
#mini-player-id-form[aria-busy="true"] {
    border-color: rgba(255, 193, 7, 0.8);
}

#mini-player-id-form.is-pending #mini-player-id {
    cursor: progress;
}

.mini-player-id-status {
    min-height: 1.5rem;
    margin: 0.5rem 0 0;
    color: var(--ink-invert-1);
    font-size: 0.875rem;
}

.mini-player-id-status[data-state="pending"] { color: #ffc107; }
.mini-player-id-status[data-state="saved"],
.mini-player-id-status[data-state="skipped"] { color: var(--brand-lime); }
.mini-player-id-status[data-state="error"] { color: #ff8a8a; }

/* ========================================
   BUTTONS
   Annotation-specific buttons
   ======================================== */
.btn-add-annotation {
    background: linear-gradient(135deg, var(--brand-lime), var(--brand-emerald));
    border: none;
    color: var(--surface-dark-2);
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-add-annotation:hover {
    background: linear-gradient(135deg, var(--brand-emerald), var(--brand-forest));
    color: var(--ink-invert-1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(28, 194, 148, 0.3);
}

/* ========================================
   BADGES
   Annotation-specific badges
   ======================================== */
.frame-interval-badge {
    background-color: rgba(128, 218, 71, 0.2);
    color: var(--brand-lime);
    border: 1px solid rgba(128, 218, 71, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* ========================================
   PARAMETER CONTROLS
   Used in: annotation parameter settings
   ======================================== */
.parameter-card {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.parameter-input {
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    background: rgba(128, 218, 71, 0.1);
    border: 2px solid rgba(128, 218, 71, 0.3);
    color: var(--brand-lime);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 200px;
    margin: 20px auto;
}

.parameter-input:focus {
    background: rgba(128, 218, 71, 0.15);
    border-color: var(--brand-lime);
    box-shadow: 0 0 0 0.2rem rgba(128, 218, 71, 0.25);
    color: var(--brand-lime);
    outline: none;
}

.calculation-result {
    background: rgba(128, 218, 71, 0.1);
    border: 1px solid rgba(128, 218, 71, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.match-info-banner {
    background: linear-gradient(135deg, var(--brand-forest), var(--brand-emerald));
    color: var(--ink-invert-1);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* ========================================
   SETUP COMPLETION SUMMARY
   Used in: setup_completed page
   ======================================== */
.success-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-lime), var(--brand-emerald));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon i {
    font-size: 60px;
    color: var(--surface-dark-2);
}

.summary-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.summary-card:hover {
    border-color: var(--brand-lime);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(128, 218, 71, 0.2);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: var(--brand-forest);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-lime);
    font-size: 24px;
    margin-right: 15px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(128, 218, 71, 0.1);
    border: 1px solid rgba(128, 218, 71, 0.3);
    border-radius: 20px;
    padding: 6px 14px;
    margin: 5px;
    color: var(--ink-invert-1);
}

.stat-badge i {
    margin-right: 8px;
    color: var(--brand-lime);
}

.action-card {
    background: linear-gradient(135deg, rgba(128, 218, 71, 0.1), rgba(28, 194, 148, 0.1));
    border: 2px solid var(--brand-lime);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(128, 218, 71, 0.3);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 45px;
    width: 2px;
    height: calc(100% + 20px);
    background: linear-gradient(180deg, var(--brand-lime), transparent);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--brand-lime);
    color: var(--surface-dark-2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.timeline-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(128, 218, 71, 0.2);
}

.btn-start-annotation {
    background: linear-gradient(135deg, var(--brand-lime), var(--brand-emerald));
    border: none;
    color: var(--surface-dark-2);
    font-size: 1.2rem;
    font-weight: bold;
    padding: 15px 40px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.btn-start-annotation:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(128, 218, 71, 0.4);
    color: var(--surface-dark-2);
}

/* ========================================
   QUICK ANNOTATION SYSTEM
   Event shortcut configuration and control bar
   ======================================== */

/* Quick Annotation Section - Full width below video */
.quick-annotation-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    padding: 0;
}

/* Hide quick-annotation-section in fullscreen mode */
body.fullscreen-mode .quick-annotation-section {
    display: none !important;
}

/* Event Shortcut Configuration Panel */
.event-shortcut-config {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.event-shortcut-config h5 {
    color: var(--brand-lime);
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Horizontal Event Shortcut Configuration */
.event-shortcut-config-horizontal {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.event-shortcut-config-horizontal h5 {
    color: var(--brand-lime);
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 15px;
}

/* Shortcut Key Badge */
.shortcut-key-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--brand-lime), #5ba33c);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #1a1a1a;
    flex-shrink: 0;
}

/* Shortcut Event Select */
.shortcut-event-select {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(128, 218, 71, 0.3);
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

.shortcut-event-select:focus {
    border-color: var(--brand-lime);
    box-shadow: 0 0 0 0.2rem rgba(128, 218, 71, 0.25);
    outline: none;
}

.shortcut-fields-preview {
    color: #888;
    font-size: 12px;
    min-width: 150px;
}

/* Annotation Control Bar */
.annotation-control-bar {
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.95), rgba(31, 31, 31, 0.95));
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 8px;
    padding: 10px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.annotation-control-bar .control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.annotation-control-bar .form-check {
    margin: 0;
}

.annotation-control-bar .event-counter {
    background: rgba(128, 218, 71, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--brand-lime);
    font-weight: 600;
}

/* ========================================
   ANNOTATION STATUS BANNER
   ======================================== */

.annotation-status-banner {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 152, 0, 0.2));
    border: 2px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.annotation-status-banner.enabled {
    background: linear-gradient(135deg, rgba(128, 218, 71, 0.2), rgba(76, 175, 80, 0.2));
    border-color: rgba(128, 218, 71, 0.5);
}

.annotation-status-banner .status-icon {
    font-size: 32px;
    color: #ffc107;
}

.annotation-status-banner.enabled .status-icon {
    color: var(--brand-lime);
}

.annotation-status-banner.enabled .status-icon i::before {
    content: '\f09c'; /* fa-unlock */
}

.annotation-status-banner .status-message strong {
    display: block;
    margin-bottom: 4px;
    color: #ffffff;
}

.annotation-status-banner .status-message p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   ANNOTATION PANEL STATES
   ======================================== */

.annotation-panel.disabled-state {
    pointer-events: none;
    filter: grayscale(50%);
    opacity: 0.5;
    position: relative;
}

.annotation-panel.disabled-state::before {
    content: '🔒 Enfoca una cámara para anotar';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 8px;
    color: var(--brand-lime);
    font-weight: bold;
    z-index: 10;
    white-space: nowrap;
    pointer-events: none;
}

/* Annotation Panel Indicator */
.annotation-panel-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    background: rgba(128, 218, 71, 0.2);
    border: 1px solid rgba(128, 218, 71, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-lime);
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

body.fullscreen-mode .annotation-panel-indicator {
    opacity: 0.6;
}

body.fullscreen-mode .annotation-panel-indicator:hover {
    opacity: 1;
}

/* ========================================
   RECENT EVENTS COMPONENTS
   ======================================== */

/* Recent Events Sidebar (compact, for non-fullscreen) */
.recent-events-sidebar {
    background: linear-gradient(135deg, var(--surface-dark-2) 0%, #1f1f1f 100%);
    border: 1px solid rgba(128, 218, 71, 0.2);
    border-radius: 12px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.recent-events-sidebar h6 {
    color: var(--brand-lime);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 13px;
}

/* Recent Events Horizontal Layout */
.recent-events-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(145deg, #252525, #1a1a1a);
    border: 1px solid rgba(128, 218, 71, 0.15);
    border-radius: 10px;
    padding: 15px;
}

.recent-events-horizontal h6 {
    color: var(--brand-lime);
    margin: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recent-events-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Apply scrollbar-dark-thin styles inline for recent-events-row */
.recent-events-row::-webkit-scrollbar {
    width: 4px;
}

.recent-events-row::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.recent-events-row::-webkit-scrollbar-thumb {
    background: rgba(128, 218, 71, 0.3);
    border-radius: 2px;
}

.recent-events-row::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 218, 71, 0.5);
}

/* Recent Event Item */
.recent-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(128, 218, 71, 0.1);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    gap: 10px;
}

.recent-event-item:last-child {
    margin-bottom: 0;
}

.recent-event-item:hover {
    background: rgba(128, 218, 71, 0.08);
}

.recent-event-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.recent-event-item .event-frame {
    color: var(--brand-emerald);
    font-size: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.recent-event-item .event-name {
    color: var(--brand-lime);
    font-weight: 600;
    white-space: nowrap;
}

.recent-event-item .event-player {
    color: #888;
    font-size: 11px;
}

.recent-event-edit,
.recent-event-delete {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.15s;
    font-size: 12px;
}

.recent-event-edit:hover {
    color: var(--brand-lime);
    background: rgba(128, 218, 71, 0.15);
}

.recent-event-delete:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
}
