/**
 * ZINCAM/DEV — Interactive Live Project Preview Modal Styles
 */

/* Modal Container & Overlay */
.preview-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 4, 6, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2.5vw, 2.5rem);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--duration-smooth) ease, visibility var(--duration-smooth) ease;
}

.preview-modal-backdrop.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Modal Window Frame */
.preview-modal-window {
    width: 100%;
    max-width: 1360px;
    height: 88vh;
    max-height: 900px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.96) translateY(16px);
    transition: transform var(--duration-smooth) var(--ease-out-expo), box-shadow var(--duration-smooth) ease;
}

.preview-modal-backdrop.is-active .preview-modal-window {
    transform: scale(1) translateY(0);
}

/* Modal Browser Bar */
.preview-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--browser-bar-bg);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.preview-modal-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.preview-modal-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-modal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.preview-modal-dot.close { background: #ff5f56; }
.preview-modal-dot.min { background: #ffbd2e; }
.preview-modal-dot.max { background: #27c93f; }

.preview-modal-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.preview-modal-url-box {
    flex: 1;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[data-theme="light"] .preview-modal-url-box {
    background: rgba(0, 0, 0, 0.04);
}

.preview-modal-lock {
    color: #34d399;
    font-size: 0.75rem;
}

.preview-modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) ease;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.preview-modal-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.08);
}

.preview-modal-btn.accent {
    background: var(--signal-red-dim);
    border-color: var(--signal-red);
    color: var(--signal-red);
}

.preview-modal-btn.accent:hover {
    background: var(--signal-red);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(255, 59, 48, 0.4);
}

.preview-modal-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all var(--duration-fast) ease;
}

.preview-modal-close-btn:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: var(--signal-red);
    color: var(--signal-red);
}

/* Modal Content Screen */
.preview-modal-screen {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    background: #0d0f14;
    overflow: hidden;
}

#modal-iframe-mount {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 1;
}

.preview-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #ffffff;
    opacity: 1;
}

/* Loading Indicator Bar */
.preview-modal-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    z-index: 10;
    pointer-events: none;
    transition: opacity var(--duration-fast) ease, visibility var(--duration-fast) ease;
}

.preview-modal-loader.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.preview-signal-spinner {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--signal-red);
    border-radius: 50%;
    animation: previewSpin 0.8s linear infinite;
}

@keyframes previewSpin {
    to { transform: rotate(360deg); }
}

.preview-loader-text {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Blocked / Direct Visit Overlay (Plugaê) */
.preview-modal-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-primary);
    text-align: center;
    z-index: 15;
}

.preview-modal-fallback.is-visible {
    display: flex;
}

/* Interactive Click Hint on Project Cards */
.project-visual-clickable {
    cursor: pointer;
    position: relative;
}

.project-visual-clickable:focus-visible {
    outline: 2px solid var(--signal-red);
    outline-offset: 3px;
}

.preview-hover-hint {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(6, 7, 9, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-pill);
    padding: 0.4rem 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    pointer-events: none;
    transition: all var(--duration-fast) ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.preview-hover-hint .hint-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal-red);
    box-shadow: 0 0 8px var(--signal-red);
    animation: hintPulse 1.8s infinite ease-in-out;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.project-card:hover .preview-hover-hint,
.case-visual-container:hover .preview-hover-hint {
    background: var(--signal-red);
    color: #ffffff;
    border-color: var(--signal-red);
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
    transform: translateY(-2px);
}

.project-card:hover .preview-hover-hint .hint-pulse,
.case-visual-container:hover .preview-hover-hint .hint-pulse {
    background: #ffffff;
    box-shadow: 0 0 8px #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .preview-modal-window {
        height: 94vh;
        max-height: 100vh;
    }

    .preview-modal-url-box {
        display: none;
    }

    .preview-modal-bar {
        padding: 0.65rem 0.85rem;
    }

    .preview-hover-hint {
        bottom: 10px;
        right: 10px;
        font-size: 0.6rem;
        padding: 0.3rem 0.65rem;
    }
}
