/* Enhanced Modal Dark/Light Theme Styles */

/* Modal Base Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-background, #ffffff);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

.modal-content.small {
    width: 400px;
}

.modal-content.medium {
    width: 600px;
}

.modal-content.large {
    width: 800px;
}

.modal-content.extra-large {
    width: 1000px;
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color, #333333);
    margin: 0;
}

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

.modal-close:hover {
    background: var(--surface-color, #f8f9fa);
    color: var(--text-color, #333333);
}

.modal-body {
    padding: 1rem 2rem 2rem;
    color: var(--text-color, #333333);
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Video Modal Specific Styles */
.video-modal {
    text-align: center;
}

.video-modal video {
    width: 100%;
    max-width: 800px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.video-modal h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color, #333333);
}

.video-modal p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary, #666666);
}

.video-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color, #d4af37);
    color: var(--button-text, #ffffff);
}

.btn-primary:hover {
    background: #b8941f;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color, #1a237e);
    color: white;
}

.btn-secondary:hover {
    background: #303f9f;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color, #d4af37);
    color: var(--primary-color, #d4af37);
}

.btn-outline:hover {
    background: var(--primary-color, #d4af37);
    color: white;
}

/* Dark Theme Overrides */
[data-theme="dark"] .modal-content {
    background: var(--modal-background);
    color: var(--text-color);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

[data-theme="dark"] .modal-close:hover {
    background: var(--surface-color);
}

/* Alert Modal Styles */
.alert-modal .modal-content {
    width: 400px;
    text-align: center;
}

.alert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.alert-icon.success {
    color: #4caf50;
}

.alert-icon.error {
    color: #f44336;
}

.alert-icon.warning {
    color: #ff9800;
}

.alert-icon.info {
    color: #2196f3;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .modal-content.small,
    .modal-content.medium,
    .modal-content.large,
    .modal-content.extra-large {
        width: 100%;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .video-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Loading Spinner */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color, #e0e0e0);
    border-top: 4px solid var(--primary-color, #d4af37);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

