/* =====================================
   IMAGE COMPRESSOR FINAL PREMIUM CSS
===================================== */



/* HERO */

.tool-hero{

    padding:28px 0 22px;
    text-align:center;

}


.tool-hero h1{

    font-size:clamp(28px,3vw,36px);
    font-weight:800;
    color:#0f172a;

}


.tool-hero p{

    color:#64748b;
    font-size:15px;

}







/* MAIN GRID */


.compress-box{

    display:grid;

    grid-template-columns:repeat(3,1fr);

    gap:16px;

    align-items:stretch;

}







/* CARD */


.compress-card{


    background:#ffffff;

    border:1px solid #e5e7eb;

    border-radius:18px;

    padding:18px;

    min-height:0;

    display:flex;

    flex-direction:column;


    box-shadow:

    0 12px 35px rgba(0,0,0,.08);


}



.compress-card h3{

    text-align:center;

    font-size:21px;

    font-weight:800;

    color:#0f172a;

    margin-bottom:20px;

}








/* ==========================
UPLOAD AREA
========================== */


.upload-area{


    flex:1;

    min-height:230px;

    border:2px dashed #2563eb;

    border-radius:20px;

    background:#f8fbff;


    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    text-align:center;

    padding:15px;

}



.upload-area > i{


    font-size:45px;

    color:#2563eb;

    margin-bottom:10px;


}



.upload-area h4{

    margin:8px 0;

    font-size:18px;

}



.upload-area p{

    color:#64748b;

    line-height:1.7;

}






/* ORIGINAL IMAGE PREVIEW */


.original-preview{


    display:none;

    width:90%;

    height:120px;

    object-fit:contain;

    border-radius:15px;

    margin-bottom:10px;

}







/* CHOOSE BUTTON */


.choose-btn{


    margin-top:10px;

    background:#2563eb;

    color:white;

    padding:10px 25px;

    border-radius:12px;

    font-weight:700;

    cursor:pointer;


}



.choose-btn input{


    display:none;


}







/* RESET BUTTON */


.btn-reset{


    margin-top:12px;

    width:75%;

    height:40px;

    border:none;

    border-radius:12px;


    background:#fee2e2;

    color:#dc2626;


    font-size:15px;

    font-weight:700;


    display:flex;

    align-items:center;

    justify-content:center;

    gap:8px;


    cursor:pointer;


}



.btn-reset i{

    font-size:16px;

}








/* INFO BOX */


.info{


    margin-top:15px;

    padding:12px;

    border-radius:12px;

    background:#eff6ff;

    text-align:center;


}



.info b{

    color:#2563eb;

}









/* ==========================
SIZE SELECT
========================== */


.size-options{


    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:12px;

    margin:20px 0;


}



.size-btn{


    height:48px;

    background:#f1f5f9;

    border-radius:14px;


    display:flex;

    justify-content:center;

    align-items:center;


    cursor:pointer;

    font-weight:700;


    border:2px solid transparent;

    transition:.3s;


}



.size-btn input{

    display:none;

}





.size-btn:has(input:checked){


    background:#2563eb;

    color:white;

    border-color:#1d4ed8;


    box-shadow:

    0 8px 20px rgba(37,99,235,.30);


    transform:translateY(-2px);


}








/* CUSTOM SIZE */


#customSize{


    width:100%;

    height:42px;

    border-radius:12px;

    border:1px solid #cbd5e1;

    padding:10px;


}









/* BUTTON */


.btn-primary{


    width:100%;

    height:45px;

    border:none;

    border-radius:14px;

    background:#2563eb;

    color:white;

    font-weight:700;

    cursor:pointer;


}








/* PROGRESS */


.progress-box{

    margin-top:22px;

    text-align:center;

}



.progress{


    width:100%;

    height:10px;

    background:#e2e8f0;

    border-radius:20px;

    overflow:hidden;


}



#progressBar{


    width:0%;

    height:100%;

    background:#2563eb;

    transition:.3s;


}



#progressText{

    display:block;

    margin-top:8px;

    font-weight:700;

}








/* RESULT PREVIEW */


.image-preview{


    height:210px;

    border-radius:18px;

    background:#f8fafc;


    display:flex;

    justify-content:center;

    align-items:center;


    overflow:hidden;


}



.image-preview img{


    width:95%;

    height:95%;

    object-fit:contain;


}







/* DOWNLOAD */


.btn-success{


    width:100%;

    height:45px;

    margin-top:auto;

    border:none;

    border-radius:14px;

    background:#16a34a;

    color:white;

    font-weight:700;

}



#downloadBtn:disabled{


    opacity:.5;

    cursor:not-allowed;


}








.tool-link{
    display:block;
    text-decoration:none;
    color:inherit;
}

.image-tool-card{
    cursor:pointer;
    transition:.3s ease;
}

.image-tool-card:hover{
    transform:translateY(-8px);
    background:#2563eb;
    color:#fff;
    box-shadow:0 15px 35px rgba(37,99,235,.35);
}

.image-tool-card:hover p,
.image-tool-card:hover h3,
.image-tool-card:hover a{
    color:#fff;
}

.image-tool-card:hover .image-tool-icon{
    background:#fff;
    color:#2563eb;
}

/* =========================================================
   CONTENT / SEO / FAQ / ADS
========================================================= */

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

.compact-section{
    padding:20px 0;
}

.content-heading{
    text-align:center;
    margin-bottom:18px;
}

.content-heading h2{
    margin:0 0 7px;
    color:#0f172a;
    font-size:24px;
    font-weight:800;
}

.content-heading p{
    max-width:760px;
    margin:0 auto;
    color:#64748b;
    line-height:1.6;
    font-size:14px;
}

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

.ad-box{
    min-height:76px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fafafa;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#94a3b8;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.05em;
}

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

.info-card{
    padding:18px;
    border:1px solid #e5e7eb;
    border-radius:16px;
    background:#fff;
    box-shadow:0 5px 18px rgba(15,23,42,.05);
}

.step-number{
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:#2563eb;
    color:#fff;
    font-weight:800;
    margin-bottom:10px;
}

.info-card h3{
    margin:0 0 6px;
    color:#0f172a;
    font-size:17px;
}

.info-card p{
    margin:0;
    color:#64748b;
    font-size:13px;
    line-height:1.55;
}

/* Features */
.feature-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}

.feature-mini{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:16px;
    border:1px solid #e5e7eb;
    border-radius:15px;
    background:#fff;
}

.feature-mini > i{
    width:38px;
    height:38px;
    min-width:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:11px;
    background:#eff6ff;
    color:#2563eb;
}

.feature-mini h3{
    margin:0 0 4px;
    font-size:15px;
    color:#0f172a;
}

.feature-mini p{
    margin:0;
    color:#64748b;
    font-size:12px;
    line-height:1.45;
}

/* Privacy */
.privacy-card{
    display:flex;
    gap:15px;
    padding:18px;
    border:1px solid #dbeafe;
    border-radius:16px;
    background:#eff6ff;
}

.privacy-icon{
    width:44px;
    height:44px;
    min-width:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:12px;
    background:#2563eb;
    color:#fff;
}

.privacy-card h2{
    margin:0 0 7px;
    color:#0f172a;
    font-size:20px;
}

.privacy-card p{
    margin:5px 0;
    color:#475569;
    font-size:13px;
    line-height:1.55;
}

/* FAQ */
.faq-list{
    max-width:900px;
    margin:auto;
}

.faq-list details{
    margin-bottom:8px;
    padding:14px 16px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
}

.faq-list summary{
    cursor:pointer;
    color:#0f172a;
    font-size:14px;
    font-weight:700;
}

.faq-list p{
    margin:10px 0 0;
    color:#64748b;
    font-size:13px;
    line-height:1.55;
}

/* Related */
.related-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:12px;
}

.related-grid a{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:13px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
    color:#0f172a;
    text-decoration:none;
    font-size:13px;
    font-weight:700;
}

.related-grid a:hover{
    border-color:#93c5fd;
    color:#2563eb;
}

/* Compact desktop */
@media(min-width:1101px){
    .compress-card{
        min-height:420px;
        padding:16px;
    }

    .upload-area{
        min-height:220px;
    }

    .image-preview{
        height:190px;
    }

    .size-options{
        gap:8px;
        margin:12px 0;
    }

    .size-btn{
        height:42px;
    }

    .progress-box{
        margin-top:14px;
    }
}

/* Tablet */
@media(max-width:1100px) and (min-width:701px){
    .compress-box{
        grid-template-columns:repeat(3,minmax(0,1fr));
        gap:14px;
    }

    .compress-card{
        padding:14px;
    }

    .compress-card h3{
        font-size:18px;
        margin-bottom:14px;
    }

    .upload-area{
        min-height:205px;
    }

    .image-preview{
        height:175px;
    }

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

/* Mobile */
@media(max-width:700px){

    .tool-hero{
        padding:24px 0 18px;
    }

    .tool-hero h1{
        font-size:28px;
    }

    .tool-hero p{
        font-size:14px;
        line-height:1.5;
    }

    .compress-box{
        grid-template-columns:1fr;
        gap:12px;
    }

    .compress-card{
        min-height:0;
        padding:14px;
        border-radius:15px;
    }

    .compress-card h3{
        font-size:18px;
        margin-bottom:12px;
    }

    .upload-area{
        min-height:190px;
        border-radius:15px;
    }

    .upload-area > i{
        font-size:34px;
    }

    .upload-area p{
        font-size:13px;
        line-height:1.45;
    }

    .choose-btn{
        padding:9px 18px;
    }

    .btn-reset{
        width:100%;
        height:38px;
        margin-top:8px;
    }

    .info{
        margin-top:9px;
        padding:9px;
        font-size:13px;
    }

    .size-options{
        gap:7px;
        margin:12px 0;
    }

    .size-btn{
        height:40px;
        border-radius:11px;
        font-size:13px;
    }

    .btn-primary,
    .btn-success{
        height:42px;
        border-radius:11px;
    }

    .image-preview{
        height:180px;
        border-radius:14px;
    }

    .content-section{
        padding:18px 0;
    }

    .steps-grid,
    .feature-grid,
    .related-grid{
        grid-template-columns:1fr;
        gap:10px;
    }

    .content-heading{
        margin-bottom:13px;
    }

    .content-heading h2{
        font-size:21px;
    }

    .privacy-card{
        padding:14px;
    }

    .ad-box{
        min-height:62px;
    }
}

/* Very small phones */
@media(max-width:420px){

    .tool-hero h1{
        font-size:25px;
    }

    .compress-card{
        padding:12px;
    }

    .upload-area{
        min-height:175px;
    }

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

    .info-card,
    .feature-mini{
        padding:13px;
    }

    .faq-list details{
        padding:12px 13px;
    }
}

.upload-area.drag-active{
    background:#dbeafe !important;
    border-color:#1d4ed8 !important;
    transform:scale(1.01);
}

/* =========================================================
   FINAL LAYOUT SAFETY
   Same Image Compressor look — clean responsive behavior
   ========================================================= */

.compress-box{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    align-items:stretch;
}

.compress-card{
    min-width:0;
    overflow:hidden;
}

@media(max-width:700px){
    .compress-box{
        grid-template-columns:1fr;
        gap:12px;
    }
}

/* Keep controls from overflowing narrow cards */
.size-options{
    min-width:0;
}

.size-btn,
.btn-primary,
.btn-success,
.choose-btn,
.btn-reset{
    box-sizing:border-box;
}

/* Slider stays visible and easy to use */
.quality-slider{
    display:block;
    width:100%;
    min-width:0;
    box-sizing:border-box;
}


/* =========================================================
   OneToolBox IMAGE COMPRESSOR — DARK MODE
   Keeps all existing content/SEO/FAQ layouts intact.
   ========================================================= */

/* Page */
html[data-theme="dark"] body,
body[data-theme="dark"],
body.dark {
    background:#0b1220;
    color:#e5e7eb;
}

/* Hero */
html[data-theme="dark"] .tool-hero h1,
body[data-theme="dark"] .tool-hero h1,
body.dark .tool-hero h1 {
    color:#f8fafc;
}

html[data-theme="dark"] .tool-hero p,
body[data-theme="dark"] .tool-hero p,
body.dark .tool-hero p {
    color:#94a3b8;
}

/* Main compressor cards */
html[data-theme="dark"] .compress-card,
body[data-theme="dark"] .compress-card,
body.dark .compress-card {
    background:#111827;
    border-color:#263449;
    box-shadow:0 12px 35px rgba(0,0,0,.30);
}

html[data-theme="dark"] .compress-card h3,
body[data-theme="dark"] .compress-card h3,
body.dark .compress-card h3 {
    color:#f8fafc;
}

/* Upload */
html[data-theme="dark"] .upload-area,
body[data-theme="dark"] .upload-area,
body.dark .upload-area {
    background:#0f172a;
    border-color:#3b82f6;
}

html[data-theme="dark"] .upload-area h4,
body[data-theme="dark"] .upload-area h4,
body.dark .upload-area h4 {
    color:#f8fafc;
}

html[data-theme="dark"] .upload-area p,
body[data-theme="dark"] .upload-area p,
body.dark .upload-area p {
    color:#94a3b8;
}

/* Reset */
html[data-theme="dark"] .btn-reset,
body[data-theme="dark"] .btn-reset,
body.dark .btn-reset {
    background:#3a2024;
    color:#f87171;
}

/* Info */
html[data-theme="dark"] .info,
body[data-theme="dark"] .info,
body.dark .info {
    background:#172554;
    color:#dbeafe;
}

html[data-theme="dark"] .info b,
body[data-theme="dark"] .info b,
body.dark .info b {
    color:#60a5fa;
}

/* Target size buttons */
html[data-theme="dark"] .size-btn,
body[data-theme="dark"] .size-btn,
body.dark .size-btn {
    background:#1e293b;
    color:#e5e7eb;
    border-color:#334155;
}

html[data-theme="dark"] .size-btn:hover,
body[data-theme="dark"] .size-btn:hover,
body.dark .size-btn:hover {
    background:#273449;
}

html[data-theme="dark"] .size-btn:has(input:checked),
body[data-theme="dark"] .size-btn:has(input:checked),
body.dark .size-btn:has(input:checked) {
    background:#2563eb;
    color:#fff;
    border-color:#3b82f6;
}

/* Custom input */
html[data-theme="dark"] #customSize,
body[data-theme="dark"] #customSize,
body.dark #customSize {
    background:#0f172a;
    color:#f8fafc;
    border-color:#475569;
}

html[data-theme="dark"] #customSize::placeholder,
body[data-theme="dark"] #customSize::placeholder,
body.dark #customSize::placeholder {
    color:#64748b;
}

/* Progress */
html[data-theme="dark"] .progress,
body[data-theme="dark"] .progress,
body.dark .progress {
    background:#273449;
}

/* Result preview */
html[data-theme="dark"] .image-preview,
body[data-theme="dark"] .image-preview,
body.dark .image-preview {
    background:#0f172a;
    border:1px solid #263449;
}

/* =========================================================
   LOWER CONTENT — preserve the original cards/grid and
   only change their colors in dark mode.
   ========================================================= */

html[data-theme="dark"] .content-heading h2,
body[data-theme="dark"] .content-heading h2,
body.dark .content-heading h2 {
    color:#f8fafc;
}

html[data-theme="dark"] .content-heading p,
body[data-theme="dark"] .content-heading p,
body.dark .content-heading p {
    color:#94a3b8;
}

html[data-theme="dark"] .ad-box,
body[data-theme="dark"] .ad-box,
body.dark .ad-box {
    background:#111827;
    border-color:#263449;
    color:#64748b;
}

/* How it works cards */
html[data-theme="dark"] .info-card,
body[data-theme="dark"] .info-card,
body.dark .info-card {
    background:#111827;
    border-color:#263449;
    box-shadow:0 5px 18px rgba(0,0,0,.22);
}

html[data-theme="dark"] .info-card h3,
body[data-theme="dark"] .info-card h3,
body.dark .info-card h3 {
    color:#f8fafc;
}

html[data-theme="dark"] .info-card p,
body[data-theme="dark"] .info-card p,
body.dark .info-card p {
    color:#94a3b8;
}

/* Feature cards */
html[data-theme="dark"] .feature-mini,
body[data-theme="dark"] .feature-mini,
body.dark .feature-mini {
    background:#111827;
    border-color:#263449;
}

html[data-theme="dark"] .feature-mini h3,
body[data-theme="dark"] .feature-mini h3,
body.dark .feature-mini h3 {
    color:#f8fafc;
}

html[data-theme="dark"] .feature-mini p,
body[data-theme="dark"] .feature-mini p,
body.dark .feature-mini p {
    color:#94a3b8;
}

html[data-theme="dark"] .feature-mini > i,
body[data-theme="dark"] .feature-mini > i,
body.dark .feature-mini > i {
    background:#172554;
    color:#60a5fa;
}

/* Privacy */
html[data-theme="dark"] .privacy-card,
body[data-theme="dark"] .privacy-card,
body.dark .privacy-card {
    background:#172554;
    border-color:#1e40af;
}

html[data-theme="dark"] .privacy-card h2,
body[data-theme="dark"] .privacy-card h2,
body.dark .privacy-card h2 {
    color:#f8fafc;
}

html[data-theme="dark"] .privacy-card p,
body[data-theme="dark"] .privacy-card p,
body.dark .privacy-card p {
    color:#cbd5e1;
}

/* FAQ */
html[data-theme="dark"] .faq-list details,
body[data-theme="dark"] .faq-list details,
body.dark .faq-list details {
    background:#111827;
    border-color:#263449;
}

html[data-theme="dark"] .faq-list summary,
body[data-theme="dark"] .faq-list summary,
body.dark .faq-list summary {
    color:#f8fafc;
}

html[data-theme="dark"] .faq-list p,
body[data-theme="dark"] .faq-list p,
body.dark .faq-list p {
    color:#94a3b8;
}

/* Related tools */
html[data-theme="dark"] .related-grid a,
body[data-theme="dark"] .related-grid a,
body.dark .related-grid a {
    background:#111827;
    border-color:#263449;
    color:#f8fafc;
}

html[data-theme="dark"] .related-grid a:hover,
body[data-theme="dark"] .related-grid a:hover,
body.dark .related-grid a:hover {
    border-color:#60a5fa;
    color:#60a5fa;
}

/* Dark preload used by the OneToolBox theme boot */
html.otb-dark-preload,
html.otb-dark-preload body {
    background:#0b1220;
    color:#e5e7eb;
}

html.otb-dark-preload .compress-card,
html.otb-dark-preload .info-card,
html.otb-dark-preload .feature-mini,
html.otb-dark-preload .faq-list details,
html.otb-dark-preload .related-grid a {
    background:#111827;
    border-color:#263449;
}

html.otb-dark-preload .upload-area,
html.otb-dark-preload .image-preview {
    background:#0f172a;
}

html.otb-dark-preload .content-heading h2,
html.otb-dark-preload .compress-card h3,
html.otb-dark-preload .info-card h3,
html.otb-dark-preload .feature-mini h3,
html.otb-dark-preload .privacy-card h2,
html.otb-dark-preload .faq-list summary {
    color:#f8fafc;
}

html.otb-dark-preload .content-heading p,
html.otb-dark-preload .info-card p,
html.otb-dark-preload .feature-mini p,
html.otb-dark-preload .privacy-card p,
html.otb-dark-preload .faq-list p {
    color:#94a3b8;
}
