/**
 * Vixviu Modal System Styles
 * Handles styling for modal overlay and content
 */

/* Modal Backdrop */
.vixviu-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999998;
}

/* Modal Wrapper */
.vixviu-modal-wrapper {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow-y: auto;
    z-index: 999999;
}
.vixviu-modal-wrapper.active {
    display: block;
}

/* Modal Box */
.vixviu-modal {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1000000;
}

/* Modal Header */
.vixviu-modal-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #eee;
    position: relative;
}
.vixviu-modal-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}
.vixviu-modal-subtitle {
    font-size: 1em;
    color: #666;
    margin-bottom: 10px;
}
.vixviu-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}
.vixviu-modal-close:hover {
    color: #333;
}

/* Modal Content Area */
.vixviu-modal-container {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.vixviu-modal-content {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #333;
}

/* Image Block */
.vixviu-modal-image {
    text-align: center;
    margin-bottom: 20px;
}
.vixviu-modal-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Metadata + Assignments Section */
.vixviu-modal-meta {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-top: 20px;
}
.vixviu-meta-item {
    font-size: 0.9em;
    margin-bottom: 8px;
}
.vixviu-meta-section {
    margin-bottom: 15px;
}
.vixviu-section-title {
    font-size: 1em;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.vixviu-assignments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.vixviu-assignments-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.vixviu-assignments-list li:last-child {
    border-bottom: none;
}
.vixviu-due-date {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 3px;
}

/* Loading State */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}
.loading-dots {
    display: flex;
    gap: 8px;
}
.loading-dots span {
    width: 12px;
    height: 12px;
    background-color: #888;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
.loading-text {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #555;
}

/* Error State */
.vixviu-modal-error {
    color: #d9534f;
    padding: 15px;
    border-left: 3px solid #d9534f;
    background-color: #fdf7f7;
}

/* Lock body scroll when modal open */
body.vixviu-modal-open {
    overflow: hidden;
}

/* Responsive Mobile Support */
@media (max-width: 600px) {
    .vixviu-modal {
        width: 95%;
        margin: 30px auto;
    }
    .vixviu-modal-title {
        font-size: 1.3em;
    }
    .vixviu-modal-container {
        padding: 15px;
    }
} 

.vixviu-modal-footer-actions {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    margin-top: 20px;
} 