*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

body{
    background:#f4f7fb;
    color:#333;
}

header{
    background:#2563eb;
    color:#fff;
    text-align:center;
    padding:8px;
}

header h1{
    font-size:26px;
}

header p{
    margin-top:5px;
    font-size:14px;
}

.container{
    width:92%;
    max-width:520px;
    margin:8px auto;
    padding:8px;
}
.upload-box{
    border:2px dashed #2563eb;
    padding:12px;
    text-align:center;
    border-radius:10px;
    cursor:pointer;
    margin-bottom:8px;
}

.upload-box input{
    margin-bottom:10px;
}

.controls input{
    width:240px;
    max-width:100%;
    padding:10px;
    margin:10px 0;
    border:1px solid #ccc;
    border-radius:8px;
}

button{
    width:70%;
    max-width:500px;
    display:block;
    margin:6px auto;
    padding:9px;
    background:#2563eb;
    color:white;
    border:none;
    border-radius:6px;
    cursor:pointer;
    font-size:14px;
}

button:hover{
    background:#1d4ed8;
}

.preview{
    text-align:center;
    margin-top:8px;
}

.preview img{
    max-width:65%;
    max-height:220px;
    width:auto;
    height:auto;
    object-fit:contain;
    border-radius:10px;
}

#downloadBtn{
    text-decoration:none;
}

footer{
    text-align:center;
    padding:20px;
    color:#666;
}.upload-box{
    border:2px dashed #2563eb;
    border-radius:10px;
    padding:30px;
    text-align:center;
    margin-bottom:20px;
    background:#f8fbff;
}

.upload-box input{
    margin-bottom:15px;
}

.controls{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:20px;
}

.controls input{
    flex:1;
    min-width:120px;
    padding:8px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:14px;
}

.controls button,
#downloadBtn button{
    padding:12px 20px;
    background:#2563eb;
    color:#fff;
    border:none;
    border-radius:8px;
    cursor:pointer;
    font-size:16px;
    transition:.3s;
}

.controls button:hover,
#downloadBtn button:hover{
    background:#1d4ed8;
}

.preview{
    position:relative;
    display:inline-block;
    text-align:center;
    margin:20px 0;
}

.preview img{
    width:180px;
    height:240px;
    object-fit:cover;
    border-radius:10px;
    display:none;
    border:2px solid #444;
    background:#fff;
}
#themeBtn{
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;

    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    width: auto;
    margin: 0;
}
body.dark #themeBtn{
    background: #374151;
    color: #fff;
}

body.dark{
    background:#111827;
    color:#fff;
}

body.dark .container{
    background:#1f2937;
    color:#fff;
}

body.dark .upload-box{
    background:#374151;
    border-color:#60a5fa;
}

body.dark .controls input{
    background:#374151;
    color:#fff;
    border:1px solid #555;
}

body.dark header{
    background:#0f172a;
}.lock-option{
    display:block;
    margin:15px 0;
    font-size:15px;
}

.lock-option input{
    margin-right:8px;

.format-box{
    width:240px;
    margin:15px auto;
}

.format-box select{
    width:100%;
    padding:8px;
    border-radius:8px;
    font-size:14px;
}
.format-box label{
    width:70%;
    max-width:500px;
    margin-bottom:8px;
    font-weight:600;
}
}.quality-box{
    margin:20px 0;
    text-align:center;
}

.quality-box input[type="range"]{
    width:100%;
    margin-top:10px;
}
.image-info{
    width:70%;
    padding:10px;
    margin:10px auto;
    font-size:14px;
    border-radius:10px;
    max-width:500px;
}

body.dark .image-info{
    background:#374151;
}
.upload-box.dragover{
    background:#dbeafe;
    border-color:#1d4ed8;
    transform:scale(1.02);
}

body.dark .upload-box.dragover{
    background:#1e3a8a;
}
@media(max-width:600px){

    header h1{
        font-size:28px;
    }

    .container{
        width:90%;
        padding:8px;
    }

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

    .controls input,
    .controls button{
        width:100%;
    }

    .preview img{
        max-width:100%;
        height:auto;
    }

    .upload-box{
        padding:25px 10px;
    }

}
.loader{
    display:none;
    text-align:center;
    margin:15px;
    font-weight:bold;
    font-size:18px;
}

body.dark .loader{
    color:white;
}



@media(max-width:600px){
    .rotate-controls{
        flex-direction:column;
    }
}
.flip-controls{
    display:flex;
    gap:10px;
    margin-top:4px;
}

.flip-controls button{
    flex:1;
}

@media(max-width:600px){
    .flip-controls{
        flex-direction:column;
    }
}
.tool-buttons{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:center;
}

.tool-buttons button{
    width:auto;
    padding:8px 12px;
    font-size:14px;
    border-radius:6px;
    margin-top:5px;
}
.rotate-controls,
.flip-controls{
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

#downloadBtn{
    display: block;
    width: 100%;
    margin-top: 10px;
}

#downloadBtn button{
    width: 100%;
}
.rotate-controls,
.flip-controls,
.zoom-controls,
#resetBtn,
#applyCropBtn,
#downloadBtn {
    display: none;
}
/* ===== Tools Navigation ===== */

.tools-navbar{
    background:#0b3d91 !important;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 15px;
    border-bottom:2px solid #072c69;
}

.tools-navbar::-webkit-scrollbar{
    display:none;
}

.tools-navbar a{
    background: transparent;
    color: #ffffff;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 0;
}
.tools-navbar a:hover{
    background: transparent;
    color: #ffd54a;
}

.tools-navbar a.active{
    background: transparent;
    color: #ffffff;
    font-weight: bold;
    border-bottom: 2px solid #ffffff;
}
body:not(.dark) .tools-navbar{
    background:#ffffff;
    border-bottom:1px solid #ddd;
}

body:not(.dark) .tools-navbar a{
    background:#f3f4f6;
    color:#111827;
}

body:not(.dark) .tools-navbar a.active{
    background:#2563eb;
    color:#fff;
}
/* Quality + Format Side by Side */

.settings-row{
    display:flex;
    flex-direction:column;
    gap:15px;
    margin:15px 0;
}

.settings-row .quality-box{
    flex:2;
}

.settings-row .format-box{
    width:100%;
}



.settings-row .format-box{
    text-align:left;
}

.settings-row .format-box select,
.settings-row .quality-box input[type="range"]{
    width:100%;
}

@media(max-width:600px){
    .settings-row{
        flex-direction:column;
    }
}
/* ===== Editor Layout ===== */

.editor-layout{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    width:100%;
}
.left-panel{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:center;
    position:relative;
}

.right-panel{
    position:absolute;

    top:10px;
    left:185px;

    display:flex;
    flex-direction:column;
    gap:8px;

    z-index:20;
}

.right-panel button{
    width:42px;
    height:42px;
    margin:0;
    padding:0;
    font-size:18px;
}

.left-panel .preview{
    margin:0;
}

.left-panel .image-info{
    margin-top:15px;
}

/* Mobile Responsive */

@media (max-width:768px){

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

    .right-panel{
        width:100%;
    }

}
.aspect-lock{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    font-size: 15px;
    color: #fff;
}

.aspect-lock input{
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.aspect-lock{
    display:flex;
    align-items:center;
    gap:8px;
    margin:15px 0 10px;
}

.aspect-lock input{
    width:auto;
    margin:0;
}
.size-inputs{
    display:flex;
    gap:12px;
    margin-top:10px;
}

.size-inputs input{
    flex:1;
}
.rotate-controls,
.flip-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    width:100%;
    margin-bottom:12px;
}

.rotate-controls button,
.flip-controls button{
    width:100%;
}

#cropBtn,
#resetBtn{
    width:100%;
    margin-bottom:12px;
}
#resetBtn{
    display:block;
    width:100%;
    margin-top:10px;
}
.resize-box{
    display:flex;
    gap:12px;
    margin-top:15px;
}

.resize-box input{
    flex:1;
    padding:10px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:16px;
}

.lock-label{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:12px;
    font-size:16px;
    font-weight:500;
}
.resize-box{
    display:flex;
    gap:12px;
    margin-top:15px;
}

.resize-box input{
    width:130px;
    padding:8px;
    font-size:14px;
}

.lock-label{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:12px;
    font-size:16px;
    font-weight:500;
}
#resizeControls{
    display: none;
}
.coming-soon{
    text-align:center;
    padding:80px 20px;
    background:#1f2937;
    border-radius:15px;
    color:#fff;
    margin:40px auto;
    max-width:700px;
}

.coming-soon h2{
    font-size:36px;
    margin-bottom:20px;
}

.coming-soon p{
    font-size:20px;
    margin-bottom:20px;
    color:#ddd;
}

.coming-soon h3{
    color:#00bfff;
    font-size:30px;
}
.tool-btn{
    width:52px;
    height:52px;

    border:none;
    border-radius:50%;

    background:#22c55e;
    color:#fff;

    font-size:22px;

    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:0 6px 18px rgba(0,0,0,.25);

    transition:.25s;
}
.tool-btn:hover{
    transform:scale(1.12);
    background:#16a34a;
}


body:not(.dark) .tool-btn{
    background:#f0f0f0;
    color:#222;
}
.format-box select{
    width:150px;
    padding:8px;
}
.preview{
    position: relative;
    display: inline-block;
}
.right-panel{
    display:none;
    position:absolute;
    top:50%;
    left:100%;
    margin-left:10px;
    transform:translateY(-50%);
    flex-direction:column;
    gap:10px;
    z-index:100;
}
#cropBtn{
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;

    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    flex-shrink: 0;
}
#applyCropBtn{
    margin-top: 10px;
    border-radius: 10px;
}
@media (max-width: 768px) {

    .preview{
        position: relative;
    }

    .right-panel{
        position: absolute;
        top: 135px;
        right: 1px;   /* image ke right side */
        left: 150;
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 1000;
    }

    .tool-btn{
        width: 40px;
        height: 40px;
        border-radius: 45%;
    }

}
/* ===== Footer ===== */

footer{
    margin-top:50px;
    padding:25px 15px;
    text-align:center;
    background:#111827;
    border-top:1px solid rgba(255,255,255,.08);
}

.footer-links{
    display:flex;
    justify-content:center;
    align-items:center;
    flex-wrap:wrap;
    gap:18px;
    margin-bottom:15px;
}

.footer-links a{
    color:#22c55e;
    text-decoration:none;
    font-size:15px;
    font-weight:600;
    transition:.3s;
}

.footer-links a:hover{
    color:#38ef7d;
    text-decoration:underline;
}

footer p{
    color:#bdbdbd;
    font-size:14px;
    margin:0;
}
/* ===== Mobile Footer ===== */

@media (max-width:768px){

.footer-links{

    flex-direction:column;

    gap:10px;

}

.footer-links a{

    display:block;

    width:100%;

    text-align:center;

}

footer{

    padding:20px 10px;

}

}
/* =========================
   Image Editing Guides
========================= */

.guides-section{
    margin:60px auto;
    padding:20px;
    max-width:1200px;
}

.guides-section h2{
    text-align:center;
    font-size:2rem;
    margin-bottom:10px;
    color:#455b9a;
}

.guides-intro{
    text-align:center;
    color:#494dda;
    margin-bottom:35px;
    line-height:1.7;
}

.guides-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
    gap:20px;
}

.guide-card{
    background:#1b1f2b;
    border:1px solid #2d3748;
    border-radius:14px;
    padding:22px;
    transition:.3s;
}

.guide-card:hover{
    transform:translateY(-5px);
    border-color:#3b82f6;
    box-shadow:0 10px 25px rgba(0,0,0,.25);
}

.guide-card h3{
    color:#ffffff;
    margin-bottom:12px;
}

.guide-card p{
    color:#cbd5e1;
    line-height:1.8;
    margin-bottom:18px;
}

.guide-card a{
    color:#60a5fa;
    text-decoration:none;
    font-weight:600;
}

.guide-card a:hover{
    text-decoration:underline;
}
/* ===========================
   Guide Page Design
=========================== */

.guide-header{
    max-width:1100px;
    margin:50px auto;
    padding:40px 20px;
    text-align:center;
}

.guide-header h1{
    font-size:2.5rem;
    color:#ffffff;
    margin-bottom:15px;
}

.guide-header p{
    max-width:800px;
    margin:auto;
    color:#cbd5e1;
    line-height:1.8;
    font-size:1.05rem;
}

.btn-primary{
    display:inline-block;
    margin-top:25px;
    padding:14px 28px;
    background:#2563eb;
    color:#ffffff;
    text-decoration:none;
    border-radius:10px;
    font-weight:600;
    transition:.3s;
}

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

.guide-content{
    max-width:1000px;
    margin:auto;
    padding:20px;
}

.guide-content section{
    background:#1b1f2b;
    padding:28px;
    border-radius:14px;
    margin-bottom:30px;
    border:1px solid #2d3748;
}

.guide-content h2{
    color:#ffffff;
    margin-bottom:18px;
}

.guide-content h3{
    color:#f8fafc;
    margin-top:20px;
}

.guide-content p,
.guide-content li{
    color:#cbd5e1;
    line-height:1.9;
}

.guide-content ul,
.guide-content ol{
    padding-left:22px;
}

.guide-content a{
    color:#60a5fa;
    text-decoration:none;
}

.guide-content a:hover{
    text-decoration:underline;
}

@media(max-width:768px){

.guide-header h1{
    font-size:2rem;
}

.guide-content section{
    padding:20px;
}

}

/* ===== Compress Tool Mobile Responsive ===== */

@media (max-width:768px){

.container{
    width:95%;
    margin:auto;
    padding:15px;
}

.preview-box,
.upload-box{
    width:100%;
}

#previewImage{
    max-width:100%;
    height:auto;
}

.settings-panel{
    display:flex;
    flex-direction:column;
    gap:15px;
}

.quality-box,
.format-box{
    width:100%;
}

#compressBtn,
#downloadImageBtn,
button{
    width:100%;
    padding:12px;
    font-size:16px;
}

input[type="range"]{
    width:100%;
}

}
.logo-area{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:15px;
}

.site-logo{
    width:90px;
    height:90px;
    object-fit:contain;
    margin:0;
}
/* Target File Size */

.option-divider{
    margin:18px 0;
    border:none;
    border-top:1px solid #d1d5db;
}

.target-size-box{
    width:340px;
    margin:15px auto;
}

.target-size-input{
    display:flex;
    gap:8px;
    max-width:500px;
    margin:0 auto;
}

.target-size-box label{
    display:block;
    font-weight:600;
    margin-bottom:8px;
}

.target-size-input{
    display:flex;
    gap:10px;
}

.target-size-input input{
    flex:1;
    width:100%;
    padding:10px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:15px;
}

.target-size-input select{
    width:80px;
    padding:10px;
    border:1px solid #ccc;
    border-radius:8px;
    font-size:15px;
}
.tools-navbar{
    display:flex;
    align-items:center;
    gap:10px;
}

.toolbar-logo{
    width:40px;
    height:40px;
    object-fit:contain;
    margin-right:10px;
}
.tools-navbar{
    display:flex;
    align-items:center;
    gap:10px;
}

.brand{
    display:flex;
    align-items:center;
    margin-right:20px;
    flex-shrink:0;
}

.toolbar-logo{
    width:38px;
    height:38px;
    object-fit:contain;
    margin-right:8px;
}

.brand-name{
    color:#ed590f;
    font-size:20px;
    font-weight:700;
}
/* Light Mode Toolbar */
body:not(.dark) .tools-navbar{
    background:#0b3d91 !important;
}

/* Light Mode Tool Buttons */
body:not(.dark) .tools-navbar a{
    background:transparent !important;
    color:#ffffff !important;
}

body:not(.dark) .tools-navbar a:hover{
    background:rgba(255,255,255,0.15) !important;
}

body:not(.dark) .tools-navbar a.active{
    background:#2563eb !important;
    color:#ffffff !important;
}
.controls{
    display:flex;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
}
.resize-box{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:10px;
    margin:10px auto;
}

.resize-box input{
    width:180px;
    height:40px;
}

.resize-cross{
    font-size:22px;
    font-weight:bold;
}
/* Width & Height Box */
.resize-box{
    display:flex;
    justify-content:center;
    gap:10px;
}

.resize-box input{
    width:150px !important;
    flex:none !important;
}

/* Download Format Box */
.format-box{
    width:150px !important;
    margin:15px auto !important;
}

.format-box select{
    width:150px !important;
}

/* Target Size Box */
.target-size-box{
    width:260px !important;
}

/* ===== Mobile Responsive Fix ===== */
@media (max-width:768px){

    .tools-navbar{
        overflow-x:auto;
        white-space:nowrap;
    }

    .editor-layout{
        flex-direction:column;
        align-items:center;
    }

    .preview img{
        width:170px;
        height:auto;
    }

    .right-panel{
    position:absolute;
    top:50%;
    left:100%;
    right:auto;
    transform:translateY(-50%);
    margin-left:8px;

    display:flex;
    flex-direction:column;
    gap:8px;
    z-index:1000;
}

    .resize-box{
        flex-direction:row;
        justify-content:center;
        gap:8px;
    }

    .resize-box input{
        width:120px !important;
    }

    .image-info{
        width:95%;
    }

    .target-size-box,
    .format-box{
        width:95% !important;
    }

    .target-size-input{
        display:flex;
        gap:8px;
    }

    .target-size-input input{
        flex:1;
    }

    .format-box select{
        width:100% !important;
    }

    #resizeBtn,
    #downloadBtn button{
        width:95%;
    }
}