/* ==========================================
   OneToolBox Crop Image Tool - Fixed
   Compact / Responsive / Full Controls
========================================== */

.crop-box{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    margin-top:18px;
    align-items:start;
}

.crop-card{
    min-width:0;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:16px;
    box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.crop-card:hover{
    box-shadow:0 9px 22px rgba(0,0,0,.08);
}

.crop-card h3{
    font-size:18px;
    line-height:1.3;
    margin:0 0 14px;
    font-weight:700;
    color:#0f172a;
}

.crop-card label{
    display:block;
    margin:12px 0 6px;
    font-size:13px;
    font-weight:700;
    color:#334155;
}

/* Upload */
.upload-area{
    border:2px dashed #d7d7d7;
    border-radius:13px;
    padding:16px;
    min-height:270px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    text-align:center;
    cursor:pointer;
    position:relative;
    transition:.2s ease;
}

.upload-area:hover,
.upload-area.dragging{
    border-color:#2563eb;
    background:#f8fbff;
}

#uploadIcon{
    font-size:42px;
    color:#2563eb;
    margin-bottom:10px;
}

.upload-area h4{
    margin:4px 0 6px;
    font-size:16px;
}

.upload-area p{
    margin:0;
    color:#64748b;
    font-size:13px;
    line-height:1.5;
}

.crop-preview{
    display:none;
    width:100%;
    max-height:220px;
    object-fit:contain;
    border-radius:10px;
    margin-bottom:10px;
}

.choose-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    height:42px;
    margin-top:12px;
    border-radius:9px;
    background:#2563eb;
    color:#fff;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    position:relative;
    overflow:hidden;
}

.choose-btn:hover{background:#1d4ed8;}

.choose-btn input{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    opacity:0;
    cursor:pointer;
}

.btn-reset{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    width:100%;
    height:38px;
    margin-top:9px;
    border:0;
    border-radius:9px;
    background:#fee2e2;
    color:#dc2626;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
}

.btn-reset:hover{background:#fecaca;}

/* Info */
.info{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-top:8px;
    padding:8px 10px;
    border-radius:9px;
    background:#f8fafc;
    font-size:12px;
}

.info span{color:#64748b;}
.info b{
    color:#0f172a;
    text-align:right;
    word-break:break-word;
}

/* Aspect ratio */
.ratio-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:6px;
    margin-bottom:10px;
}

.ratio-btn{
    height:34px;
    padding:0 5px;
    border:1px solid #dbe1e8;
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}

.ratio-btn:hover{border-color:#2563eb;background:#eff6ff;}
.ratio-btn.active{background:#2563eb;color:#fff;border-color:#2563eb;}

/* Transform buttons */
.tool-buttons,
.zoom-buttons{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin-bottom:8px;
}

.tool-btn{
    min-width:0;
    height:36px;
    padding:0 6px;
    border:1px solid #e2e8f0;
    border-radius:8px;
    background:#f8fafc;
    color:#334155;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:5px;
}

.tool-btn:hover,
.tool-btn.active{background:#2563eb;color:#fff;border-color:#2563eb;}

/* Ranges - explicit styling so global CSS cannot hide them */
.range-row{
    display:flex;
    align-items:center;
    gap:8px;
}

.full-range,
.range-row input[type="range"]{
    display:block !important;
    width:100% !important;
    height:20px !important;
    margin:0 !important;
    padding:0 !important;
    opacity:1 !important;
    visibility:visible !important;
    appearance:auto !important;
    -webkit-appearance:auto !important;
    accent-color:#2563eb !important;
    cursor:pointer !important;
}

#rotationRange,
#zoomRange,
#qualityRange{
    min-width:0;
}

#rotationValue,
#qualityValue{
    float:right;
    color:#2563eb;
    font-weight:800;
}

.small-btn{
    flex:0 0 auto;
    height:34px;
    padding:0 9px;
    border:1px solid #dbe1e8;
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}

.small-btn:hover{background:#f1f5f9;}

/* Output */
.output-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}

.output-grid select{
    width:100%;
    height:38px;
    padding:0 9px;
    border:1px solid #dbe1e8;
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-size:13px;
    outline:none;
}

.background-options{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:6px;
}

.background-btn{
    height:34px;
    border:1px solid #dbe1e8;
    border-radius:8px;
    background:#fff;
    color:#334155;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
}

.background-btn:hover{border-color:#2563eb;}
.background-btn.active{background:#2563eb;color:#fff;border-color:#2563eb;}

.tool-actions{
    display:grid;
    grid-template-columns:1fr 1.35fr;
    gap:8px;
    margin-top:10px;
}

.btn-primary,
.btn-secondary{
    width:100%;
    height:42px;
    margin:0;
    border-radius:9px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    font-size:13px;
    font-weight:800;
    cursor:pointer;
}

.btn-primary{border:0;background:#16a34a;color:#fff;}
.btn-primary:hover{background:#15803d;}
.btn-primary:disabled{opacity:.6;cursor:wait;}

.btn-secondary{border:1px solid #cbd5e1;background:#f8fafc;color:#334155;}
.btn-secondary:hover{background:#e2e8f0;}

/* Result */
.result-preview{
    height:270px;
    border:2px dashed #dbe1e8;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fafafa;
    overflow:hidden;
    margin-bottom:12px;
}

#resultImage{
    display:none;
    max-width:100%;
    max-height:100%;
    object-fit:contain;
}

#resultText{
    color:#94a3b8;
    font-size:13px;
    text-align:center;
    padding:15px;
}

.btn-success{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    width:100%;
    height:42px;
    margin-top:12px;
    border-radius:9px;
    background:#0891b2;
    color:#fff;
    text-decoration:none;
    font-size:13px;
    font-weight:800;
}

.btn-success:hover{background:#0e7490;}

.disabled{pointer-events:none;opacity:.45;}

/* Standard content */
.content-section{padding:34px 0;}
.compact-section{padding-top:18px;}
.content-heading{text-align:center;margin-bottom:20px;}
.content-heading h2{margin:0 0 7px;font-size:26px;color:#0f172a;}
.content-heading p{max-width:760px;margin:0 auto;color:#64748b;line-height:1.6;}
.steps-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;}
.info-card{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:18px;box-shadow:0 5px 16px rgba(0,0,0,.05);}
.step-number{width:34px;height:34px;border-radius:50%;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;margin-bottom:10px;}
.info-card h3{margin:0 0 6px;font-size:17px;}.info-card p{margin:0;color:#64748b;line-height:1.55;font-size:14px;}
.feature-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;}
.feature-mini{display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid #e5e7eb;border-radius:13px;padding:15px;}
.feature-mini>i{font-size:20px;color:#2563eb;margin-top:2px;}.feature-mini h3{margin:0 0 4px;font-size:16px;}.feature-mini p{margin:0;color:#64748b;line-height:1.5;font-size:14px;}
.privacy-card{display:flex;gap:15px;align-items:flex-start;padding:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:15px;}.privacy-icon{width:44px;height:44px;flex:0 0 44px;display:flex;align-items:center;justify-content:center;border-radius:11px;background:#dcfce7;color:#15803d;}
.privacy-card h2{margin:0 0 6px;font-size:20px;}.privacy-card p{margin:0 0 7px;color:#64748b;line-height:1.55;font-size:14px;}.privacy-card p:last-child{margin-bottom:0;}
.faq-list{max-width:850px;margin:0 auto;}.faq-list details{background:#fff;border:1px solid #e5e7eb;border-radius:10px;padding:0 15px;margin-bottom:8px;}.faq-list summary{cursor:pointer;padding:13px 0;font-weight:700;color:#0f172a;font-size:14px;}.faq-list details p{margin:0;padding:0 0 13px;color:#64748b;line-height:1.55;font-size:14px;}
.related-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;}.related-grid a{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border:1px solid #e5e7eb;border-radius:10px;background:#fff;color:#334155;text-decoration:none;font-size:13px;font-weight:700;}.related-grid a:hover{border-color:#2563eb;color:#2563eb;}
.ad-section{padding-top:8px;}.ad-box{min-height:70px;border:1px dashed #cbd5e1;border-radius:12px;display:flex;align-items:center;justify-content:center;color:#94a3b8;background:#f8fafc;font-size:12px;}

@media(max-width:1100px){
    .crop-box{grid-template-columns:1fr;}
    .upload-area{min-height:240px;}
    .result-preview{height:260px;}
}

@media(max-width:600px){
    .crop-card{padding:14px;}
    .ratio-grid{grid-template-columns:repeat(3,1fr);}
    .tool-buttons,.zoom-buttons{grid-template-columns:repeat(2,1fr);}
    .output-grid{grid-template-columns:1fr;}
    .tool-actions{grid-template-columns:1fr;}
    .feature-grid,.steps-grid{grid-template-columns:1fr;}
    .related-grid{grid-template-columns:repeat(2,1fr);}
    .privacy-card{flex-direction:column;}
}


/* =========================================================
   FINAL UI FIX — Choose Button / Aspect Ratio Dropdown /
   Equal Height Tool Cards
========================================================= */

/* All three main cards share the same row height */
.crop-box{
    align-items:stretch !important;
}

.crop-box > .crop-card{
    height:100%;
    min-height:0;
    box-sizing:border-box;
}

/* Keep the middle settings card balanced with both side cards */
.crop-box > .crop-card:nth-child(2){
    display:flex;
    flex-direction:column;
}

/* Choose Image button — reliable clickable area */
.choose-btn{
    box-sizing:border-box;
    min-height:46px;
    height:46px;
    padding:0 14px;
    margin-top:14px;
    border:0;
    border-radius:10px;
    position:relative;
    z-index:2;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    background:#2563eb;
    color:#fff;
    box-shadow:0 5px 14px rgba(37,99,235,.16);
}

.choose-btn:hover{
    background:#1d4ed8;
    transform:translateY(-1px);
}

.choose-btn input[type="file"]{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    margin:0;
    padding:0;
    opacity:0;
    cursor:pointer;
    z-index:3;
}

.choose-btn span,
.choose-btn i{
    pointer-events:none;
    position:relative;
    z-index:1;
}

/* Aspect Ratio dropdown */
.select-wrap{
    position:relative;
    width:100%;
}

.aspect-select{
    appearance:none;
    -webkit-appearance:none;
    width:100%;
    height:46px;
    padding:0 44px 0 13px;
    border:1px solid #dbe1e8;
    border-radius:10px;
    outline:none;
    background:#fff;
    color:#0f172a;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
    transition:.2s ease;
}

.aspect-select:hover{
    border-color:#93c5fd;
    background:#f8fbff;
}

.aspect-select:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

.select-arrow{
    position:absolute;
    right:15px;
    top:50%;
    transform:translateY(-50%);
    color:#2563eb;
    font-size:13px;
    pointer-events:none;
}

body.dark .aspect-select{
    background:#0f172a;
    border-color:#334155;
    color:#f8fafc;
}

body.dark .aspect-select:hover{
    background:#111f38;
    border-color:#60a5fa;
}

body.dark .select-arrow{
    color:#60a5fa;
}

@media(max-width:1100px){
    .crop-box{
        align-items:stretch !important;
    }
}

@media(max-width:600px){
    .crop-box > .crop-card{
        height:auto;
    }
}
