/* ============================================================================
   VIDEO SEARCH - YOUTUBE-LIKE INTERFACE
   Modern, responsive design matching audio player interface
   ============================================================================ */

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #e5a36d 0%, #d4894f 50%, #871554 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: linear-gradient(135deg, #871554 0%, #a93670 100%);
    color: white;
    padding: 40px;
    text-align: center;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header p {
    font-size: 1.2em;
    opacity: 0.95;
}

/* ============================================
   PASSWORD SECTION
   ============================================ */
.password-section {
    background: white;
    padding: 20px 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.password-label {
    font-weight: 600;
    color: #495057;
    font-size: 1.1em;
}

#input_pass {
    padding: 12px 18px;
    border: 2px solid #ced4da;
    border-radius: 10px;
    font-size: 1.1em;
    width: 250px;
    transition: all 0.3s ease;
}

#input_pass:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 4px rgba(135, 21, 84, 0.1);
}

/* ============================================
   OTP MODAL
   ============================================ */
.otp-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.otp-modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.otp-modal-content h2 {
    margin: 0 0 15px 0;
    color: #871554;
    font-size: 1.5em;
}

.otp-modal-content p {
    margin: 8px 0;
    color: #495057;
    font-size: 1em;
}

.otp-hint {
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
}

#modal_otp_input {
    width: 100%;
    padding: 12px 15px;
    margin: 20px 0;
    border: 2px solid #ced4da;
    border-radius: 8px;
    font-size: 1.1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#modal_otp_input:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.1);
}

.otp-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.otp-submit-btn,
.otp-cancel-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.otp-submit-btn {
    background: linear-gradient(135deg, #871554, #a5195e);
    color: white;
}

.otp-submit-btn:hover {
    background: linear-gradient(135deg, #6d1044, #871554);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 21, 84, 0.3);
}

.otp-cancel-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #ced4da;
}

.otp-cancel-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* ============================================
   SEARCH FORM
   ============================================ */
.search-section {
    background: white;
    padding: 30px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #871554;
    box-shadow: 0 0 0 3px rgba(135, 21, 84, 0.1);
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.button {
    padding: 14px 32px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.button-search {
    background: linear-gradient(135deg, #871554 0%, #a5195e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(135, 21, 84, 0.3);
}

.button-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(135, 21, 84, 0.4);
}

.button-reset {
    background: transparent;
    color: #718096;
    border: 1px solid #cbd5e0;
    font-weight: 400;
    padding: 10px 20px;
    font-size: 0.9em;
    min-width: auto;
}

.button-reset:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #4a5568;
    transform: none;
    box-shadow: none;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
    background: white;
    padding: 30px 40px;
    border-radius: 0 0 16px 16px;
    min-height: 400px;
}

#main_message {
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1em;
    color: #6c757d;
}

.results-header {
    margin-bottom: 30px;
    padding: 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.results-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 15px;
}

.results-count {
    color: #718096;
    font-size: 0.7em;
    font-weight: 400;
}

/* ============================================
   VIDEO GRID - YOUTUBE STYLE
   ============================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-card video {
    width: 100%;
    display: block;
}

.video-thumbnail-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #f0f0f0;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.video-card:hover .play-overlay {
    background: rgba(102, 126, 234, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent white;
    margin-left: 4px;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
}

.video-info {
    padding: 16px;
}

.video-id {
    font-size: 0.95em;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
}

.video-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.meta-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85em;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

.meta-tag.year {
    background: #e3f2fd;
    color: #1976d2;
}

.meta-tag.location {
    background: #f3e5f5;
    color: #7b1fa2;
}

.meta-tag.occasion {
    background: #fff3e0;
    color: #e65100;
}

.meta-tag.keyword {
    background: #e8f5e9;
    color: #2e7d32;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-keyword {
    margin-top: 10px;
    font-size: 0.9em;
    color: #6c757d;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   VIDEO PLAYER CONTAINER
   ============================================ */
.video-player-container {
    display: none;
    width: 100%;
}

.video-player-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.video-player-container video {
    width: 100%;
    border-radius: 8px;
}

.video-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

/* ============================================
   BROWSER COMPATIBILITY NOTICE
   ============================================ */
.browser-notice {
    padding: 15px 20px;
    margin: 20px 0;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.browser-notice::before {
    content: "⚠️";
    font-size: 1.5em;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-message {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state-hint {
    font-size: 1em;
    color: #6c757d;
}

/* Subtle empty state for no criteria */
.empty-state-subtle {
    text-align: center;
    padding: 15px 20px;
    color: #9ca3af;
    font-size: 0.95em;
}

.subtle-icon {
    opacity: 0.6;
    margin-right: 5px;
}

.subtle-text {
    color: #6b7280;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .password-section {
        flex-direction: column;
        align-items: stretch;
    }

    #input_pass {
        width: 100%;
    }

    .button-group {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .header, .search-section, .results-section {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5em;
    }
}

/* ============================================
   LOADING ANIMATIONS
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================================
   FULLSCREEN VIDEO PLAYER
   ============================================ */
.video-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.video-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.video-fullscreen-container:hover .video-controls-header {
    opacity: 1;
}

.video-controls-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.video-id-text {
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.video-controls-actions {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.close-btn {
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(220, 53, 69, 0.9);
}

.close-btn:hover {
    background: rgba(220, 53, 69, 1);
    border-color: rgba(220, 53, 69, 1);
}

.pip-btn svg {
    width: 20px;
    height: 20px;
}

.close-btn svg {
    width: 24px;
    height: 24px;
}

/* Video.js player in fullscreen mode */
.video-fullscreen-container .video-js {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Override Video.js default styles for better fullscreen experience */
.video-fullscreen-container .vjs-big-play-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(135, 21, 84, 0.9);
    border: 3px solid white;
    font-size: 3em;
    line-height: 80px;
}

.video-fullscreen-container .vjs-big-play-button:hover {
    background-color: rgba(165, 25, 94, 1);
}

/* Control bar styling */
.video-fullscreen-container .vjs-control-bar {
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(5px);
}

/* Mobile responsiveness for fullscreen controls */
@media (max-width: 768px) {
    .video-controls-header {
        padding: 10px 15px;
    }
    
    .video-id-text {
        font-size: 1em;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn svg {
        width: 18px;
        height: 18px;
    }
}
