/* GOVT EXAM TOOLS - FULL PREMIUM DETAILED STYLE */
:root {
    --primary: #008080;
    --primary-hover: #006666;
    --primary-light: #e6f2f2;
    --accent: #ffd700; /* Home & Study Accent Color */
    --accent-hover: #e6c200;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --white: #ffffff;
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 1. Global Page Reset & Performance */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    background-color: #f0f4f8;
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

/* 2. NAVBAR: ONE-LINE LAYOUT (MOBILE & DESKTOP) */
.tools-navbar {
    background: var(--primary);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap; /* Mobile par bhi ek hi line mein rahega */
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
}

/* Logo & Emoji Alignment */
.nav-brand {
    flex-shrink: 0;
    margin-right: 20px;
}

.nav-brand a {
    position: relative;
    color: var(--white);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    display: inline-block;
    padding-top: 8px; /* Space for emoji */
    letter-spacing: -0.5px;
}

.nav-brand span {
    color: var(--accent);
}

/* Emoji fixed exactly above 'G' */
.brand-emoji {
    position: absolute;
    top: -6px;
    left: 2px;
    font-size: 14px !important;
    color: var(--accent);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Nav Links Scroll Area */
.nav-links {
    list-style: none;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    margin: 0;
    padding: 5px 0;
    gap: 12px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links li {
    flex: 0 0 auto;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

/* HOME BUTTON: Study Color Accent */
.home-btn a {
    background: var(--accent) !important;
    color: #000 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.home-btn a:hover {
    background: var(--white) !important;
    transform: translateY(-2px);
}

/* Right Margin Fix for Mobile Scroll */
.nav-links li:last-child {
    padding-right: 50px !important; /* Home button doesn't stick to edge */
}

/* 3. PREMIUM CARDS SECTION */
.container {
    max-width: 1100px;
    margin: -40px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.tool-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 25px;
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(237, 242, 247, 1);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary);
}

.badge {
    background: var(--accent);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 24px; /* Squircle look */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
}

.tool-card:hover .icon-wrapper {
    background: var(--primary);
    color: var(--white);
    transform: rotate(10deg);
}

.tool-card h3 {
    font-size: 20px;
    margin: 10px 0;
    font-weight: 800;
    color: var(--text-dark);
}

.tool-card p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* 4. RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .nav-brand a { font-size: 18px; }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .tool-card {
        padding: 25px 15px;
        border-radius: 16px;
    }
    
    .tool-card h3 { font-size: 15px; }
    .tool-card p { display: none; } /* Mobile par clean look */
    
    .icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin-bottom: 15px;
        border-radius: 18px;
    }
}

@media (max-width: 400px) {
    .nav-brand { margin-right: 10px; }
    .nav-brand a { font-size: 16px; }
}

/* Age Calculator Specific Premium Styling */
.tool-container-premium {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-heavy);
}

/* ===== TOOL HEADER : ICON LEFT, TEXT RIGHT, DESC BELOW ===== */
.tool-header {
    text-align: center;
    margin-bottom: 25px;
}

.tool-header h1 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 800;
    margin: 0;
}

.tool-header h1 svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

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


.calculator-card {
    background: #f8fafc;
    padding: 25px;
    border-radius: 18px;
    margin: 30px 0;
    border: 1px solid #e2e8f0;
}

.date-section label {
    display: block;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.custom-select-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.custom-select-group select {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid #cbd5e0;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

.calculate-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.calculate-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 128, 128, 0.2);
}

/* Result Box Styling */
.result-box-premium {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.main-result {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
}

.res-unit span {
    display: block;
    font-size: 36px;
    font-weight: 900;
    color: var(--primary);
}

.res-unit p {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.total-days-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
}

.notice-card-premium {
    background: #fff8e1;
    border-left: 5px solid var(--accent);
    padding: 15px;
    border-radius: 8px;
    text-align: left;
}

@media (max-width: 600px) {
    .tool-container-premium { padding: 20px; }
    .custom-select-group { flex-direction: column; }
    .res-unit span { font-size: 28px; }
}


/* =============================================
   PHOTO RESIZER SPECIFIC (MATCHING YOUR LOGIC)
   ============================================= */

.tool-wrapper {
    max-width: 750px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: 'Poppins', sans-serif;
}

.tool-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

/* Header & Icons */
.tool-container h1 {
    color: var(--primary);
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
    font-size: 24px;
}

.tool-container h1 i {
    margin-right: 10px;
}

/* Upload Section */
.upload-section {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

/* Mode Box (Logic matching) */
.mode-box .mode-option {
    background: #f8fafc;
    border: 1px solid #cbd5e0;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Input Grid matching your 1fr 1fr */
.field-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.field-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    box-sizing: border-box; /* Padding fixes */
}

.field-group input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Buttons */
.btn-preset {
    background: #fff;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
}

.btn-preset:hover {
    background: var(--primary);
    color: #fff;
}

.btn-process {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 128, 128, 0.2);
    transition: 0.3s;
}

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

/* Final Result Text */
#sizeInfo {
    color: var(--primary);
    font-size: 18px;
    background: var(--primary-light);
    padding: 10px;
    border-radius: 8px;
    margin-top: 20px;
}

.notice-card {
    background: #fff8e1;
    border-left: 5px solid var(--accent);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 14px;
}

/* Mobile responsive override */
@media (max-width: 600px) {
    .input-grid {
        grid-template-columns: 1fr !important; /* Mobile par width height upar niche */
    }
}

/* =============================================
   IMAGE TO PDF - MOBILE FRIENDLY PREMIUM
   ============================================= */

/* Container Adjustment */
.tool-wrapper {
    max-width: 700px;
    margin: 20px auto;
    padding: 0 15px; /* Mobile side spacing */
}

/* Drop Zone Responsive */
.drop-zone-custom {
    border: 2px dashed var(--primary);
    padding: 30px 15px;
    border-radius: 15px;
    text-align: center;
    background: var(--primary-light);
    cursor: pointer;
    transition: 0.3s;
}

.drop-zone-custom i {
    font-size: 2.5rem; /* Mobile par icon thoda chhota */
    color: var(--primary);
}

.drop-zone-text {
    display: block;
    font-weight: 700;
    margin-top: 10px;
    font-size: 16px;
}

/* Image Preview Grid (Very Important for Mobile) */
#preview-container {
    display: grid;
    /* Mobile par 3 column, Tablet/PC par automatic zyada */
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); 
    gap: 10px;
    margin: 20px 0;
}

.preview-item {
    position: relative;
    border-radius: 10px;
    overflow: visible; /* Delete button dikhne ke liye */
    border: 1px solid #ddd;
}

.preview-item img {
    width: 100%;
    height: 90px; /* Fixed height for uniform look */
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Floating Remove Button */
.remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
}

/* Button & Info Styles */
.calculate-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
}

.security-info {
    font-size: 12px;
    text-align: center;
    margin-top: 15px;
    color: var(--text-muted);
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 480px) {
    .tool-container-premium {
        padding: 20px 15px; /* Kam padding mobile par */
    }
    
    .tool-header h1 {
        font-size: 20px; /* Chhota font size */
    }

    #preview-container {
        grid-template-columns: repeat(3, 1fr); /* Chhote mobile par pakka 3 images ek line mein */
    }
}


/* PNG/JPG to webp converter css */


.tool-main-wrapper {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    background: #f4f7f6;
}
.tool-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
    text-align: center;
}
.drop-zone {
    height: 150px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border: 2px dashed #007bff;
    border-radius: 10px;
    margin: 20px 0;
    transition: 0.3s;
}
.drop-zone--over { border-style: solid; background: #e7f3ff; }
.drop-zone__input { display: none; }
.convert-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
}
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* ===== SVG ICON FIX FOR TOOLS ===== */
.tool-header h1,
.tool-header p,
.date-section label,
.notice-card-premium strong,
.calculate-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-header svg,
.date-section label svg,
.calculate-btn svg,
.notice-card-premium svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Icon wrapper center */
.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* UNIVERSAL HOW TO USE SECTION */
.how-to-use-section {
    margin-top: 30px;
    background: var(--white);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-soft);
}

.how-to-use-section h2 {
    color: var(--primary);
    font-size: 22px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.how-to-use-section h2 svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.step-row {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.step-num {
    background: var(--primary);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 128, 128, 0.2);
}

.step-content b {
    display: block;
    color: var(--text-dark);
    font-size: 16px;
    margin-bottom: 4px;
}

.step-content p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.tip-box {
    background: #fff8e1;
    padding: 15px 20px;
    border-radius: 12px;
    border-left: 5px solid var(--accent);
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
    font-size: 14px;
}

.tip-box strong {
    color: #b8860b;
}


/* =============================================
   CROPPER JS CUSTOM THEME (Matching Your Colors)
   ============================================= */

/* 1. Selection Box ka Border aur Handles tere Primary Color mein */
.cropper-line, .cropper-point {
    background-color: var(--primary) !important;
}

/* 2. Charo corners ke bade points */
.cropper-point.point-se, 
.cropper-point.point-sw, 
.cropper-point.point-nw, 
.cropper-point.point-ne {
    width: 8px !important;
    height: 8px !important;
    background-color: var(--primary) !important;
    border-radius: 50%; /* Circle look */
}

/* 3. Center Crosshair */
.cropper-center:before, .cropper-center:after {
    background-color: var(--primary) !important;
}

/* 4. Background Overlay (Darkness control) */
.cropper-modal {
    opacity: 0.7 !important;
    background-color: #000 !important;
}

/* 5. Cropping Area Container (Tere Wrapper ke liye) */
.crop-container {
    max-width: 100%;
    height: 400px; /* Desktop height */
    margin: 20px 0;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    background: #f1f5f9;
    overflow: hidden;
    display: none; /* JS se show hoga */
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

/* Mobile responsive crop height */
@media (max-width: 768px) {
    .crop-container {
        height: 300px;
    }
}

