/* Preview Mode Styles */

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10005;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-modal.modal-visible {
    opacity: 1;
}

.preview-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.preview-modal-content {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 95vw;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
}

.preview-modal-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    position: relative;
}

.preview-modal-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.preview-modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.preview-explanation {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.preview-explanation p {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
}

.preview-explanation ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.preview-explanation li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

/* Preview Options */
.preview-options {
    display: grid;
    gap: 1.5rem;
}

.preview-option {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.preview-option:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-medium);
}

.preview-option h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.preview-option p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.option-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.checkbox-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.tier-selector select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tier-selector select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(74,144,226,0.1);
}

.mobile-options {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mobile-preview-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.mobile-preview-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.preview-action-btn {
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.preview-action-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.preview-action-btn.primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.preview-action-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.preview-action-btn.secondary:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Preview Status */
.preview-status {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.status-text {
    flex: 1;
}

.status-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.status-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.exit-preview-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    white-space: nowrap;
}

.exit-preview-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Preview Modal Footer */
.preview-modal-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.preview-tips {
    flex: 1;
}

.preview-tips h5 {
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.preview-tips ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.preview-tips li {
    margin-bottom: 0.25rem;
}

.modal-actions {
    flex-shrink: 0;
}

.cancel-btn {
    background: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Floating Preview Indicator */
.preview-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    animation: slideDown 0.3s ease-out;
}

.indicator-content {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(99,102,241,0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.indicator-content button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.indicator-content button:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Preview Mode Body Styling */
.preview-mode {
    position: relative;
}

.preview-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899, #f59e0b);
    z-index: 9999;
    pointer-events: none;
}

/* Animation for theme cycling */
.theme-cycling {
    transition: all 0.5s ease-in-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .preview-modal-content {
        width: 95vw;
        height: 90vh;
    }
    
    .preview-modal-body {
        padding: 1rem;
    }
    
    .preview-modal-header {
        padding: 1.5rem 1rem;
    }
    
    .preview-modal-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .mobile-options {
        flex-direction: column;
    }
    
    .status-content {
        flex-direction: column;
        text-align: center;
    }
    
    .indicator-content {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .preview-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
    
    .preview-explanation {
        padding: 1rem;
    }
    
    .preview-option {
        padding: 1rem;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Theme-specific preview indicator colors */
.theme-crimson-gamer .preview-indicator .indicator-content {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 8px 32px rgba(220,38,38,0.3);
}

.theme-dark-purple-tech .preview-indicator .indicator-content {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 8px 32px rgba(139,92,246,0.3);
}