/**
 * 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.65);
    z-index: 999998;
}

/* Modal Wrapper */
.vixviu-modal-wrapper {
    font-family: var(--vixviu-font, 'Jost', sans-serif);
    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: 15px 10px 0px 25px;
    border-bottom: 0px solid #eee;
    position: relative;
}
.vixviu-modal-title {
    font-family: var(--vixviu-font, 'Jost', sans-serif);
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #767676;
    text-transform: uppercase;
}
.vixviu-modal-subtitle {
    font-family: var(--vixviu-font, 'Jost', sans-serif);
    font-size: 1em;
    color: #666;
    margin-bottom: 10px;
}
.vixviu-modal-close {
    position: absolute;
    top: 12px;
    right: 20px;
    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;
    border-top: 0px solid #eee;
}

.vixviu-modal-body { 
    border-top: 0px solid #e5e7eb;
}

.vixviu-modal-content {
    padding: 10px 0 0px 10px;
    color: #333;
    white-space: pre-line;
}

/* 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); }
}
/* 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;
}

/* Interactive modal/link controls should always show pointer */
.vixviu-modal-trigger,
.vixviu-modal-action-exec {
    cursor: pointer;
}

/* Modal polish (module-owned visual layer) */
.vixviu-modal {
    max-width: 680px;
    border: 0px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.24);
}

.vixviu-modal-header {
    padding: 15px 10px 0px 25px;
    border-bottom: 0px solid #e5e7eb;
}

.vixviu-modal-title {
    font-family: var(--vixviu-font, 'Jost', sans-serif);
    font-size: 1.7rem;
    margin: 0;
    color: #5a5a5a;
    letter-spacing: -.5px;
}

.vixviu-modal-subtitle {
    margin-top: 6px;
    margin-bottom: 0;
}

.vixviu-modal-container {
    padding: 14px 16px 16px;
    max-height: 72vh;
}

.vixviu-entity-list {
    display: grid;
    gap: 8px;
}

.vixviu-modal-item.callout {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.vixviu-modal-item-title {
    display: block;
    margin: 0 0 2px 0;
    font-size: 1.02rem;
    color: #5a5a5a  ;
}

.vixviu-modal-item-subtitle,
.vixviu-modal-item-status {
    display: block;
    margin: 0;
    color: #6b7280;
    font-size: 0.86rem;
    line-height: 1.3;
}

.vixviu-modal-item-actions {
    margin-top: 8px;
}

/* Modal action buttons — primary definition, no WP button inheritance */
.vixviu-modal-wrapper .vixviu-modal-action-exec,
.vixviu-modal-wrapper .vixviu-modal-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 34px;
    line-height: 1.1;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
    border: 1.5px solid #d1d5db;
    background: #fff;
    color: #5a5a5a;
    box-shadow: none;
    cursor: pointer;
    font-family: var(--vixviu-font, 'Jost', sans-serif);
    margin: 0;
    text-align: left;
    box-sizing: border-box;
    text-decoration: none;
    vertical-align: middle;
}

.vixviu-modal-wrapper .vixviu-modal-action-exec:visited,
.vixviu-modal-wrapper .vixviu-modal-trigger:visited {
    color: #5a5a5a;
}

.vixviu-modal-wrapper .vixviu-modal-action-exec:hover,
.vixviu-modal-wrapper .vixviu-modal-trigger:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #5a5a5a;
}

.vixviu-modal-wrapper .vixviu-modal-action-exec:focus-visible,
.vixviu-modal-wrapper .vixviu-modal-trigger:focus-visible {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

.vixviu-modal-wrapper .vixviu-modal-action-exec:disabled,
.vixviu-modal-wrapper .vixviu-modal-action-exec[disabled],
.vixviu-modal-wrapper .vixviu-modal-trigger:disabled,
.vixviu-modal-wrapper .vixviu-modal-trigger[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.vixviu-modal-meta {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.vixviu-meta-item {
    margin-bottom: 6px;
    font-size: 0.82rem;
    color: #6b7280;
}