@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════════════════════ */
:root {
    /* Module 1 — existing WebP Micro Converter */
    --wmc-primary:      #6366f1;
    --wmc-secondary:    #4f46e5;
    --wmc-danger:       #ef4444;
    --wmc-bg:           #0f172a;
    --wmc-card-bg:      rgba(255, 255, 255, 0.05);
    --wmc-text:         #f8fafc;
    --wmc-text-muted:   #94a3b8;

    /* Module 2 — Compress & Convert (teal/emerald accent) */
    --wmcc-primary:     #10b981;
    --wmcc-secondary:   #059669;
    --wmcc-card-bg:     rgba(255, 255, 255, 0.05);
    --wmcc-glow:        rgba(16, 185, 129, 0.18);
}


/* ═══════════════════════════════════════════════════════════
   DUAL-LAYOUT WRAPPER — side-by-side on desktop
═══════════════════════════════════════════════════════════ */

.wmc-dual-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1.75rem;
    max-width: 1120px;
    margin: 2rem auto;
    padding: 0 1.25rem;
    box-sizing: border-box;
}

.wmc-dual-layout > #wmc-container,
.wmc-dual-layout > #wmcc-container {
    flex: 1 1 0%;
    min-width: 0;       
    max-width: none;    
    margin: 0;          
    width: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════
   MODULE 1 — WEBP MICRO CONVERTER
═══════════════════════════════════════════════════════════ */

#wmc-container {
    font-family: 'Outfit', sans-serif;
    max-width: 500px;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: 24px;
    background: var(--wmc-card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--wmc-text);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#wmc-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.wmc-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wmc-subtitle {
    color: var(--wmc-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Upload zone */
.wmc-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 3rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.wmc-upload-zone:hover {
    border-color: var(--wmc-primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.wmc-upload-content {
    pointer-events: none;
}

.wmc-upload-content p {
    color: #000080;
    font-weight: 500;
}

.wmc-icon {
    color: #000080;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Cropper */
.wmc-cropper-wrapper {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 1/1;
}

/* Actions row */
.wmc-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* ── Shared button base ────────────────────────────────── */
.wmc-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.wmc-btn-primary {
    background: linear-gradient(135deg, var(--wmc-primary) 0%, var(--wmc-secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.wmc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.wmc-btn-secondary {
    background: #10b981 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.wmc-btn-secondary:hover {
    background: #059669 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

.wmc-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--wmc-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.wmc-btn-danger:hover {
    background: var(--wmc-danger);
    color: white;
}

.wmc-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--wmc-text-muted);
    margin-top: 1.5rem;
    width: 100%;
}
.wmc-btn-outline:hover {
    border-color: var(--wmc-primary);
    color: var(--wmc-text);
}

/* Result preview */
.wmc-result-preview {
    background: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    border-radius: 16px;
    display: inline-block;
}

#wmc-final-image {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
}

/* ── Conversion detail badges — white text / black bg (BOTH converters) ── */
.wmc-result-info {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* Applied to #wmc-file-size, #wmc-file-dim, #wmcc-file-size, #wmcc-file-dim */
.wmc-info-badge {
    display: inline-block;
    background: #000000;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* Loader overlay */
.wmc-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
    backdrop-filter: blur(4px);
}

.wmc-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--wmc-primary);
    border-radius: 50%;
    animation: wmcSpin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Cropper overrides */
.cropper-view-box, .cropper-face { border-radius: 8px; }
.cropper-line, .cropper-point    { background-color: var(--wmc-primary); }

/* ── Shared timer styles (used by both modules) ─────────── */
.wmc-timer-box {
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: #000000;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 280px;
    width: 100%;
}

.wmc-timer-progress {
    position: relative;
    width: 100px;
    height: 100px;
}

.wmc-timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.wmc-timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.wmc-timer-bar {
    fill: none;
    stroke: var(--wmc-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.wmcc-timer-bar {
    fill: none;
    stroke: var(--wmcc-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.wmc-countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wmc-text);
}

.wmc-timer-label {
    font-size: 0.9rem;
    color: var(--wmc-text-muted);
    font-weight: 500;
    animation: wmcPulse 2s infinite;
}

@keyframes wmcPulse {
    0%   { opacity: 0.6; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}


/* ═══════════════════════════════════════════════════════════
   MODULE 2 — COMPRESS & CONVERT  (prefix: wmcc-)
═══════════════════════════════════════════════════════════ */

#wmcc-container {
    font-family: 'Outfit', sans-serif;
    max-width: 500px;
    margin: 2rem auto;
    padding: 2.5rem;
    border-radius: 24px;
    background: var(--wmcc-card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.18);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(16, 185, 129, 0.08) inset;
    color: var(--wmc-text);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#wmcc-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, var(--wmcc-glow) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

/* Title */
.wmcc-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #34d399, #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wmcc-subtitle {
    color: var(--wmc-text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Upload zone */
.wmcc-upload-zone {
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 2.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(16, 185, 129, 0.03);
}

.wmcc-upload-zone:hover,
.wmcc-upload-zone.wmcc-dragover {
    border-color: var(--wmcc-primary);
    background: rgba(16, 185, 129, 0.07);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.12);
}

.wmcc-upload-content {
    pointer-events: none;
}

.wmc-upload-content p, 
.wmcc-upload-content p,
.wmcc-upload-content strong {
    color: #000000 !important;
    font-weight: 500;
    margin: 0.75rem 0 0.4rem;
}

.wmcc-icon {
    color: var(--wmcc-primary);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.wmcc-supported-types {
    font-size: 0.78rem;
    color: var(--wmc-text-muted);
    letter-spacing: 0.05em;
}

/* File preview */
.wmcc-file-preview {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

#wmcc-preview-img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* PDF placeholder icon */
.wmcc-pdf-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: #f87171;
}

.wmcc-pdf-name {
    font-size: 0.82rem;
    color: var(--wmc-text-muted);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Convert button (teal variant) */
.wmcc-btn-primary {
    background: linear-gradient(135deg, var(--wmcc-primary) 0%, var(--wmcc-secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.wmcc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    color: white;
}

/* Result preview */
.wmcc-result-preview {
    background: rgba(0, 0, 0, 0.25);
    padding: 2rem;
    border-radius: 16px;
    display: inline-block;
}

#wmcc-final-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    margin-bottom: 1rem;
    object-fit: contain;
}

/* Loader overlay */
.wmcc-loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
    backdrop-filter: blur(4px);
}

.wmcc-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--wmcc-primary);
    border-radius: 50%;
    animation: wmccSpin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error box — dark red on white */
.wmcc-error-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: #ffffff;
    border: 2px solid #991b1b;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-top: 1.25rem;
    text-align: left;
    color: #991b1b;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wmcc-error-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #991b1b;
}

/* PDF result block */
.wmcc-result-pdf-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wmcc-pdf-result-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: #f87171;
}

.wmcc-pdf-result-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--wmc-text-muted);
    letter-spacing: 0.04em;
}

/* ── Custom Format Selection for Module 2 ───────────────── */
.wmcc-format-selection-wrapper {
    margin: 1.25rem 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.wmcc-select-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wmc-text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.wmcc-select-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.wmcc-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--wmc-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.wmcc-select:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--wmcc-primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.wmcc-select:focus {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--wmcc-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.wmcc-select option {
    background: #0f172a;
    color: var(--wmc-text);
    padding: 0.5rem;
}

.wmcc-select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wmcc-primary);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.wmcc-select:focus + .wmcc-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   Switch to column on tablets and phones
═══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .wmc-dual-layout {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .wmc-dual-layout > #wmc-container,
    .wmc-dual-layout > #wmcc-container {
        flex: 1 1 auto;
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 560px) {
    .wmc-dual-layout {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }

    #wmc-container,
    #wmcc-container {
        padding: 1.5rem 1.25rem;
    }

    .wmc-title,
    .wmcc-title {
        font-size: 1.45rem;
    }

    .wmc-btn {
        padding: 0.65rem 1.1rem;
        font-size: 0.88rem;
    }

    .wmc-actions {
        flex-direction: column;
    }
}
