/**
 * Tool: Video to GIF & WebP Maker - Free & High FPS
 * Stylesheet: video-to-gif-webp.css
 * Synchronized with MetaoFly Golden Standard 2-Column Tool Workspace
 */

/* ── Workspace Card Container ── */
.tool-workspace.vgw-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 460px) minmax(0, 1fr) !important;
    gap: var(--space-8);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-card);
    align-items: start;
    margin: var(--space-8) 0;
    position: relative;
    width: 100%;
}

@media (max-width: 960px) {
    .tool-workspace.vgw-workspace {
        grid-template-columns: 1fr !important;
        padding: var(--space-5);
    }
}

/* ── Left Column: Controls & Settings ── */
.vgw-controls {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

.vgw-header-block {
    margin-bottom: var(--space-2);
}

.vgw-dropzone {
    text-align: center;
    border: 2px dashed rgba(244, 63, 94, 0.35);
    border-radius: var(--radius-lg);
    background: rgba(244, 63, 94, 0.03);
    cursor: pointer;
    transition: all var(--dur-normal) var(--ease-snappy);
}

.vgw-dropzone:hover,
.vgw-dropzone.dragover {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.08);
    transform: translateY(-1px);
}

.vgw-file-info-strip {
    transition: all var(--dur-normal);
}

/* Format Switcher Buttons */
.vgw-fmt-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    color: #e2e8f0;
    transition: all var(--dur-fast);
}

.vgw-fmt-btn:hover {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.06);
}

.vgw-fmt-btn.active {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.14);
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.22);
}

.vgw-fmt-top {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    margin-bottom: 4px;
}

.vgw-fmt-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.vgw-fmt-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    text-transform: uppercase;
}

.vgw-tag-pro {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.vgw-fmt-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin: 0;
}

/* Button Rows (Choice Chips) */
.vgw-btn-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.vgw-choice-btn {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    text-align: center;
    transition: all var(--dur-fast);
}

.vgw-choice-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.vgw-choice-btn.active {
    background: rgba(244, 63, 94, 0.16);
    border-color: #f43f5e;
    color: #fda4af;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

/* ── Right Column: Interactive Stage & Trimmer ── */
.vgw-preview {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.vgw-video-viewport {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* Modal Styling */
.vgw-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    background: rgba(3, 7, 18, 0.85) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    backdrop-filter: blur(8px) !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.vgw-modal-overlay.active,
.vgw-modal-overlay[style*="display: flex"] {
    display: flex !important;
}

@keyframes vgwModalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.vgw-modal-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    max-width: 520px;
    width: 100%;
    animation: vgwModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

.vgw-modal-spinner-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vgw-spinner-ring {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(244, 63, 94, 0.2);
    border-top-color: #f43f5e;
    border-radius: 50%;
    animation: vgwSpin 1s linear infinite;
}

@keyframes vgwSpin {
    to { transform: rotate(360deg); }
}

.vgw-modal-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.vgw-modal-sub {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}

.vgw-progress-bar-wrap {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.vgw-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f43f5e, #fb7185);
    transition: width 0.15s ease-out;
}

.vgw-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    margin-bottom: 16px;
}

.vgw-result-preview-wrap {
    max-width: 100%;
    max-height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 16px auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.vgw-result-img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.vgw-success-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Quick Trim Active State */
.vgw-quick-trim-btn.active {
    background: rgba(244, 63, 94, 0.25) !important;
    border-color: #f43f5e !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.3) !important;
}
