/**
 * Wallet-Style Tournament Schedule Styles
 * 
 * Full styles for the Apple Wallet-style match schedule view.
 * Includes animations, modal, status badges, and responsive design.
 */

.wallet-schedule-container {
    padding: 16px;
    overflow: visible; /* Allow cards to be fully visible */
}

.wallet-schedule {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: visible; /* Allow cards to peek out */
}

/* Wallet Stack Header */
.wallet-stack-header {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.wallet-counter {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Match Wallet Stack */
.wallet-stack-container {
    position: relative;
    margin-bottom: 0;
    touch-action: pan-y;
    overflow: visible; /* Allow cards to peek through - show stacking effect */
    display: flex;
    flex-direction: column;
}

.match-wallet-stack {
    position: relative;
    width: 100%;
    cursor: grab;
    user-select: none;
    flex: 1; /* Fill remaining space after header */
    min-height: 0; /* Allow flex item to shrink below content size */
}

.match-wallet-stack:active {
    cursor: grabbing;
}

.match-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    will-change: transform;
    backface-visibility: hidden;
    min-height: 220px; /* Minimum height for card content */
    height: auto; /* Allow card to grow with content */
    box-sizing: border-box; /* Include padding in height calculation */
}

.match-card.active {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    /* z-index is set inline based on stack position */
}

.match-card:hover:not(.dragging) {
    transform: translateY(-4px) scale(1.02);
}

/* Urgency states */
.match-card.urgency-live {
    border-left: 4px solid #ef4444;
}

.match-card.urgency-verySoon {
    border-left: 4px solid #f59e0b;
    animation: pulse 2s infinite;
}

.match-card.urgency-soon {
    border-left: 4px solid #fbbf24;
}

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

/* Status Badges */
.match-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.match-status-badge.status-live {
    background: #ef4444;
    color: white;
    animation: blink 1.5s infinite;
}

.match-status-badge.status-soon {
    background: #f59e0b;
    color: white;
}

.match-status-badge.status-updated {
    background: #3b82f6;
    color: white;
}

.match-status-badge.status-delayed {
    background: #64748b;
    color: white;
}

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

.match-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.match-opponent {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.match-time {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-field {
    font-size: 12px;
    color: var(--text-secondary);
}

.match-assignment {
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Jump Strip */
.jump-strip-container {
    padding: 8px 0 8px 0;
    margin-top: 4px; /* Minimal space after wallet stack container */
}

.jump-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-overflow-scrolling: touch;
}

.jump-strip::-webkit-scrollbar {
    height: 4px;
}

.jump-strip::-webkit-scrollbar-track {
    background: transparent;
}

.jump-strip::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.jump-strip-chip {
    position: relative;
    flex-shrink: 0;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jump-strip-chip:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.jump-strip-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
}

.jump-badge {
    display: inline-block;
    font-size: 8px;
    line-height: 1;
}

.jump-badge.assigned {
    color: var(--primary);
}

.jump-badge.live {
    background: #ef4444;
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 700;
}

.jump-badge.updated {
    color: #3b82f6;
}

/* Agenda List */
.agenda-list-container {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    display: none; /* Hide agenda list by default - can be shown via toggle if needed */
}

.agenda-list-container::-webkit-scrollbar {
    width: 6px;
}

.agenda-list-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-section-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    padding: 8px 0 4px;
}

.agenda-item {
    position: relative;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.agenda-item:hover {
    background: var(--background);
    border-color: var(--primary);
    transform: translateX(4px);
}

.agenda-item.highlighted {
    border-color: var(--primary);
    border-width: 2px;
    background: rgba(230, 57, 70, 0.05);
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.1);
}

.agenda-item-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.agenda-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.agenda-item-badge {
    font-size: 10px;
    padding: 3px 8px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Break Indicator */
.break-indicator {
    padding: 8px 14px;
    background: rgba(100, 116, 139, 0.1);
    border-left: 3px solid var(--text-secondary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 4px 0;
}

.break-indicator.back-to-back {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #f59e0b;
}

/* Match Details Modal */
.match-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.match-details-modal.active {
    opacity: 1;
}

.match-details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.match-details-panel {
    position: relative;
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    width: 100%;
    max-width: 600px;
    z-index: 1;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.match-details-modal.active .match-details-panel {
    transform: translateY(0);
}

.match-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.match-details-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.match-details-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.match-details-close:hover {
    background: var(--background);
    color: var(--text);
}

.match-details-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.match-details-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-details-opponent {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.match-details-time {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--background);
    border-radius: 12px;
}

.time-primary {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.time-countdown {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.time-arrive {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

.match-details-field,
.match-details-category,
.match-details-tournament,
.match-details-venue {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

.match-details-field strong,
.match-details-category strong,
.match-details-tournament strong,
.match-details-venue strong {
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 8px;
}

.match-details-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

/* Desktop: Side panel instead of modal */
@media (min-width: 768px) {
    .match-details-modal {
        align-items: center;
        justify-content: flex-end;
        padding: 20px;
    }

    .match-details-panel {
        border-radius: 20px;
        max-width: 400px;
        max-height: 90vh;
        transform: translateX(100%);
    }

    .match-details-modal.active .match-details-panel {
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .wallet-stack-container {
        height: 200px;
    }

    .match-card {
        padding: 16px;
    }

    .match-opponent {
        font-size: 18px;
    }

    .match-details-panel {
        max-height: 90vh;
    }
}

/* Accessibility */
.match-card:focus,
.jump-strip-chip:focus,
.agenda-item:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth scroll */
.agenda-list-container,
.jump-strip {
    scroll-behavior: smooth;
}
