/* ===================================================================
   Global Root Variables
   ===================================================================
   Defines the core color palette and custom properties used throughout
   the application. Updated to a cleaner, lighter, and more professional
   software-inspired theme with soft blues, crisp whites, and subtle accents
   for a modern, premium SaaS/productivity tool appearance.
   =================================================================== */

:root {
    --primary-color: #2563eb;      /* Deep blue - main brand/action color */
    --secondary-color: #f1f5f9;    /* Very light slate - secondary backgrounds */
    --success-color: #059669;      /* Emerald green - success states */
    --danger-color: #dc2626;       /* Bright red - errors/warnings */
    --warning-color: #d97706;      /* Amber - warnings/cautions */
    --info-color: #0891b2;         /* Cyan - informational elements */
    --dark-color: #0f172a;         /* Deep slate - primary text */
    --light-color: #ffffff;       /* Pure white - cards & main backgrounds */
    --software-bg: #f0f9ff;        /* Very light sky blue - subtle highlight areas */
    --software-border: #bae6fd;    /* Soft sky border - gentle separation */
}

/* ===================================================================
   Base Typography & Body Styles
   ===================================================================
   Sets global font, background, text color, and line height for a clean,
   readable, and professional appearance. Uses a light overall background
   to reduce eye strain and give a premium software feel.
   =================================================================== */

body {
    font-family: 'Calibri', Arial, sans-serif;
    /* Ultra-light background for a fresh, modern software aesthetic */
    background-color: #f0f9ff; 
    color: var(--dark-color);
    line-height: 1.7;
    margin: 0;
}

/* ===================================================================
   Navbar Styles
   ===================================================================
   Clean white navbar with subtle elevation. Provides a professional
   header that stays light and unobtrusive while maintaining clear
   hierarchy.
   =================================================================== */

.navbar {
    background: var(--light-color);
    box-shadow: 0 8px 12px rgb(0 0 0 / 8%); /* shadow */
    width: 100%;
    padding: 12px 20px;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--dark-color) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.nav-link {
    color: var(--dark-color) !important;
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.image-extractor-link {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: var(--light-color) !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.image-extractor-link i {
    font-size: 1.2rem;
    color: var(--light-color);
}

.image-extractor-link:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: var(--light-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.navbar .container-fluid {
    max-width: 1200px;
    margin: 0 auto;
}

/* ===================================================================
   Main Container
   ===================================================================
   Centered card-like container with increased breathing room, subtle
   shadow, and a prominent top accent border for professional hierarchy.
   =================================================================== */

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px; /* Increased padding */
    background: var(--light-color);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.05); /* Lighter shadow */
    border-top: 5px solid var(--primary-color); /* Highlight border */
}

/* ===================================================================
   Header Section
   ===================================================================
   Centered page title with subtle bottom border for clean separation.
   =================================================================== */

.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0; /* Softer border */
}

.header h1 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.header h1 b {
    color: var(--primary-color);
}

.header p {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 400;
}

/* ===================================================================
   Hint / Info Alert
   ===================================================================
   Subtle light blue alert box for helpful tips with soft borders.
   =================================================================== */

.hint-alert {
    /* Lighter hint background */
    background-color: #f0f9ff; 
    border: 1px solid #bae6fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 1rem;
    color: var(--dark-color);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hint-alert i {
    color: var(--info-color);
    font-size: 1.2rem;
    margin-top: 2px;
}

.hint-alert a {
    color: var(--danger-color);
    font-weight: 600;
    text-decoration: underline;
}

/* ===================================================================
   Form Elements
   ===================================================================
   Clean, modern input styling with subtle focus states and monospaced
   font for URL/code input.
   =================================================================== */

.form-group {
    margin-bottom: 20px;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--dark-color);
}

textarea {
    width: 100%;
    min-height: 200px; /* Taller textarea */
    padding: 12px;
    border: 2px solid #e2e8f0; /* Thicker border */
    border-radius: 8px;
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace; /* Monospaced font for code/urls */
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #f8fafc; /* Slightly darker background for input */
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); /* Stronger focus ring */
    background-color: var(--light-color);
}

/* ===================================================================
   Primary Button Styles
   ===================================================================
   Modern elevated button with hover lift effect and loading state.
   =================================================================== */

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 25px; /* Larger button */
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    opacity: 0.6;
}

.btn-loading {
    position: relative;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px; /* Larger spinner */
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-loading-spinner 0.8s linear infinite;
}

@keyframes btn-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* ===================================================================
   Results Container
   ===================================================================
   Clean recessed panel for processing results with subtle inset shadow.
   =================================================================== */

.results-container {
    margin-top: 40px;
    padding: 25px;
    background-color: #f8fafc; /* Light background for results */
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05); /* Inset shadow */
    border: 1px solid var(--software-border);
    display: none;
}

/* ===================================================================
   Download Alert & Progress Bar
   ===================================================================
   Prominent warning-style alert and smooth animated progress bar.
   =================================================================== */

.download-alert {
    margin-bottom: 20px;
    padding: 15px;
    background-color: var(--warning-color);
    color: var(--light-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.download-alert .btn-close {
    filter: invert(100%);
    opacity: 0.8;
    background-size: 12px;
}

.progress-container {
    height: 30px; /* Taller progress bar */
    background-color: #e2e8f0;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, var(--primary-color));
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-color);
    font-weight: 600;
    font-size: 14px;
}

/* ===================================================================
   Statistics Cards
   ===================================================================
   Responsive grid of stat cards with subtle elevation and left accent.
   =================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--light-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 3px solid var(--primary-color);
    text-align: center;
}

.stat-card h3 {
    margin-top: 0;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card p {
    margin-bottom: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
}

.success { color: var(--success-color); }
.danger { color: var(--danger-color); }
.warning { color: var(--warning-color); }
.info { color: var(--info-color); }

/* ===================================================================
   Success / Completion State
   ===================================================================
   Prominent success panel with soft highlight background and grid summary.
   =================================================================== */

.success-container {
    display: none;
    text-align: center;
    background: var(--software-bg); /* Highlight completed state */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 2px solid var(--success-color);
}

.success-container h2 {
    color: var(--success-color);
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 700;
}

.success-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.success-card {
    background: var(--light-color);
    padding: 18px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.success-card h3 {
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
}

.success-card p {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--dark-color);
}

/* ===================================================================
   Messages / Log Area
   ===================================================================
   Scrollable log with color-coded message types and clean separators.
   =================================================================== */

.messages-container {
    max-height: 350px; /* Taller log area */
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: var(--light-color);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
}

.message {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9; /* Lighter separator */
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
}

.message:last-child {
    border-bottom: none;
}

.message i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 3px;
}

.message-success {
    background-color: rgba(16, 185, 129, 0.05);
    color: #047857;
}

.message-error {
    background-color: rgba(239, 68, 68, 0.05);
    color: #b91c1c;
}

.message-warning {
    background-color: rgba(245, 158, 11, 0.05);
    color: #d97706;
}

.message-info {
    background-color: rgba(6, 182, 212, 0.05);
    color: #0891b2;
}

/* ===================================================================
   Real-time Stats Bar
   ===================================================================
   Dark accent bar for live statistics during processing.
   =================================================================== */

.real-time-stats {
    display: flex;
    justify-content: space-between;
    background: var(--dark-color);
    color: var(--light-color);
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1rem;
}

.real-time-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================================================================
   URL Input Section Enhancements
   ===================================================================
   Collapsible URL list with count indicators and toggle control.
   =================================================================== */

.url-section {
    position: relative;
    margin-bottom: 20px;
}

.url-section.collapsed textarea {
    display: none;
}

/* Make count display flexible and visible when URLs are present */
.url-info-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.url-info-text {
    /* Now flex by default when JS updates the display style */
    display: none; 
    font-size: 1.05rem;
    color: var(--dark-color);
    font-weight: 500;
}

.url-info-text b {
    font-weight: 700;
}

.unique-count-text {
    color: var(--success-color);
    margin-left: 15px; /* Added spacing */
}

.duplicate-count-text {
    color: var(--warning-color);
    margin-left: 15px;
}

.toggle-urls-btn {
    display: none;
    margin-left: 10px;
    font-size: 0.95rem;
    color: var(--danger-color); /* Use danger color to make it stand out */
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.toggle-urls-btn:hover {
    color: #b91c1c;
}

#zip-download {
    margin-top: 30px;
    text-align: center;
}

/* ===================================================================
   Feature Grid (Marketing/Info Section)
   ===================================================================
   Responsive cards highlighting app features with subtle hover lift.
   =================================================================== */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.feature-card {
    padding: 25px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-top: 4px solid var(--primary-color);
    transition: transform 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.feature-card i {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Enhanced Chrome Extension Card Styles */
.extension-card {
    position: relative;
    border-top: 4px solid #4285f4; /* Google blue accent */
    overflow: hidden;
}

.extension-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #4285f4, #ea4335, #fbbc05, #34a853); /* Full Chrome color stripe */
    opacity: 0.9;
}

.extension-icon-wrapper {
    text-align: center;
    margin-bottom: 10px;
}

.extension-img-icon {
    width: 100px; /* Larger for better visibility */
    height: 100px;
    transition: transform 0.3s ease;
}

.extension-card:hover .extension-img-icon {
    transform: scale(1.08);
}

.extension-card h3 {
    font-size: 1.45rem;
    margin-top: 10px;
    margin-bottom: 12px;
    text-align: center;
}


.extension-card p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Install Badge - Prominent & Beautiful CTA */
.install-badge {
    background: linear-gradient(135deg, #34a853, #4285f4); /* Google green-to-blue */
    color: white !important;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

.install-badge:hover {
    background: linear-gradient(135deg, #2d8f47, #3367d6);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 168, 83, 0.4);
}

.install-badge::before {
    content: '\f019'; /* Font Awesome download icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 1.1rem;
}

/* New Launch Badge */
.new-badge {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(236, 72, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

/* Coming row spacing */
.coming-row {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.free-badge {
    background: #ecfeff;
    color: #065f46;
    padding: 6px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid #bbf7d0;
}

.platform-icons i {
    margin-left: 8px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.feature-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.feature-card p {
    font-size: 1rem;
    color: #475569;
    line-height: 1.6;
}

/* ===================================================================
   Footer
   ===================================================================
   Clean dark footer with accent border and centered content.
   =================================================================== */

footer {
    text-align: center;
    margin-top: 40px;
    /* padding: 25px; */
    /* background: var(--dark-color); */
    /* color: var(--light-color); */
    /* font-size: 14px; */
    border-top: 4px solid var(--primary-color);
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    /* gap: 15px; */
}

footer a {
    color: var(--success-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

footer a:hover {
    text-decoration: underline;
    color: #34d399;
}

.india-flag {
    font-size: 20px;
}

/* ===================================================================
   Content Sections (About/Features)
   ===================================================================
   Styled headings and paragraph formatting for informational content.
   =================================================================== */

section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

section h2 i {
    color: var(--warning-color);
    margin-right: 10px;
}

section p {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    text-align: justify;
    color: #334155;
}

section a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

section a:hover {
    text-decoration: underline;
}

.btn-success {
    font-family: 'Calibri', Arial, sans-serif;
    font-weight: 600;
}

/* ===================================================================
   Responsive Adjustments
   ===================================================================
   Mobile-friendly adjustments for smaller screens.
   =================================================================== */

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    footer {
        flex-direction: column;
        gap: 8px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}