* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #08090d;
    --card: #11131a;
    --card-2: #171922;
    --border: #292d39;
    --text: #f2f4f8;
    --muted: #9ca3b2;
    --accent: #5ca8ff;
    --accent-2: #438cdf;
    --success: #36d399;
    --warning: #f5b942;
    --danger: #ff6678;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at top,
            rgba(124, 92, 255, 0.12),
            transparent 35%
        ),
        var(--bg);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.tool-page {
    width: min(100% - 28px, 920px);
    margin: 0 auto;
    padding: 24px 0 60px;
}

/* Header */

.tool-header {
    margin-bottom: 22px;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text);
}

.hero {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hero-icon {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    font-size: 30px;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.25);
}

.hero h1 {
    font-size: clamp(26px, 5vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.hero p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

/* Cards */

.card {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--card);
    box-shadow:
        0 16px 45px rgba(0, 0, 0, 0.18);
}

.hidden {
    display: none !important;
}

/* Upload */

.drop-area {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    border: 2px dashed #343949;
    border-radius: 18px;
    text-align: center;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.drop-area.drag-over {
    border-color: var(--accent);
    background: rgba(124, 92, 255, 0.07);
}

.upload-icon {
    margin-bottom: 12px;
    font-size: 46px;
}

.drop-area h2 {
    font-size: 21px;
}

.drop-area p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.primary-btn,
.secondary-btn {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        background 0.15s ease;
}

.primary-btn {
    margin-top: 18px;
    background: var(--accent);
    color: white;
}

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

.primary-btn:active,
.secondary-btn:active {
    transform: translateY(0);
}

.primary-btn:disabled,
.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.upload-note {
    margin-top: 14px !important;
    font-size: 12px !important;
}

/* Section heading */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-heading h2 {
    font-size: 20px;
}

.section-heading p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.secondary-btn {
    margin: 0;
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.secondary-btn:hover {
    background: var(--card-2);
}

/* File */

.file-details {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-2);
}

.file-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(124, 92, 255, 0.12);
    font-size: 23px;
}

.file-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.file-status {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(54, 211, 153, 0.1);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

/* Compression options */

.compression-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.compression-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.compression-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-content {
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card-2);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.compression-option:hover .option-content {
    transform: translateY(-1px);
}

.compression-option input:checked + .option-content {
    border-color: var(--accent);
    background: rgba(124, 92, 255, 0.1);
}

.option-content strong {
    font-size: 15px;
}

.option-content small {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.compression-warning {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(245, 185, 66, 0.22);
    border-radius: 13px;
    background: rgba(245, 185, 66, 0.06);
}

.compression-warning span {
    flex-shrink: 0;
}

.compression-warning p {
    color: #c5c9d3;
    font-size: 12px;
}

.compress-btn {
    width: 100%;
}

/* Progress */

.progress-card {
    text-align: left;
}

#progressPercent {
    font-size: 18px;
}

.progress-track {
    width: 100%;
    height: 10px;
    margin-top: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #252934;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 0.2s ease;
}

/* Result */

.size-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.size-box {
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-2);
}

.size-box span {
    color: var(--muted);
    font-size: 12px;
}

.size-box strong {
    margin-top: 5px;
    font-size: 18px;
}

.size-arrow {
    color: var(--muted);
    font-size: 20px;
}

.reduction-box {
    border-color: rgba(54, 211, 153, 0.25);
}

.reduction-box strong {
    color: var(--success);
}

.result-actions {
    margin-top: 20px;
}

.result-actions .primary-btn {
    width: 100%;
    margin-top: 0;
}

/* Information */

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 18px;
}

.info-card {
    display: flex;
    gap: 12px;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
}

.info-card > span {
    font-size: 22px;
}

.info-card h3 {
    font-size: 14px;
}

.info-card p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

/* Warning */

.warning-card {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(245, 185, 66, 0.2);
    border-radius: 16px;
    background: rgba(245, 185, 66, 0.05);
}

.warning-card > span {
    flex-shrink: 0;
    font-size: 22px;
}

.warning-card h3 {
    font-size: 14px;
}

.warning-card p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

/* Mobile */

@media (max-width: 700px) {

    .tool-page {
        width: min(100% - 20px, 920px);
        padding-top: 18px;
    }

    .card {
        padding: 17px;
        border-radius: 17px;
    }

    .hero {
        align-items: flex-start;
    }

    .hero-icon {
        width: 54px;
        height: 54px;
        border-radius: 15px;
        font-size: 26px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .compression-options {
        grid-template-columns: 1fr;
    }

    .option-content {
        min-height: auto;
    }

    .size-comparison {
        grid-template-columns: 1fr;
    }

    .size-arrow {
        display: none;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
    }

    .file-details {
        align-items: flex-start;
    }

    .file-status {
        display: none;
    }
}

@media (max-width: 430px) {

    .tool-page {
        width: min(100% - 16px, 920px);
    }

    .drop-area {
        min-height: 270px;
        padding: 24px 15px;
    }

    .drop-area h2 {
        font-size: 19px;
    }

    .primary-btn,
    .secondary-btn {
        min-height: 44px;
        padding: 0 16px;
    }

    .section-heading {
        flex-direction: column;
    }

    .section-heading .secondary-btn {
        align-self: flex-start;
    }
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}