/* Super Ace Video Card Component */
.super-ace-video-card {
    background: var(--theme-surface-1);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--theme-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--theme-border-color);
}

.super-ace-video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--theme-shadow-lg);
}

/* Video Container */
.super-ace-video-card .video-container {
    position: relative;
    aspect-ratio: 9/16; /* Portrait orientation to match video */
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

/* Inline Video */
.super-ace-video-card .inline-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Video Thumbnail */
.super-ace-video-card .video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--theme-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.super-ace-video-card .thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.super-ace-video-card .placeholder-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--theme-surface-3);
    color: var(--theme-text-muted);
    font-size: 3rem;
}

/* Video Overlay */
.super-ace-video-card .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0) 50%, 
        rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.super-ace-video-card .video-container:hover .video-overlay {
    opacity: 1;
}

.super-ace-video-card .play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.super-ace-video-card .play-button:hover {
    transform: scale(1.1);
}

.super-ace-video-card .play-button i {
    color: #000;
    font-size: 1.5rem;
    margin-left: 3px;
}

.super-ace-video-card .duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.super-ace-video-card .verified-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--theme-success);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Super Ace Label */
.super-ace-video-card .super-ace-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
    z-index: 10;
}

/* Video Controls Overlay */
.super-ace-video-card .video-controls-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 100;
    align-items: center;
    justify-content: flex-end;
}

.super-ace-video-card .video-control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.super-ace-video-card .video-control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.super-ace-video-card .video-control-btn i {
    font-size: 14px;
}

/* Fullscreen mode styles */
.video-container.fullscreen-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.video-container.fullscreen-mode .inline-video {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain; /* Maintain aspect ratio in fullscreen */
}

.video-container.fullscreen-mode .video-controls-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

/* Larger controls in fullscreen */
.video-container.fullscreen-mode .video-control-btn {
    width: 48px;
    height: 48px;
}

.video-container.fullscreen-mode .video-control-btn i {
    font-size: 18px;
}

/* Mobile-specific fullscreen styles */
@media (max-width: 768px) {
    /* iOS video fullscreen fixes */
    .inline-video::-webkit-media-controls-fullscreen-button {
        display: none !important; /* Hide native fullscreen button since we have our own */
    }
    
    /* Ensure video fills screen properly in fullscreen */
    .video-container.fullscreen-mode .inline-video,
    .inline-video[webkit-playsinline]:fullscreen {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
        z-index: 9999 !important;
        background: #000 !important;
    }
    
    /* Ensure controls stay visible in mobile fullscreen */
    .video-container.fullscreen-mode .video-controls-overlay {
        position: fixed !important;
        z-index: 10000 !important;
    }
    
    /* Fallback fullscreen styles */
    .video-container.fallback-fullscreen {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 9999 !important;
        background: #000 !important;
    }
    
    /* Prevent body scroll when in fullscreen */
    body.video-fullscreen-active {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* Swipe indicator for mobile fullscreen */
@media (max-width: 768px) and (pointer: coarse) {
    .video-container.fullscreen-mode::before {
        content: '↓ Swipe down to exit • Swipe up for next ↑';
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 12px;
        z-index: 10001;
        animation: fadeInOut 4s ease-in-out;
        pointer-events: none;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Video Info */
.super-ace-video-card .video-info {
    padding: 1rem;
    background: linear-gradient(to bottom, 
        var(--theme-surface-1) 0%, 
        var(--theme-bg-secondary) 100%);
    border-top: 1px solid var(--theme-border-color);
}

.super-ace-video-card .player-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.super-ace-video-card .player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--theme-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.super-ace-video-card .player-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light, #66b3ff) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.super-ace-video-card .player-details {
    flex: 1;
    min-width: 0;
}

.super-ace-video-card .player-name {
    color: var(--theme-text-primary);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.super-ace-video-card .attempt-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: var(--theme-text-secondary);
    margin-bottom: 0.2rem;
}

.super-ace-video-card .event-link {
    color: var(--theme-primary);
    text-decoration: none;
    font-size: 0.825rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    padding: 0.15rem 0.5rem;
    background: var(--theme-primary-bg, rgba(0, 123, 255, 0.05));
    border-radius: 4px;
    font-weight: 500;
    margin-left: 0.25rem;
}

.super-ace-video-card .event-link:hover {
    color: white;
    background: var(--theme-primary);
    text-decoration: none;
    transform: translateY(-1px);
}

.super-ace-video-card .event-link i {
    font-size: 0.75rem;
}

.super-ace-video-card .course-name {
    font-weight: 600;
    color: var(--theme-text-primary);
}

.super-ace-video-card .hole-info {
    color: var(--theme-text-primary);
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    background: var(--theme-primary-bg, rgba(0, 123, 255, 0.1));
    border-radius: 4px;
    font-size: 0.8rem;
}

.super-ace-video-card .par-info {
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

.super-ace-video-card .event-date {
    font-size: 0.825rem;
    color: var(--theme-text-muted);
    font-weight: 500;
}

.super-ace-video-card .video-description {
    color: var(--theme-text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* Grid Layout for Multiple Cards */
.super-ace-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .super-ace-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    .super-ace-video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .super-ace-video-card .video-info {
        padding: 0.75rem;
    }
    
    .super-ace-video-card .player-avatar,
    .super-ace-video-card .player-avatar-placeholder {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .super-ace-video-card .player-name {
        font-size: 0.85rem;
    }
    
    .super-ace-video-card .attempt-details {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
}

@media (max-width: 380px) {
    .super-ace-video-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Adjustments */
@media (prefers-color-scheme: dark) {
    .super-ace-video-card .video-info {
        background: linear-gradient(to bottom, 
            var(--theme-surface-1) 0%, 
            var(--theme-surface-2) 100%);
        border-top-color: var(--theme-border-color);
    }
    
    .super-ace-video-card .player-avatar {
        border-color: var(--theme-primary);
    }
    
    .super-ace-video-card .hole-info {
        background: rgba(0, 123, 255, 0.15);
    }
    
    .super-ace-video-card .event-link {
        background: rgba(0, 123, 255, 0.1);
    }
    
    .super-ace-video-card .event-link:hover {
        background: var(--theme-primary);
        color: white;
    }
}