/* Main Layout Styles - Used alongside manage_candidate.css */

/* Admin Modal Size Update */
#helpModal .search-modal-content {
    height: 90vh;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#helpModal .search-modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Preview Modal Size */
.preview-modal-size {
    height: auto !important;
    max-height: 80vh !important;
    width: 90% !important;
    max-width: 800px !important;
}

/* For the preview modal too */
#previewModal .search-modal-content {
    display: flex;
    flex-direction: column;
}

#previewModal .search-modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Preview Modal Tab Styles */
.help-tabs {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.tab-btn:hover:not(.active) {
    color: #4b5563;
    border-bottom-color: #d1d5db;
}

.tab-content {
    display: none;
    padding: 15px;
    background: #f9fafb;
    border-radius: 4px;
    min-height: 200px;
}

.tab-content.active {
    display: block;
}

/* Make the video preview container have fixed dimensions with 16:9 aspect ratio */
.video-preview {
    position: relative;
    width: 100%;
    max-width: 100%; /* Allow it to fill the available width */
    margin: 0 auto;
    cursor: pointer;
    aspect-ratio: 16/9; /* Maintain 16:9 aspect ratio */
    overflow: hidden; /* Ensures the image doesn't spill out */
    background-color: #000; /* Black background for letterboxing */
}

/* Make the thumbnail image cover the entire container */
.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image cover the entire container */
    object-position: center; /* Center the image within the container */
    border-radius: 4px;
}

/* Play button with red background */
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 0, 0, 0.7); /* Changed to semi-transparent red */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-button i {
    color: white;
    font-size: 24px;
}

/* Ensure the video container in the modal takes up appropriate space */
#videoContainer {
    width: 100%;
    max-width: 100%;
}

/* Video Wrapper for Embedded Videos */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* HTML Content Preview */
#htmlContainer {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    min-height: 200px;
    overflow-y: auto;
    max-height: 400px;
}

/* Thumbnail Container Styles */
.thumbnail-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumbnail-preview {
    display: flex;
    justify-content: center;
    background-color: #f3f4f6;
    padding: 10px;
    border-radius: 4px;
}

.thumbnail-preview img {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    object-fit: contain;
}

.thumbnail-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 576px) {
    .thumbnail-upload {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .thumbnail-upload .or-text {
        display: none;
    }
    
    .thumbnail-upload .search-form-input {
        width: 100% !important;
    }
}

/* Error Message Styles */
.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Text Align Utility Classes */
.text-center {
    text-align: center;
}

/* Function Icon Column */
.function-icon {
    width: 40px;
    text-align: center;
}

.function-icon i {
    font-size: 18px;
    color: #4f46e5;
}

/* Status Indicators */
.status-active {
    color: #10b981;
    font-weight: 500;
}

.status-inactive {
    color: #9ca3af;
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Overrides - Additional to manage_candidate.css */
@media (max-width: 767px) {
    /* Admin Modal on Mobile */
    #helpModal .search-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        top: 0;
        left: 0;
        transform: none;
    }
    
    /* Preview Modal on Mobile - Full width but flexible height */
    #previewModal .search-modal-content {
        position: fixed !important;
        top: 10% !important; /* Position from top instead of full screen */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: auto !important; /* Auto height instead of 100% */
        max-height: 80vh !important; /* Limit to 80% of viewport height */
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        transform: none !important;
        z-index: 9999 !important;
    }
    
    /* Tab UI for Mobile */
    .tab-buttons {
        flex-direction: column;
        border-bottom: none;
    }
    
    .tab-btn {
        width: 100%;
        text-align: center;
        border: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 15px 10px;
    }
    
    .tab-btn.active {
        background-color: #f3f4f6;
    }
    
    /* Tab content should flex to content */
    .tab-content {
        padding: 10px;
        min-height: 200px !important; /* Reduced from 300px */
        height: auto !important;
    }
    
    /* For mobile, make the video preview take full width */
    .video-preview {
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
    }
    
    /* Container heights should adapt to content */
    #videoContainer, #htmlContainer {
        height: auto !important;
        min-height: 200px;
    }
    
    /* Make HTML container more compact */
    #htmlContainer {
        max-height: 50vh !important; /* Limit to half the viewport height */
    }
    
    /* Video Controls on Mobile */
    .video-controls {
        margin-top: 10px;
    }
    
    .video-controls button {
        width: 100%;
        padding: 12px;
    }
    
    /* Preview Modal Body should be flexible */
    #previewModal .search-modal-body {
        max-height: none !important; /* Remove fixed max-height */
        overflow-y: auto !important;
    }
}

.profile-picture-group {
    text-align: left;
    margin-bottom: 20px;
}

.profile-picture-container {
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 10px;
}

.profile-preview {
    width: 200px;
    height: 120px;
    object-fit: cover; /* This ensures the image covers the entire container */
    border: 2px solid #ddd;
    border-radius: 4px;
}

/* Styles for the help description */
.help-description {
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #4f46e5;
    border-radius: 0 4px 4px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .help-description {
        margin-bottom: 15px;
        padding: 8px 12px;
        font-size: 13px;
    }
}