@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =========================================
   ImageFix Hub - PREMIUM SAAS THEME
   (Optimized for AdSense: Inter Font & Fast Speed)
========================================= */

/* 1. PREMIUM VARIABLES */
:root {
    --bg-main: #f8fafc;        /* Soft modern background */
    --bg-surface: #ffffff;     /* Pure white for cards */
    --text-primary: #0f172a;   /* Deep slate for headings (High Contrast) */
    --text-secondary: #333333; /* Dark grey for paragraphs (Best for AdSense) */
    --border: #e2e8f0;         /* Clean light border */
    --accent: #4f46e5;         /* Premium Indigo */
    --accent-hover: #4338ca;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

html.dark-mode {
    --bg-main: #0f172a;        /* Deep premium slate */
    --bg-surface: #1e293b;     /* Elevated dark surface */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --border: #334155;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    /* PURE INTER FONT FOR MAXIMUM SPEED & READABILITY */
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

main { flex: 1; padding-bottom: 80px; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 20px; }

/* =========================================
   2. TYPOGRAPHY (Perfect AdSense Readability)
========================================= */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

p, li, .desc, label {
    color: var(--text-secondary);
    font-weight: 400; /* Normal weight for easy reading */
    line-height: 1.7; /* Perfect gap between lines */
    font-size: 16px;
}

/* Beautiful Accent Spans */
h1 span, h2 span {
    color: var(--accent);
}

/* Premium Top Labels */
.top-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', Arial, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
html.dark-mode .top-label { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.3); }

/* =========================================
   3. HEADER & FOOTER
========================================= */
.master-header { 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    transition: 0.3s;
}
html.dark-mode .master-header { background: rgba(15, 23, 42, 0.9); }

.master-footer { 
    background: var(--bg-surface); 
    border-top: 1px solid var(--border); 
    padding: 60px 20px 24px; 
    margin-top: auto; 
    transition: 0.3s;
}

.nav-container { max-width: 1200px; margin: 0 auto; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; }
.search-input-wrapper { background: var(--bg-main); border: 1px solid var(--border); border-radius: 50px; padding: 10px 20px; display: flex; align-items: center; gap: 12px; transition: 0.3s; }
.search-input-wrapper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

/* =========================================
   4. HOMEPAGE GRID (Beautiful Bento Cards)
========================================= */
.hero-section { text-align: center; padding: 80px 20px 50px; }
.hero-section h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 20px; }
.hero-section p { font-size: 18px; max-width: 600px; margin: 0 auto; }

.bento-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 24px; 
    margin-bottom: 40px; 
}

.bento-card { 
    background: var(--bg-surface); 
    border: 1px solid var(--border); 
    border-radius: 20px; 
    padding: 32px; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    text-decoration: none; 
    cursor: pointer; 
    min-height: 220px; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
}

.bento-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--hover-shadow); 
    border-color: var(--accent);
}

.card-icon { 
    width: 54px; 
    height: 54px; 
    border-radius: 14px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 24px; 
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent);
    transition: 0.3s; 
}
.bento-card:hover .card-icon { transform: scale(1.1); }

.bento-card h3 { font-size: 20px; margin-bottom: 10px; color: var(--text-primary); }
.bento-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

.bento-grid.searching { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bento-grid.searching .bento-card { grid-column: span 1 !important; grid-row: span 1 !important; }
.no-results-msg { text-align: center; padding: 40px; font-size: 18px; color: var(--text-secondary); }

/* =========================================
   5. SEO ARTICLE TYPOGRAPHY (Exactly like Legal Pages + Arial Font)
========================================= */
.seo-article, .honest-seo-article { 
    background: transparent; 
    border: none;            
    box-shadow: none;        
    padding: 20px 0px;       
    margin-top: 30px; 
    max-width: 1200px;       
    margin-left: auto;
    margin-right: auto;
    text-align: left;        
    font-family: Arial, Helvetica, sans-serif !important; /* Yahan Arial Font lagaya gaya hai */
}

.seo-article h2, .honest-seo-article h2 { 
    font-size: 28px; 
    margin-top: 40px; 
    margin-bottom: 20px; 
    color: var(--text-primary); 
}

.seo-article h3, .honest-seo-article h3 { 
    font-size: 22px; 
    margin-top: 30px; 
    margin-bottom: 15px; 
    color: var(--text-primary); 
}

.seo-article p, .honest-seo-article p { 
    font-size: 16px; 
    margin-bottom: 20px; 
    color: var(--text-secondary); 
    line-height: 1.8; 
}

.seo-article ul, .honest-seo-article ul { 
    margin-top: 10px; 
    margin-bottom: 25px; 
    padding-left: 20px; 
    color: var(--text-secondary); 
    line-height: 1.8;
}

.seo-article li, .honest-seo-article li { 
    font-size: 16px; 
    margin-bottom: 12px; 
}

/* =========================================
   6. TOOL UI DESIGN
========================================= */
.settings-panel, .tool-box, .result-section { 
    width: 100%; 
    max-width: 800px; 
    margin: 0 auto 30px; 
    background: var(--bg-surface); 
    border-radius: 24px; 
    padding: 40px 30px; 
    border: 1px solid var(--border); 
    text-align: center;
    box-shadow: var(--card-shadow);
}
@media (min-width: 768px) { .tool-box { padding: 50px 40px; } }

.tool-box h1 { font-size: clamp(26px, 4vw, 32px); margin-bottom: 12px; font-weight: 800; }
.tool-subtitle { font-size: 15px; margin-bottom: 30px; color: var(--text-secondary); }

.upload-area, .upload-box { 
    width: 100%; 
    border: 2px dashed #94a3b8; 
    background: var(--bg-main); 
    padding: 50px 20px; 
    border-radius: 16px; 
    cursor: pointer; 
    margin-bottom: 20px; 
    text-align: center; 
    transition: all 0.3s; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
}
.upload-area:hover, .upload-box:hover { border-color: var(--accent); background: rgba(79, 70, 229, 0.05); transform: translateY(-2px); }
html.dark-mode .upload-area:hover, html.dark-mode .upload-box:hover { background: rgba(99, 102, 241, 0.1); }

.upload-icon { font-size: 40px; margin-bottom: 15px; color: var(--accent); }

/* PREMIUM BUTTONS */
.primary-btn, .select-btn { 
    width: 100%; 
    max-width: 350px; 
    margin: 10px auto; 
    background-color: var(--accent); 
    color: #ffffff !important; 
    padding: 16px 24px; 
    border: none; 
    border-radius: 12px; 
    font-size: 16px; 
    font-family: 'Inter', Arial, sans-serif;
    font-weight: 700; 
    cursor: pointer; 
    display: flex; justify-content: center; align-items: center; gap: 8px;
    transition: all 0.2s ease; 
    text-decoration: none; 
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}
.primary-btn:hover, .select-btn:hover { background-color: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35); }
.success-btn { background-color: #10b981; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25); }
.success-btn:hover { background-color: #059669; }

/* Settings Inputs */
.target-box { background: var(--bg-main); border: 1px solid var(--border); border-radius: 16px; padding: 25px; text-align: center; margin-bottom: 30px; }
.kb-input-wrap { display: inline-flex; align-items: center; background: var(--bg-surface); border: 2px solid var(--border); border-radius: 10px; overflow: hidden; transition: 0.3s; }
.kb-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.kb-input-wrap input { width: 120px; padding: 12px 15px; font-size: 22px; font-weight: 700; border: none; outline: none; text-align: center; color: var(--text-primary); background: transparent; }
.kb-input-wrap span { padding: 12px 20px; background: var(--bg-main); border-left: 1px solid var(--border); color: var(--text-secondary); font-weight: 600; }

.input-group label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.input-group input, .input-group select { width: 100%; padding: 14px; font-size: 15px; border: 1px solid var(--border); border-radius: 10px; outline: none; background: var(--bg-surface); color: var(--text-primary); transition: 0.2s; }
.input-group input:focus, .input-group select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }

/* =========================================
   7. MOBILE RESPONSIVE OPTIMIZATIONS
========================================= */
@media (max-width: 768px) {
    .container, .page-wrapper { padding: 20px 15px; }
    
    .nav-toggle { display: block !important; }
    .desktop-only { display: none !important; } 
    .mobile-only { display: flex !important; }
    
    .nav-menu { 
        display: flex !important; 
        flex-direction: column; 
        position: fixed; 
        top: 60px; 
        right: -100%; 
        width: 280px; 
        height: calc(100vh - 60px);
        background: var(--bg-surface); 
        padding: 20px 0; 
        border-left: 1px solid var(--border);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1999;
        overflow-y: auto;
        align-items: flex-start !important;
        gap: 0 !important;
    }
    
    .nav-menu.active { right: 0; }
    .nav-menu > a.nav-link { width: 100%; padding: 12px 24px !important; font-size: 16px !important; border-bottom: none !important; justify-content: flex-start; }
    .theme-toggle { display: block !important; margin: 20px 24px !important; align-self: flex-start; } 

    .hero-section { padding: 40px 15px 30px; }
    .hero-section h1 { font-size: 32px; }
    
    .seo-article, .honest-seo-article { padding: 30px 20px; margin-top: 30px; border-radius: 20px; }

    .tool-box, .settings-panel, .result-section { padding: 30px 20px; border-radius: 20px; margin-bottom: 30px; }
    
    .upload-area, .upload-box { padding: 40px 15px; }
    .primary-btn { max-width: 100%; padding: 16px; font-size: 16px; }
}

/* 1. Main Dropdown ki jagah set ki */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* 2. Yellow text hata kar White kiya gaya hai */
.dropbtn {
    background-color: transparent;
    color: inherit; /* Ye apne aap theme ke hisaab se rang badlega */
    font-family: 'Inter', Arial, sans-serif; /* Baaki links jaisa font style lega */
    font-weight: bold;
    font-size: 16px;
    border: none;
    cursor: pointer;
    padding: 10px 15px;
}

/* 3. Dropdown Box (Photo jaisa Laal Border upar) */
.dropdown-content {
    display: none; /* Normal time pe chhupa rahega */
    position: absolute;
    background-color: white;
    min-width: 220px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-top: 3px solid #E63946; /* Premium Red Border */
    z-index: 1000;
}

/* 4. Dropdown ke andar ke Links */
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 15px;
    font-family: 'Inter', Arial, sans-serif;
    border-bottom: 1px solid #f1f1f1;
}

/* 5. Photo jaisa Arrow (>) Icon har link ke aage */
.dropdown-content a::before {
    content: ">"; 
    color: #555;
    font-weight: bold;
    margin-right: 10px;
}

/* 6. Mouse rakhne par rang badalna */
.dropdown-content a:hover {
    background-color: #f9f9f9;
}

/* 7. Mouse "Convert Image" par aate hi box dikhana */
.nav-dropdown:hover .dropdown-content {
    display: block;
}

/* =========================================
   FOOTER LINKS (STRICTLY BLACK & WHITE)
========================================= */
/* Light Mode: Pure Black */
.master-footer a {
    color: #000000 !important; 
    text-decoration: none; /* Text ke neeche ki line hatane ke liye */
    transition: color 0.3s ease; /* Aaram se color change hone ke liye */
}

/* Dark Mode: Pure White */
html.dark-mode .master-footer a {
    color: #ffffff !important; 
}

/* =========================================
   8. IMAGEFIXHUB PREMIUM COOKIE BANNER 
========================================= */
.ifh-cookie-banner {
    position: fixed;
    bottom: -500px; /* Shuru mein chhipa rahega */
    left: 20px;
    width: 440px; /* 3 button aaram se aane ke liye thodi chaurai */
    max-width: calc(100% - 40px);
    background: var(--bg-surface); /* Light aur Dark mode support */
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', Arial, sans-serif;
}

/* Dark mode shadow */
html.dark-mode .ifh-cookie-banner {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

/* JS jab isko show karega */
.ifh-cookie-banner.show {
    bottom: 25px; 
}

.cookie-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.cookie-desc {
    margin: 0 0 20px 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cookie-desc a {
    color: var(--accent);
    text-decoration: underline;
}

/* --- BUTTONS LAYOUT --- */
.cookie-btn-group {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.cookie-btn-group button {
    flex: 1; /* Teeno button ko barabar size dega */
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px; /* Image jaisa professional sharp look */
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

/* Customise aur Reject Button (Outline style) */
.cookie-btn-outline {
    background: transparent;
    color: var(--accent); /* Tumhari website ka main color (Blue/Indigo) */
    border: 1px solid var(--accent);
}

.cookie-btn-outline:hover {
    background: var(--accent);
    color: #ffffff;
}

/* Accept All Button (Filled style) */
.cookie-btn-filled {
    background: var(--accent);
    color: #ffffff;
    border: 1px solid var(--accent);
}

.cookie-btn-filled:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Mobile View (Chhoti screen par buttons ko upar-neeche set karne ke liye) */
@media (max-width: 500px) {
    .cookie-btn-group {
        flex-direction: column;
    }
    .cookie-btn-group button {
        width: 100%;
        padding: 12px 0; /* Mobile par tap karne ke liye thoda bada */
    }
}

/* =========================================
   9. CUSTOMISE CONSENT MODAL 
========================================= */
.cookie-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px); /* Background blur effect */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

.cookie-modal-overlay.show-modal {
    opacity: 1;
    visibility: visible;
}

.cookie-modal {
    background: var(--bg-surface);
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Agar screen choti ho toh uske hisaab se adjust hoga */
    font-family: 'Inter', Arial, sans-serif;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0; font-size: 18px; color: var(--text-primary);
}

.close-modal-btn {
    background: transparent; border: none; font-size: 24px;
    color: var(--text-secondary); cursor: pointer;
}

.close-modal-btn:hover { color: var(--accent); }

.modal-body {
    padding: 20px 24px;
    overflow-y: auto; /* Content zyada ho toh scroll hoga */
}

.modal-intro {
    font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5;
}

.preference-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.preference-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.pref-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}

.pref-header h4 {
    margin: 0; font-size: 15px; color: var(--text-primary);
}

.preference-item p {
    margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5;
}

.always-active {
    color: #16a34a; font-size: 13px; font-weight: 600;
}

/* Toggle Switch Design */
.toggle-switch {
    position: relative; display: inline-block; width: 40px; height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border); transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(18px); }

.modal-footer {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 20px 24px; border-top: 1px solid var(--border);
}

@media (max-width: 500px) {
    .modal-footer { flex-direction: column; }
    .modal-footer button { width: 100%; }
}