/* ========================================================
   GLOBAL STYLES AND VARIABLES
   ======================================================== */
:root {
    --primary: #007bff; /* Blue for primary actions */
    --accent: #ff9800;  /* Orange/Amber for highlights */
    --background: #f4f7f9;
    --text-color: #333;
    --card-bg: #fff;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --blue: #007bff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    color: var(--text-color);
    margin-bottom: 0.5em;
}

/* ========================================================
   HEADER AND NAVIGATION STYLES
   ======================================================== */
.site-header {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on small screens */
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.8em;
    font-weight: bold;
    letter-spacing: 1px;
    color: white;
    margin-right: 20px;
    padding: 5px 0;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    flex-grow: 1;
    justify-content: flex-end;
}

.nav-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
    border-radius: 4px;
    margin: 2px;
}

.nav-btn:hover {
    color: white;
    background-color: rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    color: white;
    background-color: var(--accent); /* Highlight active tool */
    font-weight: 600;
}

/* Responsive adjustments for navigation */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav {
        justify-content: center;
        width: 100%;
        margin-top: 10px;
    }
    .nav-btn {
        flex: 1 1 auto;
        padding: 8px 10px;
        font-size: 0.8em;
        text-align: center;
        margin: 2px 5px;
    }
}


/* ========================================================
   MAIN LAYOUT AND CARD STYLES
   ======================================================== */
.main-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* ========================================================
   DROP AREA STYLES
   ======================================================== */
.drop-card {
    text-align: center;
    padding: 40px 25px;
}

.dropbox {
    border: 3px dashed var(--primary);
    border-radius: 8px;
    padding: 30px;
    transition: background-color 0.3s;
}

.dropbox.dragover {
    background-color: rgba(0, 123, 255, 0.05);
}

.drop-ico {
    font-size: 2em;
    font-weight: 600;
    color: var(--primary);
}

.drop-txt {
    font-size: 1.1em;
    margin: 10px 0 20px;
    color: var(--text-color);
}

.note {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 15px;
}


/* ========================================================
   BUTTON AND FORM ELEMENTS
   ======================================================== */
.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, transform 0.1s;
    font-weight: 600;
    margin-top: 5px;
}

.btn:hover {
    background-color: #0056b3;
}

.btn:active {
    transform: scale(0.98);
}

.btn.secondary {
    background-color: #6c757d;
}

.btn.secondary:hover {
    background-color: #5a6268;
}

input[type="number"], select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    width: 100%;
    margin-right: 10px;
}

/* ========================================================
   TOOL PANELS AND ROWS - FINAL FIX FOR SCROLLING/LAYOUT
   ======================================================== */
.tools {
    /* FIX 1: Parent container ko relative banayein */
    position: relative; 
    
    /* FIX 2: Sabse bade tool panel ki unchai ke hisaab se height dein.
       (Isse neeche ka SEO content upar nahi khisakega) */
    min-height: 250px; /* लेआउट शिफ्ट रोकने के लिए ज़रूरी */
    
    margin-bottom: 40px; 
    padding-bottom: 20px;
}

.tool-panel {
    /* FIX 3: Element ko document flow se hataein */
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%; 
    z-index: 10; 
    
    display: none;
    animation: fadeIn 0.3s;
}

.tool-panel.visible {
    /* अब यह absolute होने के बावजूद दिखाई देगा और लेआउट को डिस्टर्ब नहीं करेगा */
    display: block;
}

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

.row > input[type="number"], .row > select {
    flex-grow: 1;
}

.row > button {
    flex-shrink: 0;
}

.hint {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: -10px;
    margin-bottom: 15px;
}

.muted {
    font-size: 0.9em;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Responsive row adjustments */
@media (max-width: 600px) {
    .row {
        flex-direction: column;
        gap: 10px;
    }
    .row > input, .row > select, .row > button {
        width: 100%;
        margin-right: 0;
    }
}

/* ========================================================
   THUMBNAIL AREA
   ======================================================== */
.thumbs {
    padding: 15px;
}

.thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.thumb-item {
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    text-align: center;
    background-color: var(--background);
    width: 120px;
    transition: box-shadow 0.2s;
}

.thumb-item:hover {
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.thumb-img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 5px;
}

.thumb-filename {
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.thumb-status {
    font-size: 0.7em;
    color: var(--accent);
    font-weight: bold;
    margin-top: 3px;
}

/* ========================================================
   SEO CONTENT AND FOOTER
   ======================================================== */
.seo-content-ux {
    /* Ensures space above the content section */
    padding-top: 40px !important; 
}

.seo-content-ux h1 {
    font-size: 2em;
    color: var(--primary);
}

.seo-content-ux h3 {
    color: var(--accent);
    font-size: 1.2em;
}

.site-footer {
    text-align: center;
    padding: 20px 15px;
    margin-top: 40px;
    font-size: 0.9em;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
}

/* Keyframe for simple fade-in effect */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Utility Class */
.hidden {
    display: none !important;
}

/* ========================================================
   NOTIFICATION (TOAST) STYLES
   ======================================================== */
.toast-notification {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0; /* Initially hidden */
    transform: translateX(100%); /* Start off-screen to the right */
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

/* Success (Green) Style */
.toast-notification.success {
    background-color: #4CAF50; /* Green */
    border: 1px solid #388E3C;
}

/* Error (Red) Style */
.toast-notification.error {
    background-color: #f44336; /* Red */
    border: 1px solid #D32F2F;
}

/* Show State */
.toast-notification.show {
    opacity: 1;
    transform: translateX(0); /* Slide into view */
}
