/* ==========================================
   1. CSS VARIABLES (Design System)
   ========================================== */
:root {
    --primary: #ff6b00;
    --primary-light: #ff8c33;
    --primary-alpha: rgba(255, 107, 0, 0.1);
    --gradient: linear-gradient(135deg, var(--primary), var(--primary-light));
    --bg-main: #ffffff;
    --bg-soft: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px -10px rgba(255, 107, 0, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px -5px rgba(255, 107, 0, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   2. RESET & GLOBAL STYLES
   ========================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    word-wrap: break-word; 
    overflow-wrap: break-word; 
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-soft); 
    color: var(--text-main); 
    line-height: 1.6; 
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* Blog Content Styles */
.formatted-content a {
    color: var(--primary);
    text-decoration: underline;
}
.formatted-content a:hover {
    color: #e65c00; /* Darker shade for hover */
}
ul { list-style: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.mt-2 { margin-top: 1rem; }
.text-center { text-align: center; }

/* --- TYPOGRAPHY --- */
h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 1rem; color: var(--text-main); }
h3 { font-size: 1.3rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; font-weight: 600; color: var(--text-main); margin-bottom: 0.5rem; }
p { color: var(--text-muted); margin-bottom: 1rem; }

.section-header { text-align: center; margin-bottom: 3rem; }

/* ==========================================
   3. COMPONENTS & BUTTONS
   ========================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

.glass {
    background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow-soft);
}

.card { 
    background: var(--bg-main); border-radius: var(--radius); 
    border: 1px solid var(--border); padding: 2rem; box-shadow: var(--shadow-sm); 
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.5rem; font-weight: 600; font-size: 1rem;
    border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); 
    border: none; outline: none; position: relative; overflow: hidden;
    text-align: center; gap: 8px;
}

.btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3); }
.btn-primary:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 8px 25px rgba(255, 107, 0, 0.4); }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #fff7ed; }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-success:hover { transform: scale(1.03) translateY(-2px); box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4); }
.btn-danger { background: var(--danger); color: white; padding: 0.5rem 1rem; }
.btn-full { width: 100%; padding: 1rem; font-size: 1.1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* Ripple Animation */
.ripple::after {
    content: ""; position: absolute; background: rgba(255, 255, 255, 0.3);
    border-radius: 50%; transform: scale(0); opacity: 0; width: 150px; height: 150px;
    transition: transform 0.4s, opacity 0.4s; pointer-events: none;
}
.ripple:active::after { transform: scale(2); opacity: 1; transition: 0s; }

/* ==========================================
   4. NAVIGATION (DESKTOP)
   ========================================== */
nav { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; transition: var(--transition); padding: 1.5rem 0; background: transparent; }
nav.scrolled { background: var(--glass-bg); backdrop-filter: blur(12px); padding: 1rem 0; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border-bottom: 1px solid var(--glass-border); }

.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex !important; justify-content: space-between !important; align-items: center !important; width: 100%; gap: 2rem; }

.logo { font-size: 1.5rem; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; z-index: 1001; flex-shrink: 0; margin-right: auto; }
.logo img { height: 28px; width: auto; }
.logo span { color: var(--primary); }

.nav-links { display: flex !important; gap: 2rem !important; align-items: center; }
.nav-links a { font-weight: 500; transition: color 0.2s; position: relative; }
.nav-links a:hover { color: var(--primary); }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -4px; left: 0; background: var(--primary); transition: width 0.3s; }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; margin-left: 2rem; }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; z-index: 1001; }
.mobile-toggle span { display: block; width: 25px; height: 3px; background: var(--text-main); border-radius: 3px; transition: 0.3s; }

/* Dropdown */
.dropdown { position: relative; display: inline-block; }
.dropbtn { display: flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 500;}
.dropdown-content { visibility: hidden; opacity: 0; position: absolute; top: 150%; left: 50%; transform: translateX(-50%) translateY(10px); min-width: 220px; background: var(--glass-bg); backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 0.5rem; z-index: 1000; transition: all 0.3s ease; }
.dropdown:hover .dropdown-content { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); top: 100%; }
.dropdown-content a { display: block; padding: 0.75rem 1rem !important; color: var(--text-main); text-align: left !important; border-radius: 8px; font-size: 0.95rem; border-bottom: none !important; }
.dropdown-content a::after { display: none !important; }
.dropdown-content a:hover { background: rgba(255, 107, 0, 0.08) !important; color: var(--primary) !important; }

/* ==========================================
   5. LAYOUT & HERO
   ========================================== */
main { padding-top: 100px; }
section { max-width: 1200px; margin: 0 auto; padding: 5rem 2rem; }

#hero { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; min-height: 80vh; }
.hero-content p { font-size: 1.125rem; margin-bottom: 2rem; max-width: 480px; }
.hero-ctas { display: flex; gap: 1rem;}
.floating { animation: float 6s ease-in-out infinite; }
.ui-mockup { padding: 1.5rem; background: white; }
.mockup-header { display: flex; gap: 8px; margin-bottom: 1rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; } .dot.red { background: #ff5f56; } .dot.yellow { background: #ffbd2e; } .dot.green { background: #27c93f; }
.mockup-image { width: 100%; height: 200px; background: linear-gradient(45deg, #e2e8f0, #cbd5e1); border-radius: var(--radius-sm); margin-bottom: 1rem; }
.mockup-stats { display: flex; justify-content: space-between; gap: 1rem;}
.mockup-stats div { padding: 1rem; background: var(--bg-soft); border-radius: 8px; flex: 1; }
.mockup-stats .highlight { background: #fff7ed; color: var(--primary); border: 1px solid #ffedd5; }

#hero.mini-hero { display: flex !important; flex-direction: column; align-items: center; justify-content: center; max-width: 800px; margin: 0 auto !important; min-height: auto !important; padding-bottom: 1rem !important; padding-top: 2rem !important; text-align: center; }
#hero.mini-hero .hero-content { width: 100%; display: flex; flex-direction: column; align-items: center; }
#hero.mini-hero p { max-width: 600px; margin: 0 auto 2rem auto !important; }

/* ==========================================
   6. TOOL WORKSPACE (General)
   ========================================== */
.tool-container { padding: 3rem; text-align: center; }
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 5rem 2rem; transition: var(--transition); cursor: pointer; background: var(--bg-main); position: relative; }
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: #fff7ed; box-shadow: 0 0 20px rgba(255, 107, 0, 0.1); }
.upload-area.dragover { animation: pulseBorder 1.5s infinite; }
.upload-icon svg { color: var(--primary); margin-bottom: 1rem; transition: transform 0.3s; }
.upload-area:hover .upload-icon svg { transform: translateY(-5px); }

.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; text-align: left; }
.preview-panel { display: flex; align-items: center; justify-content: center; background: #e2e8f0; border-radius: var(--radius-sm); overflow: hidden; padding: 1rem; position: relative; }
.comparison-slider { position: relative; width: 100%; height: 400px; overflow: hidden; border-radius: var(--radius-sm); cursor: ew-resize; background: #cbd5e1; box-shadow: var(--shadow-soft); }
.comparison-slider img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.resize-box { position: absolute; top: 0; left: 0; height: 100%; width: 50%; overflow: hidden; border-right: 2px solid white; box-shadow: 2px 0 10px rgba(0,0,0,0.2); }
.resize-box img { width: 200%; max-width: none; }
.slider-handle { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.2); pointer-events: none; color: var(--primary);}
.badge-orig, .badge-comp { position: absolute; bottom: 10px; padding: 4px 10px; background: rgba(0,0,0,0.6); color: white; font-size: 0.8rem; border-radius: 4px; z-index: 2; }
.badge-orig { right: 10px; } .badge-comp { left: 10px; }

/* Input Controls */
.controls-panel { display: flex; flex-direction: column; gap: 1.5rem; position: relative; }
.slider-group label { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 0.5rem; }
input[type="range"] { width: 100%; accent-color: var(--primary); height: 6px; border-radius: 3px; outline: none; cursor: pointer; }

.toggle-group { margin-top: 1rem; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.95rem; }
.toggle-label input { display: none; }
.toggle-switch { width: 40px; height: 22px; background: var(--border); border-radius: 20px; position: relative; transition: 0.3s; flex-shrink: 0;}
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: 0.3s; }
.toggle-label input:checked + .toggle-switch { background: var(--primary); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(18px); }
.presets { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }
.preset-label { font-size: 0.9rem; font-weight: 500; margin-right: 0.5rem; }

/* Custom Inputs UI */
.custom-select { width: 100%; font-size: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; outline: none; background: var(--bg-soft); appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em; cursor: pointer; font-weight: 500; }
.custom-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1); background-color: white; }
.combined-input { display: flex; align-items: stretch; width: 100%; }
.combined-input .dimension-input { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; flex: 1; text-align: left; }
.combined-input .unit-select { border-top-left-radius: 0; border-bottom-left-radius: 0; width: auto; padding: 12px 35px 12px 15px; background-color: var(--bg-soft); flex-shrink: 0; border-left: 1px solid var(--border); }
.combined-input .dimension-input:focus { z-index: 2; }

.dimensions-group { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 1.5rem; }
.dimensions-group .input-group { margin-bottom: 0; flex: 1; width: auto; }
.dimension-input { width: 100%; font-size: 16px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; outline: none; background: var(--bg-soft); transition: var(--transition); }
.dimension-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 107, 0, 0.1); background: white; }
.dimension-input::-webkit-outer-spin-button, .dimension-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dimension-input[type=number] { appearance: textfield; -moz-appearance: textfield; }

.lock-wrapper { display: flex; align-items: center; justify-content: center; padding-bottom: 6px; }
.btn-lock { background: white; border: 1px solid var(--border); cursor: pointer; color: var(--text-muted); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.3s; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.btn-lock:hover { background: #fff7ed; color: var(--primary); border-color: var(--primary-light); transform: scale(1.08); }
.btn-lock.active { color: var(--primary); background: rgba(255, 107, 0, 0.1); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1); }

/* Stats Board */
.stats-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-box { padding: 1rem; background: var(--bg-soft); border-radius: var(--radius-sm); text-align: center; transition: 0.3s;}
.stat-box span { display: block; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.stat-box strong { font-size: 1.25rem; color: var(--text-main); }
.stat-box.highlight { background: #fff7ed; border: 1px solid #ffedd5; }
.stat-box.highlight strong { color: var(--primary); }
.stat-box.savings strong { color: var(--success); }

#conv-format-badge { top: 20px !important; bottom: auto !important; right: 20px !important; left: auto !important; height: auto !important; display: inline-block !important; line-height: 1 !important; padding: 6px 12px !important; }
#conv-stat-name, #resize-stat-origsize { word-break: break-word; overflow-wrap: anywhere; font-size: 0.85rem !important; line-height: 1.4; }

.loading-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 10; border-radius: var(--radius-sm); }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 1rem; }

/* ==========================================
   7. PREMIUM TOOLS GRID (OUR TOOLKIT)
   ========================================== */
.grid-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2rem; 
}

.tool-card { 
    background: var(--card-bg, #ffffff); 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px); 
    border: 1px solid var(--card-border, #e2e8f0); 
    border-radius: 20px; 
    padding: 2.5rem 2rem; 
    box-shadow: var(--shadow-sm); 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    position: relative; 
    overflow: hidden; 
    display: block; 
    text-align: left;
    z-index: 1; 
}

.tool-card::before { 
    content: ''; 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 3px; 
    background: linear-gradient(135deg, var(--primary), var(--primary-light)); 
    transform: scaleX(0); 
    transform-origin: left; 
    transition: transform 0.4s ease; 
    z-index: 2;
}

.tool-card.active:hover { 
    transform: translateY(-10px) scale(1.02); 
    box-shadow: var(--shadow-lg); 
    border-color: rgba(255, 107, 0, 0.3); 
    background: #ffffff; 
}

.tool-card.active:hover::before { 
    transform: scaleX(1); 
}

.tool-card .icon-wrapper {
    width: 56px; height: 56px; 
    background: var(--primary-alpha); 
    border-radius: 16px; 
    display: flex; align-items: center; justify-content: center; 
    margin-bottom: 1.5rem; 
    color: var(--primary); 
    transition: transform 0.3s ease, background 0.3s, color 0.3s; 
}

.tool-card.active:hover .icon-wrapper {
    transform: scale(1.1) rotate(-5deg); 
    background: var(--primary); 
    color: #ffffff; 
    box-shadow: 0 10px 20px rgba(255, 107, 0, 0.3); 
}

.tool-card h3 { 
    font-size: 1.25rem; 
    color: var(--text-main); 
    font-weight: 600; 
    margin-bottom: 0.75rem; 
}

.tool-card p { 
    font-size: 1rem; 
    color: var(--text-muted); 
    line-height: 1.6; 
    margin: 0; 
}

.tool-card.disabled { 
    filter: grayscale(1); 
    opacity: 0.7; 
    cursor: not-allowed; 
    background: #f8fafc;
}

.tool-card.disabled .badge { 
    position: absolute; 
    top: 1.5rem; 
    right: 1.5rem; 
    background: var(--text-muted); 
    color: white; 
    font-size: 0.7rem; 
    padding: 0.4rem 0.8rem; 
    border-radius: 20px; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

/* ==========================================
   8. SPECIFIC TOOLS (QR, Crop)
   ========================================== */
#qr-code-box img, #qr-code-box canvas { margin: 0 auto; display: block; max-width: 100%; height: auto; }
.qr-animate { animation: qrPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes qrPop { 0% { transform: scale(0.8); opacity: 0; } 50% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* Premium Crop Tool UI */
.premium-tool-card { padding: 1.5rem; background: var(--bg-main); border: 1px solid var(--border); box-shadow: var(--shadow-soft); border-radius: 24px; }
.editor-layout { display: flex; gap: 1.5rem; align-items: stretch; }
.canvas-panel { flex: 1 1 70%; display: flex; flex-direction: column; background: var(--bg-soft); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; position: relative; min-height: 500px; }
.canvas-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: white; border-bottom: 1px solid var(--border); z-index: 10; }
.canvas-header .badge { background: var(--primary-alpha); color: var(--primary); padding: 4px 12px; font-size: 0.8rem; border-radius: 20px; }
.cropper-stage { flex: 1; width: 100%; position: relative; background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 20px 20px; background-color: var(--bg-soft); }
.canvas-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: white; border-top: 1px solid var(--border); z-index: 10; }
.icon-btn { background: white; border: 1px solid transparent; color: var(--text-muted); width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.icon-btn:hover { background: var(--bg-soft); color: var(--primary); border-color: var(--border); }
.sidebar-panel { flex: 0 0 320px; display: flex; flex-direction: column; gap: 1.5rem; }
.control-block { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
.aspect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ratio-btn { background: var(--bg-soft); border: 2px solid transparent; border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s; }
.ratio-btn.active { background: white; border-color: var(--primary); box-shadow: 0 4px 15px var(--primary-alpha); }
.ratio-icon { border: 2px solid var(--text-muted); border-radius: 4px; transition: all 0.2s; }
.ratio-btn.active .ratio-icon { border-color: var(--primary); }
.box-free { width: 22px; height: 18px; border-style: dashed; } .box-1-1 { width: 20px; height: 20px; } .box-16-9 { width: 24px; height: 14px; } .box-4-5 { width: 16px; height: 20px; } .box-9-16 { width: 14px; height: 24px; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: white; border: 1px solid var(--border); border-radius: 50px; padding: 12px 24px; box-shadow: var(--shadow-lg); z-index: 10000; transition: transform 0.4s; opacity: 0; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-content { display: flex; align-items: center; gap: 12px; }
.toast-icon { background: #d1fae5; color: var(--success); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.9rem;}
.toast-text { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }

/* Cropper Theme Overrides */
.cropper-view-box, .cropper-face { border-radius: 0; }
.cropper-line { background-color: var(--primary) !important; }
.cropper-point { background-color: var(--primary) !important; width: 8px !important; height: 8px !important; border-radius: 50%; }
.cropper-view-box { outline: 2px solid var(--primary) !important; outline-color: var(--primary) !important; }
.cropper-center { display: block !important; width: 8px !important; height: 8px !important; background-color: var(--primary) !important; border-radius: 50%; }
.cropper-modal { background-color: rgba(15, 23, 42, 0.6) !important; }

/* ==========================================
   9. FEATURES & FAQ
   ========================================== */
.sizehex-features { position: relative; padding: 6rem 2rem; background-color: var(--bg-soft); overflow: hidden; }
.features-header { text-align: center; margin-bottom: 4rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.feature-card { background: var(--bg-main); border: 1px solid var(--glass-border); border-radius: 20px; padding: 2.5rem 2rem; box-shadow: var(--shadow-sm); transition: all 0.4s; position: relative; overflow: hidden; z-index: 1; text-align: left; }
.feature-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: var(--shadow-lg); border-color: var(--primary-alpha); background: #ffffff; }
.feature-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--gradient); transform: scaleX(0); transform-origin: left; transition: 0.4s ease; }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card .icon-wrapper { width: 56px; height: 56px; background: var(--primary-alpha); border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 1.5rem; color: var(--primary); transition: 0.3s; }
.feature-card:hover .icon-wrapper { transform: scale(1.1) rotate(-5deg); background: var(--primary); color: #ffffff; box-shadow: 0 10px 20px rgba(255, 107, 0, 0.3); }

/* FAQ */
.accordion { display: flex; flex-direction: column; gap: 1rem; }
.accordion-item { background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.accordion-header { width: 100%; padding: 1.5rem; background: transparent; border: none; text-align: left; font-size: 1.1rem; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.accordion-header:hover { color: var(--primary); }
.accordion-content { padding: 0 1.5rem; max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.accordion-item.active .accordion-content { padding-bottom: 1.5rem; max-height: 500px; }
.accordion-item.active .icon { transform: rotate(45deg); color: var(--primary); }
.icon { transition: transform 0.3s; font-size: 1.5rem; font-weight: 300; flex-shrink: 0;}

/* ==========================================
   10. USE CASES & BLOG (SEO & CONTENT)
   ========================================== */
.use-case-hero { padding: 4rem 2rem 2rem 2rem; background: var(--bg-main); border-bottom: 1px solid var(--border); }
.filters-container { display: flex; flex-direction: column; gap: 1.5rem; padding: 2rem 0; }
.search-box { position: relative; flex: 1; max-width: 400px; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { width: 100%; padding: 12px 16px 12px 42px; border: 1px solid var(--border); border-radius: 50px; font-size: 0.95rem; font-family: inherit; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-alpha); }
.category-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn { background: white; border: 1px solid var(--border); padding: 8px 16px; border-radius: 50px; font-size: 0.9rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s ease; }
.filter-btn:hover, .filter-btn.active { background: var(--primary-alpha); color: var(--primary); border-color: var(--primary); }

.use-cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 4rem; }
.uc-card { display: flex; flex-direction: column; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); background: white; text-decoration: none; color: inherit; transition: all 0.3s ease; box-shadow: var(--shadow-sm); }
.uc-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.uc-icon { width: 48px; height: 48px; background: var(--bg-soft); color: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; transition: all 0.3s ease; }
.uc-card:hover .uc-icon { background: var(--gradient); color: white; }
.uc-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.uc-card p { font-size: 0.9rem; color: var(--text-muted); flex-grow: 1; margin-bottom: 1rem; }
.uc-link { font-size: 0.9rem; font-weight: 600; color: var(--primary); }

.uc-articles { max-width: 800px; margin: 0 auto; padding-bottom: 4rem; }
.uc-detailed-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; margin-bottom: 3rem; box-shadow: var(--shadow-sm); scroll-margin-top: 100px; }
.uc-detailed-card h2 { font-size: 1.8rem; color: var(--text-main); line-height: 1.3; margin-bottom: 0.5rem; }
.uc-meta { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.uc-meta a { color: var(--primary); font-weight: 600; }
.uc-detailed-card h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--text-main); }
.uc-detailed-card p, .uc-detailed-card ol, .uc-detailed-card ul { font-size: 1.05rem; color: #334155; line-height: 1.7; margin-bottom: 1.5rem; }
.uc-detailed-card ol, .uc-detailed-card ul { padding-left: 1.5rem; }
.uc-detailed-card li { margin-bottom: 0.5rem; }
.uc-example-box { background: var(--bg-soft); border-left: 4px solid var(--primary); padding: 1.25rem; border-radius: 0 8px 8px 0; margin: 1.5rem 0; font-size: 0.95rem; color: var(--text-main); }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
.blog-card { background: var(--bg-main); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); transition: 0.3s; text-align: left; cursor: pointer; }
.blog-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.blog-card-img { width: 100%; height: 220px; object-fit: cover; background: #e2e8f0; }
.blog-card-content { padding: 2rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; font-size: 0.85rem; font-weight: 600; }
.blog-category-tag { color: var(--primary); background: var(--primary-alpha); padding: 4px 10px; border-radius: 12px; }
.blog-card h3 { font-size: 1.35rem; line-height: 1.4; margin-bottom: 1rem; color: var(--text-main); transition: color 0.2s; }
.blog-card:hover h3 { color: var(--primary); }
.blog-card-desc { font-size: 1rem; margin-bottom: 1.5rem; flex: 1; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-clamp: 3; }
.single-blog-header { text-align: center; max-width: 800px; margin: 0 auto 3rem; }
.single-blog-cover { width: 100%; max-height: 500px; object-fit: cover; border-radius: var(--radius); margin-bottom: 3rem; box-shadow: var(--shadow-sm); }
.article-container { max-width: 800px; margin: 0 auto; }
.blog-article-content h2 { margin-top: 3rem; margin-bottom: 1.5rem; font-size: 2rem; color: var(--text-main); }
.blog-article-content h3 { margin-top: 2rem; margin-bottom: 1rem; font-size: 1.5rem; }
.blog-article-content p { margin-bottom: 1.5rem; color: #334155; }
.blog-article-content ul, .blog-article-content ol { margin-bottom: 1.5rem; margin-left: 2rem; }
.blog-article-content li { margin-bottom: 0.5rem; }
.blog-article-content img { max-width: 100%; border-radius: 12px; box-shadow: var(--shadow-sm); margin: 2rem 0; }

/* Responsive Blog */
@media (max-width: 992px) {
    .blog-sidebar { display: none !important; }
    .blog-article-content { max-width: 100% !important; }
}

/* Sidebar Recent Post Widget */
.widget-post { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.widget-post:last-child { border: none; padding-bottom: 0; }
.widget-post img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.widget-post h4 { font-size: 0.9rem; line-height: 1.3; margin: 0; color: var(--text-main); transition: color 0.2s; }
.widget-post:hover h4 { color: var(--primary); }

/* ==========================================
   11. FORMS, ABOUT, CTA & ADMIN
   ========================================== */
.form-section { display: flex; justify-content: center; align-items: center; padding: 2rem 1rem; }
.form-card { width: 100%; max-width: 600px; padding: 3rem; margin: 0 auto; }
.input-group { margin-bottom: 1.5rem; width: 100%; text-align: left; }
.input-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.input-group input, .input-group textarea, .form-control { width: 100%; font-size: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; transition: var(--transition); outline: none; background: var(--bg-soft); }
.input-group input:focus, .input-group textarea:focus, .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-alpha); background: white; }
#form-status { margin-top: 1rem; font-weight: 500; text-align: center; padding: 1rem; border-radius: 8px; }
.success-msg { color: var(--success); background: #d1fae5; border: 1px solid #34d399; }
.error-msg { color: #ef4444; background: #fee2e2; border: 1px solid #f87171; }

.about-hero { text-align: center; max-width: 800px; margin: 0 auto; padding: 2rem 1rem 4rem 1rem; }
.text-page { max-width: 800px; margin: 40px auto; padding: 3rem; background: var(--bg-main); border-radius: var(--radius); }
.text-page h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--text-main); }
.text-page h2 { font-size: 1.75rem; margin-top: 2.5rem; margin-bottom: 1rem; color: var(--text-main); }
.text-page p { font-size: 1.1rem; line-height: 1.7; color: var(--text-muted); margin-bottom: 1.5rem; }
.text-page strong { color: var(--text-main); }
.badge-primary { display: inline-block; background: var(--primary-alpha); color: var(--primary); padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1.5rem; }
.text-gradient { background: var(--gradient); background-clip: text; -webkit-background-clip: text; color: transparent; -webkit-text-fill-color: transparent; display: inline-block; }
.mission-box { max-width: 900px; margin: 0 auto; padding: 4rem 3rem; text-align: center; border-top: 4px solid var(--primary); }

/* --- CTA BANNER FIX (White Text on Orange) --- */
.cta-banner { 
    background: var(--gradient); 
    border-radius: var(--radius); 
    padding: 4rem 2rem; 
    text-align: center; 
    box-shadow: var(--shadow-lg); 
    margin: 4rem auto;
    max-width: 1200px;
}
.cta-banner h1, 
.cta-banner h2, 
.cta-banner h3 { 
    color: #ffffff !important; 
    margin-bottom: 1rem; 
}
.cta-banner p { 
    color: rgba(255, 255, 255, 0.95) !important; 
    font-size: 1.15rem; 
    margin-bottom: 2rem; 
}
.cta-banner .btn { 
    background: #ffffff !important; 
    color: var(--primary) !important; 
    font-weight: 700; 
    padding: 1rem 2.5rem; 
    font-size: 1.1rem; 
    border-radius: 50px; 
}
.cta-banner .btn:hover { 
    background: #f8fafc !important; 
    transform: translateY(-3px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; margin-top: 2rem; }
.editor-container { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: white; }
.editor-toolbar { padding: 0.5rem; background: var(--bg-soft); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 0; z-index: 10; }
.toolbar-btn { background: white; border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; cursor: pointer; font-weight: 600; transition: 0.2s; }
.toolbar-btn:hover, .toolbar-btn.active { background: #fff7ed; color: var(--primary); border-color: var(--primary-light); }
.editor-content { min-height: 400px; padding: 1.5rem; outline: none; overflow-y: auto; }
.blog-list-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.5rem; background: var(--bg-soft); }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { max-width: 400px; width: 100%; text-align: center; }

/* ==========================================
   12. FOOTER & COOKIE WIDGET
   ========================================== */
footer { 
    background: white; 
    border-top: 1px solid var(--border); 
    padding-top: 4rem; 
}

.footer-container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 2rem; 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr; 
    gap: 2rem; 
    align-items: start; 
    text-align: left; 
}

.footer-brand { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
}

.footer-brand .logo { 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; 
    gap: 8px; 
}

.footer-brand p { 
    margin-top: 1rem; 
    font-size: 0.95rem; 
    max-width: 250px; 
    color: var(--text-muted); 
}

.footer-links { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
}

.footer-links h4 { 
    margin-bottom: 1.5rem; 
    color: var(--text-main); 
    font-weight: 700; 
}

.footer-links a { 
    display: block; 
    margin-bottom: 0.75rem; 
    color: var(--text-muted); 
    transition: color 0.2s; 
    font-size: 0.95rem; 
}

.footer-links a:hover { 
    color: var(--primary); 
}

.footer-bottom { 
    text-align: center; 
    padding: 2rem; 
    margin-top: 4rem; 
    border-top: 1px solid var(--border); 
    color: var(--text-muted); 
    font-size: 0.9rem; 
}

/* Cookie Consent Widget - Sleek Fix */
.cookie-popup.corner-widget {
    position: fixed;
    bottom: 20px;
    left: 20px; 
    transform: translateY(120%) scale(0.95); 
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column; 
    gap: 0.5rem;
    z-index: 99999;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    border: 1px solid var(--border);
    width: 300px; 
    max-width: calc(100vw - 40px);
    opacity: 0;
}

.cookie-popup.corner-widget.show { 
    transform: translateY(0) scale(1); 
    opacity: 1;
}

.cookie-popup.corner-widget.hide { 
    transform: translateY(120%) scale(0.95); 
    opacity: 0;
    pointer-events: none; 
}

.cookie-icon-top { display: flex; align-items: center; margin-bottom: 0.15rem; }
.cookie-text-vertical h4 { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text-main); }
.cookie-text-vertical p { font-size: 0.8rem; line-height: 1.4; color: var(--text-muted); margin: 0; }
.cookie-text-vertical a { color: var(--text-main); font-weight: 600; text-decoration: underline; transition: color 0.2s; }
.cookie-text-vertical a:hover { color: var(--primary); }
.cookie-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.25rem; }
.cookie-btns .btn { width: 100%; font-size: 0.8rem; padding: 0.5rem 0.75rem; border-radius: 8px; }

/* Animations */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
@keyframes pulseBorder { 0%, 100% { border-color: var(--primary); box-shadow: 0 0 0 transparent; } 50% { border-color: var(--primary-light); box-shadow: 0 0 20px var(--primary-alpha); } }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ==========================================
   13. RESPONSIVE DESIGN & MOBILE FIXES
   ========================================== */
@media(min-width: 992px) {
    .admin-grid { grid-template-columns: 350px 1fr; } 
    .filters-container { flex-direction: row; align-items: center; justify-content: space-between; } 
}

@media (max-width: 992px) {
    #hero { grid-template-columns: 1fr; text-align: center; gap: 2rem;}
    .hero-content p { margin: 0 auto 2rem auto; }
    .hero-ctas { justify-content: center; }
    .workspace { grid-template-columns: 1fr; }
    .comparison-slider { height: 350px; }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-layout { flex-direction: column; } 
    .sidebar-panel { flex: none; width: 100%; } 
    .canvas-panel { min-height: 400px; }
    .blog-sidebar { display: none !important; } 
    .blog-article-content { max-width: 100% !important; }

    /* Bulletproof Hamburger Nav */
    .mobile-toggle { display: flex; }
    .nav-actions .btn { display: none; }
    .logo { margin-right: auto; }
    
    .nav-links {
        position: absolute !important;
        top: 100% !important; 
        left: 0 !important;
        width: 100% !important;
        background: var(--bg-main) !important;
        flex-direction: column !important;
        padding: 0 !important;
        gap: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
        
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(-10px) !important;
        pointer-events: none !important;
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease !important;
        
        display: flex !important;
        max-height: none !important;
    }

    nav.menu-open .nav-links,
    #navbar.menu-open .nav-links {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
        padding: 1rem 0 !important;
    }

    .nav-links a {
        width: 100% !important;
        text-align: center !important;
        padding: 1rem 2rem !important;
        display: block !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }
    .nav-links a::after { display: none !important; }

    /* Mobile Dropdown Specific Centering Fix */
    .nav-links .dropdown {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-links .dropdown .dropbtn {
        justify-content: center !important;
        width: 100% !important;
        padding: 1rem 2rem !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }

    .nav-links .dropdown-content {
        display: none !important;
        position: static !important;
        width: 100% !important;
        background: rgba(0,0,0,0.03) !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }

    .nav-links .dropdown.active-touch .dropdown-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-links .dropdown-content a {
        text-align: center !important;
        width: 100% !important;
        padding: 1rem 2rem !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
        display: block !important;
        border-radius: 0 !important;
    }
}

@media (max-width: 768px) {
    /* FOOTER CENTER FIX (SOLVES ONE-SIDE ERROR) */
    .footer-container { 
        grid-template-columns: 1fr; 
        text-align: center; 
        justify-items: center; 
        align-items: center; 
        gap: 2.5rem; 
    }
    .footer-brand { 
        align-items: center; 
        text-align: center; 
        margin: 0 auto; 
    }
    .footer-brand .logo { 
        justify-content: center; 
        margin: 0 auto; 
    }
    .footer-brand p { 
        margin: 1rem auto 0 auto; 
        text-align: center; 
    }
    .footer-links { 
        align-items: center; 
        text-align: center; 
        margin: 0 auto; 
        width: 100%; 
    }

    section { padding: 3.5rem 1.5rem; }
    .tool-container { padding: 1.5rem; }
    .upload-area { padding: 3rem 1rem; }
    .comparison-slider { height: 250px; }
    .presets { justify-content: flex-start; }
    .preset-btn { flex: 1 1 calc(33.333% - 10px); min-width: 80px; padding: 0.4rem; font-size: 0.8rem;}
    .stats-board { grid-template-columns: 1fr; gap: 0.5rem; }
    .form-card { padding: 2rem 1.5rem; border-radius: var(--radius-sm); }
    .features-grid { grid-template-columns: 1fr; gap: 1.5rem; } 
    .use-case-hero { padding: 3rem 1rem 1.5rem 1rem; }
    .search-box { max-width: 100%; width: 100%; }
    .category-filters { justify-content: center; gap: 8px; }
    .uc-articles { padding: 0 1rem 3rem 1rem; }
    .uc-detailed-card { padding: 1.5rem; margin-bottom: 2rem; scroll-margin-top: 80px; }
    .premium-tool-card { padding: 1rem; border-radius: 16px; }
    .canvas-panel { min-height: 350px; }
    .canvas-footer { flex-wrap: wrap; }
    .cta-banner { padding: 3rem 1.5rem; margin: 2rem auto; }
    
    .cookie-popup.corner-widget { left: 10px; right: 10px; bottom: 10px; width: auto; }
    .text-page { padding: 1.5rem; margin: 20px 1rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    .hero-content p { font-size: 1rem; }
    .mockup-stats { flex-direction: column; }
    .page-content { padding: 2rem 1rem; }
    .form-card { padding: 1.5rem 1rem; box-shadow: none; border: 1px solid var(--border); }
    .btn-full { padding: 14px; font-size: 1rem; }
    .accordion-header { font-size: 1rem; padding: 1rem; }
    .accordion-content { padding: 0 1rem; }
    .dimensions-group { gap: 8px; } 
    .btn-lock { width: 34px; height: 34px; }
    .cookie-btns { grid-template-columns: 1fr; }
}