/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(1, 8, 28, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    visibility: hidden;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background-color: #0A192F; 
    border: 1px solid #64FFDA;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #1E2D3D;
    flex-shrink: 0;
}

.modal-title {
    color: #CCD6F6;
    font-family: 'Fira Code', monospace;
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #64FFDA;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #fff;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #1E2D3D;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

/* File Download Modal */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #112240;
    border-radius: 0.5rem;
    border: 1px solid #1E2D3D;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #64FFDA;
}

.file-name {
    color: #CCD6F6;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #64FFDA;
    color: #0A192F;
    text-decoration: none;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.download-btn:hover {
    background-color: #52D8C9;
}

.download-btn.primary {
    background-color: #64FFDA;
    color: #0A192F;
}

.download-icon {
    width: 1rem;
    height: 1rem;
}

/* Video Modal */
.video-modal .modal-container {
    max-width: 1000px;
}

.video-modal .modal-body {
    padding: 0;
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

.video-container {
    width: 100%;
    height: 100%;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Video List Modal */
.video-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

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

.video-list::-webkit-scrollbar-track {
    background: #0A192F;
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb {
    background: #64FFDA;
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb:hover {
    background: #52D8C9;
}

.video-item-preview {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: #112240;
    border-radius: 0.5rem;
    border: 1px solid #1E2D3D;
}

.video-preview-container {
    width: 200px;
    min-width: 200px;
    aspect-ratio: 16 / 9;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #000;
}

.video-preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.video-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.video-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #64FFDA;
    flex-shrink: 0;
}

.video-name {
    color: #CCD6F6;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #64FFDA;
    color: #0A192F;
    text-decoration: none;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    align-self: flex-start;
}

.watch-btn:hover {
    background-color: #52D8C9;
}

.play-icon {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 640px) {
    .video-item-preview {
        flex-direction: column;
    }
    
    .video-preview-container {
        width: 100%;
    }
}

/* PDF Modal */
.pdf-modal {
    width: 95vw;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
}

.pdf-modal-body {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pdf-container {
    flex-grow: 1;
    width: 100%;
    height: 100%;
}

.pdf-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Prompt Modal */
.prompt-modal .modal-container {
    max-width: 1200px;
    height: 85vh;
}

.prompt-modal .modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.modal-sidebar {
    width: 35%;
    max-width: 400px;
    border-right: 1px solid #1E2D3D;
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
}

.modal-prompt-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-prompt-list li {
    margin-bottom: 0.75rem;
}

.prompt-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.25rem;
    background-color: #112240;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.prompt-list-item:hover, .prompt-list-item.active {
    background-color: #233554;
}

.prompt-list-item-name {
    color: #CCD6F6;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
}

.prompt-list-copy-btn {
    background: none;
    border: 1px solid #64FFDA;
    color: #64FFDA;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    transition: background-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.prompt-list-copy-btn:hover {
    background-color: #64FFDA;
    color: #0A192F;
}

.prompt-modal .modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    color: #8892B0;
    font-family: 'Calibre', sans-serif;
    line-height: 1.6;
    flex: 1;
}

.prompt-preview {
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #010414;
    padding: 1rem;
    border-radius: 0.25rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    margin: 0;
}

.copy-to-clipboard-btn {
    background-color: #64FFDA;
    color: #0A192F;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-family: 'Fira Code', monospace;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.copy-to-clipboard-btn:hover {
    background-color: #52D8C9;
}

.copy-to-clipboard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
