/* =========================================================
   IMAGEKITTOOLS
   Main stylesheet
   ========================================================= */


/* ================= RESET ================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #f7f8fc;
    color: #182033;
    line-height: 1.6;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}


/* ================= GLOBAL ================= */

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.hidden {
    display: none !important;
}


/* ================= HEADER ================= */

.site-header {
    height: 76px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e7e9f0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo > span:last-child > span {
    color: #635bff;
}

.logo-icon {
    width: 31px;
    height: 31px;
    border-radius: 9px;
    background: #635bff;
    color: white;
    display: grid;
    place-items: center;
    font-size: 12px;
    transform: rotate(45deg);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.main-nav a {
    color: #687083;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #635bff;
}

.mobile-menu-btn {
    display: none;
    border: 0;
    background: transparent;
    font-size: 25px;
    color: #182033;
}


/* ================= HERO ================= */

.hero {
    padding: 76px 0 34px;
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(99, 91, 255, 0.11),
            transparent 42%
        );
}

.hero-content {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 38px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eeedff;
    color: #5b53e7;
    border: 1px solid #dfddff;
    padding: 7px 13px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 19px;
}

.hero h1 {
    font-size: clamp(38px, 5vw, 61px);
    line-height: 1.08;
    letter-spacing: -2.8px;
    font-weight: 850;
    color: #151a2d;
}

.hero h1 span {
    display: block;
    color: #635bff;
}

.hero-description {
    max-width: 650px;
    margin: 21px auto 0;
    color: #687083;
    font-size: 17px;
}


/* ================= COMPRESSOR ================= */

.compressor-card {
    max-width: 980px;
    margin: 0 auto;
    background: white;
    border: 1px solid #e3e6ef;
    border-radius: 22px;
    box-shadow:
        0 20px 60px rgba(33, 39, 65, 0.09),
        0 3px 10px rgba(33, 39, 65, 0.03);
    overflow: hidden;
}


/* Upload */

.upload-state {
    padding: 65px 30px;
    text-align: center;
    border: 2px dashed #d8d9e7;
    margin: 18px;
    border-radius: 16px;
    transition: all 0.2s ease;
}

.upload-state.drag-over {
    border-color: #635bff;
    background: #f7f6ff;
    transform: scale(0.995);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 19px;
    border-radius: 18px;
    background: #eeedff;
    color: #635bff;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 700;
}

.upload-state h2 {
    font-size: 23px;
    margin-bottom: 4px;
    color: #1a2032;
}

.upload-state p {
    color: #7b8190;
    font-size: 14px;
}

.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 21px;
    padding: 12px 24px;
    background: #635bff;
    color: white;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 16px rgba(99, 91, 255, 0.23);
}

.upload-button:hover {
    background: #544ce9;
    transform: translateY(-1px);
}

.supported-formats {
    margin-top: 18px;
    color: #969ba8;
    font-size: 11px;
    font-weight: 600;
}

.supported-formats span {
    margin: 0 5px;
    color: #d2d4db;
}


/* Editor */

.editor-state {
    padding: 30px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eceef3;
}

.editor-header h2 {
    font-size: 21px;
    color: #1a2032;
}

.editor-header p {
    color: #7b8190;
    font-size: 13px;
    margin-top: 3px;
}

.reset-button {
    border: 1px solid #e2e4eb;
    background: white;
    color: #747a88;
    border-radius: 8px;
    padding: 8px 13px;
    font-size: 12px;
    font-weight: 700;
}

.reset-button:hover {
    border-color: #635bff;
    color: #635bff;
}


/* Editor Grid */

.editor-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 30px;
    padding-top: 30px;
}


/* Preview */

.preview-label {
    color: #777d8d;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px;
}

.image-preview {
    height: 390px;
    border-radius: 13px;
    background:
        linear-gradient(45deg, #f0f1f5 25%, transparent 25%),
        linear-gradient(-45deg, #f0f1f5 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f1f5 75%),
        linear-gradient(-45deg, transparent 75%, #f0f1f5 75%);
    background-size: 28px 28px;
    background-position: 0 0, 0 14px, 14px -14px, -14px 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e3e5eb;
}

.image-preview img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}


/* Controls */

.compression-controls {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.file-information {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
}

.file-info-box {
    padding: 12px;
    background: #f7f8fb;
    border: 1px solid #ebedf2;
    border-radius: 10px;
}

.file-info-box span {
    display: block;
    font-size: 10px;
    color: #888e9d;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.file-info-box strong {
    display: block;
    margin-top: 3px;
    color: #242a3d;
    font-size: 14px;
}

.savings-box strong {
    color: #16a06a;
}


/* Quality */

.quality-control {
    padding-top: 2px;
}

.quality-heading {
    display: flex;
    justify-content: space-between;
    margin-bottom: 11px;
}

.quality-heading label,
.output-format label {
    font-size: 12px;
    font-weight: 750;
    color: #42485a;
}

.quality-heading strong {
    color: #635bff;
    font-size: 12px;
}

input[type="range"] {
    width: 100%;
    appearance: none;
    height: 5px;
    border-radius: 20px;
    background: #dddff0;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #635bff;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(35, 39, 65, 0.22);
}

input[type="range"]::-moz-range-thumb {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #635bff;
    border: 4px solid white;
    box-shadow: 0 2px 8px rgba(35, 39, 65, 0.22);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    color: #9b9fac;
    font-size: 10px;
}


/* Format */

.output-format {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.output-format select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #dfe2ea;
    border-radius: 9px;
    color: #343a4c;
    background: white;
    outline: none;
    cursor: pointer;
}

.output-format select:focus {
    border-color: #635bff;
}


/* Buttons */

.compress-button,
.download-button {
    min-height: 47px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.2s ease;
}

.compress-button {
    border: none;
    background: #635bff;
    color: white;
    box-shadow: 0 8px 20px rgba(99, 91, 255, 0.2);
}

.compress-button:hover {
    background: #554de8;
    transform: translateY(-1px);
}

.button-arrow {
    font-size: 18px;
}

.download-button {
    background: #18a36e;
    color: white;
}

.download-button:hover {
    background: #128c5d;
}

.download-button span {
    font-size: 19px;
}


/* Privacy */

.privacy-note {
    text-align: center;
    margin: 17px auto 0;
    font-size: 11px;
    color: #888e9d;
}

.privacy-note strong {
    color: #606675;
}


/* ================= ADS ================= */

.ad-section {
    padding: 24px 0;
}

.ad-placeholder {
    max-width: 970px;
    height: 100px;
    margin: auto;
    display: grid;
    place-items: center;
    border: 1px solid #e8e9ee;
    background: #fbfbfc;
    color: #b0b3bc;
    font-size: 9px;
    letter-spacing: 1px;
}


/* ================= SECTION HEADING ================= */

.tools-section,
.how-section {
    padding: 85px 0;
}

.tools-section {
    background: white;
}

.section-heading {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 38px;
}

.section-label {
    color: #635bff;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 1.5px;
    margin-bottom: 9px;
}

.section-heading h2 {
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -1px;
    color: #171d30;
}

.section-heading p {
    color: #7a8090;
    font-size: 14px;
    margin-top: 10px;
}


/* ================= TOOLS GRID ================= */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.tool-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 105px;
    padding: 18px;
    border: 1px solid #e7e9ef;
    border-radius: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-3px);
    border-color: #cbc9ff;
    box-shadow: 0 10px 25px rgba(31, 35, 65, 0.07);
}

.active-tool {
    border-color: #cbc9ff;
    background: #fafaff;
}

.tool-icon {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #eeedff;
    color: #635bff;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 850;
}

.tool-card h3 {
    font-size: 13px;
    color: #252b3e;
}

.tool-card p {
    color: #8a8f9e;
    font-size: 11px;
    margin-top: 2px;
}

.tool-arrow {
    margin-left: auto;
    color: #9a9fac;
}

.coming-soon {
    position: absolute;
    right: 13px;
    top: 11px;
    font-size: 8px;
    color: #8a8e9b;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 800;
}


/* ================= HOW IT WORKS ================= */

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

.step-card {
    position: relative;
    background: white;
    border: 1px solid #e6e8ee;
    border-radius: 15px;
    padding: 28px;
}

.step-number {
    position: absolute;
    right: 20px;
    top: 17px;
    color: #e0e1e9;
    font-size: 12px;
    font-weight: 850;
}

.step-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #eeedff;
    color: #635bff;
    display: grid;
    place-items: center;
    font-size: 20px;
    margin-bottom: 18px;
}

.step-card h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.step-card p {
    color: #7f8492;
    font-size: 12px;
}


/* ================= CONTENT ================= */

.content-section {
    padding: 80px 0;
    background: white;
    border-top: 1px solid #eceef3;
}

.content-container {
    max-width: 850px;
}

.content-container h2 {
    margin-top: 25px;
    margin-bottom: 9px;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.content-container p {
    color: #6f7585;
    font-size: 14px;
    margin-bottom: 13px;
}

.faq-heading {
    margin-top: 55px;
    margin-bottom: 22px;
}

.faq-heading h2 {
    margin-top: 5px;
}


/* FAQ */

.faq-list {
    border-top: 1px solid #e5e7ed;
}

.faq-list details {
    border-bottom: 1px solid #e5e7ed;
}

.faq-list summary {
    list-style: none;
    padding: 18px 3px;
    font-size: 14px;
    font-weight: 700;
    color: #343a4b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary span {
    font-size: 20px;
    color: #8c91a0;
    font-weight: 400;
}

.faq-list details[open] summary span {
    transform: rotate(45deg);
}

.faq-list details p {
    padding: 0 25px 18px 3px;
    margin: 0;
    font-size: 13px;
}


/* ================= FOOTER ================= */

.site-footer {
    background: #171b2c;
    color: white;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    padding: 45px 0;
}

.footer-brand .logo {
    color: white;
}

.footer-brand p {
    max-width: 300px;
    color: #9da2b2;
    font-size: 12px;
    margin-top: 10px;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-links a {
    color: #b7bbc8;
    font-size: 11px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #2b2f40;
    padding: 17px 0;
}

.footer-bottom p {
    color: #777d8e;
    font-size: 10px;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 850px) {

    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

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

    .image-preview {
        height: 350px;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-inner {
        flex-direction: column;
    }
}


@media (max-width: 600px) {

    .container {
        width: min(100% - 24px, 1120px);
    }

    .hero {
        padding-top: 48px;
    }

    .hero h1 {
        font-size: 39px;
        letter-spacing: -1.8px;
    }

    .hero-description {
        font-size: 14px;
    }

    .compressor-card {
        border-radius: 16px;
    }

    .upload-state {
        padding: 45px 18px;
        margin: 10px;
    }

    .editor-state {
        padding: 20px 15px;
    }

    .editor-header {
        flex-direction: column;
    }

    .editor-grid {
        gap: 22px;
    }

    .image-preview {
        height: 270px;
    }

    .file-information {
        grid-template-columns: 1fr;
    }

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

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

    .tools-section,
    .how-section,
    .content-section {
        padding: 60px 0;
    }

    .footer-links {
        gap: 14px;
    }
}

/* ================= UPGRADE 1: RESULTS ================= */

.results-panel {
    padding: 15px;
    background: #fafaff;
    border: 1px solid #e6e5f7;
    border-radius: 14px;
}

.results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.results-kicker {
    display: block;
    color: #635bff;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 1.2px;
}

.results-heading h3 {
    margin-top: 2px;
    color: #242a3d;
    font-size: 15px;
    line-height: 1.2;
}

.results-status {
    flex-shrink: 0;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f0f1f5;
    color: #7c8290;
    font-size: 9px;
    font-weight: 800;
}

.results-status.success {
    background: #e7f8f0;
    color: #159563;
}

.results-panel .file-information {
    gap: 8px;
}

.results-panel .file-info-box {
    background: white;
    border-color: #e8e8ef;
    padding: 11px;
}

.results-panel .file-info-box strong {
    font-size: 15px;
}

.file-details-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.file-detail {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #e8e8ef;
    border-radius: 9px;
    background: white;
}

.file-detail span {
    display: block;
    margin-bottom: 2px;
    color: #9297a4;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .35px;
}

.file-detail strong {
    display: block;
    overflow: hidden;
    color: #454b5b;
    font-size: 10px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compress-button:disabled {
    cursor: wait;
    opacity: .72;
    transform: none;
}

@media (max-width: 600px) {
    .results-heading {
        align-items: flex-start;
    }

    .file-details-grid {
        grid-template-columns: 1fr;
    }
}
