:root {
    /* NEW: Unified Color Palette */
    --primary-color: #6366F1; /* Indigo 500 */
    --primary-color-dark: #4F46E5; /* Indigo 600 */
    --primary-color-light: #E0E7FF; /* Indigo 100 */
    
    --accent-green: #10B981; /* Emerald 500 */
    --accent-red: #EF4444; /* Red 500 */
    
    --text-dark: #1F2937; /* Gray 800 */
    --text-normal: #374151; /* Gray 700 */
    --text-light: #6B7280; /* Gray 500 */
    
    --bg-light: #F3F4F6; /* Gray 100 (Page Background) */
    --card-bg: #ffffff;
    --border-color: #E5E7EB; /* Gray 200 */

    --header-height: 65px;
    
    /* OLD COLORS (for reference, now replaced) */
    /* --primary-blue: #007bff; */
    /* --secondary-blue: #0056b3; */
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--bg-light); /* UPDATED: Use new light gray */
    color: var(--text-normal); /* UPDATED: Use new text color */
    line-height: 1.6;
    box-sizing: border-box;
    padding-top: var(--header-height);
}

/* ---------- NEW: Top Navigation Styles ---------- */
.top-nav {
    width: 100%;
    height: var(--header-height);
    background: var(--primary-color); /* UPDATED: Use primary color */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
}

.top-nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--card-bg); /* UPDATED: White text */
    text-decoration: none; /* NEW: Remove underline */
}

.main-nav {
    display: flex;
    gap: 10px;
}

.nav-button {
    padding: 10px 18px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85); /* UPDATED: Light white text */
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px 8px 0 0;
}

.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.1); /* UPDATED: Light hover */
    color: var(--card-bg);
}

.nav-button.active {
    color: var(--card-bg); /* UPDATED: White text */
    border-bottom-color: var(--card-bg); /* UPDATED: White border */
    background-color: rgba(255, 255, 255, 0.15); /* UPDATED: Light active bg */
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.8em;
    color: var(--card-bg); /* UPDATED: White icon */
    background: transparent;
    border: none;
    cursor: pointer;
}
/* ---------- END: Top Navigation Styles ---------- */


/* UPDATED: Wrapper for the centered card */
.content-container {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-grow: 1;
    padding: 30px;
    box-sizing: border-box;
}

/* UPDATED: .page-wrapper is now the single white card */
.page-wrapper {
    text-align: center;
    background: var(--card-bg);
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07); /* UPDATED: Softer shadow */
    max-width: 1000px;
    width: 100%;
    border: 1px solid var(--border-color); /* NEW: Subtle border */
    overflow: hidden;
    transition: max-width 0.4s ease-out;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page-wrapper.container-wide {
    max-width: 1200px;
}

/* UPDATED: main-content is now inside the card */
.main-content {
    padding: 35px 45px 45px 45px;
    overflow-x: hidden;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}


/* Tool Page styling */
.tool-page {
    display: none;
}

/* UPDATED: Drag/drop active state on main page */
.tool-page.dragover .drop-zone {
    border-color: var(--primary-color); /* UPDATED */
    background-color: #fcfaff; /* UPDATED: Light purple */
}
.tool-page.dragover .drop-zone-icon {
    transform: scale(1.1);
    color: var(--primary-color); /* UPDATED */
}


.tool-page.active {
    display: block;
}


h1,
.tool-page h2 {
    color: var(--primary-color); /* UPDATED */
    margin-bottom: 15px;
    font-weight: 700;
    font-size: 2.2em;
}

.pricing-card h3,
.enterprise-cta h3 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-dark); /* UPDATED: Darker text */
    margin: 0 0 15px 0;
    text-align: center;
}
.pricing-card.featured h3 {
    color: var(--primary-color); /* UPDATED */
    font-weight: 700;
}
.enterprise-cta h3 {
    font-size: 1.8em;
    color: var(--text-dark);
}


p.subtitle {
    color: var(--text-light); /* UPDATED */
    margin-bottom: 30px;
    font-size: 1.05em;
}

.internal-link {
    color: var(--primary-color); /* UPDATED */
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.internal-link:hover {
    text-decoration: underline;
}


.fileInput {
    display: none;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    gap: 10px;
}

.drop-zone {
    border: 2px dashed var(--border-color); /* UPDATED: Softer dash */
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #fcfcfc;
    transition: all 0.3s ease;
    margin-bottom: 25px;
}

.drop-zone-icon {
    font-size: 3em;
    color: var(--border-color); /* UPDATED */
    transition: all 0.3s ease;
}

.drop-zone-text {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--text-light); /* UPDATED */
    margin-bottom: 15px;
}

.drop-zone .custom-file-upload {
    margin-top: 0px;
}


.custom-file-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    cursor: pointer;
    background-color: var(--primary-color); /* UPDATED */
    color: var(--card-bg); /* UPDATED */
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); /* UPDATED: Purple shadow */
    border: none;
}

.custom-file-upload:hover {
    background-color: var(--primary-color-dark); /* UPDATED */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4); /* UPDATED */
}

/* Image Preview Style */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    object-fit: contain;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    padding: 10px;
    background-color: var(--bg-light); /* UPDATED */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-height: 100px;
}

.pdf-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ced4da;
    background-color: var(--card-bg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pdf-preview-item:active {
    cursor: grabbing;
}

.pdf-preview-item.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pdf-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-select: none;
}

.pdf-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 12px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}
.pdf-preview-item .remove-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);
}

.resize-inputs-wrapper {
    display: flex;
    flex-grow: 1;
    gap: 8px;
    align-items: center;
}

.options-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.options-group label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 1.0em;
    text-align: left;
    flex-basis: 140px;
    flex-shrink: 0;
}

.options-group select,
.options-group .resize-input {
    flex-grow: 1;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-light); /* UPDATED */
    font-family: 'Poppins', sans-serif;
    font-size: 1.0em;
    min-height: 44px;
}

.options-group .resize-input {
    width: 100px;
    flex-grow: 1;
    text-align: center;
    -moz-appearance: textfield;
}

.options-group .resize-input::-webkit-outer-spin-button,
.options-group .resize-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.resize-group {
    gap: 8px !important;
}

#imgToolkitLockRatio {
    cursor: pointer;
    color: var(--primary-color); /* UPDATED */
    font-size: 1.2em;
    padding: 5px;
    transition: color 0.3s ease;
}
#imgToolkitLockRatio.unlocked {
    color: #adb5bd;
}

#imgToolkitQualityGroup {
    display: none;
}
#imgToolkitQuality {
    flex-grow: 1;
    cursor: pointer;
    /* NEW: Style range input */
    accent-color: var(--primary-color);
}
#imgToolkitQualityValue {
    width: 45px;
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
}

.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.action-button {
    flex: 1;
    background-color: var(--accent-green); /* UPDATED */
    color: white;
    border: none;
    padding: 14px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2); /* UPDATED: Green shadow */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3); /* UPDATED */
}

/* UPDATED: Secondary "Clear" button style */
.action-button.clear-button {
    background-color: transparent;
    color: var(--text-light); /* UPDATED */
    box-shadow: none;
    border: 2px solid var(--border-color);
}
.action-button.clear-button:hover:not(:disabled) {
    background-color: var(--bg-light);
    border-color: var(--text-light);
    box-shadow: none;
    transform: translateY(-2px);
}

.action-button:disabled {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
    border: none;
}
.action-button.clear-button:disabled {
    background-color: transparent;
    color: #adb5bd;
    border-color: var(--border-color);
}


.progress-section {
    margin-top: 30px;
    text-align: left;
    padding: 0 10px;
}

.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
    height: 10px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color); /* UPDATED */
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9em;
    color: var(--text-light); /* UPDATED */
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.status-message {
    margin-top: 25px;
    color: var(--primary-color); /* UPDATED */
    font-weight: 600;
    min-height: 25px;
    font-size: 1.1em;
}

.status-message.error {
    color: var(--accent-red); /* UPDATED */
}


/* ---------- Pricing Page Styles ---------- */
.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
}

.pricing-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.pricing-card.featured {
    border-color: var(--primary-color); /* UPDATED */
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15); /* UPDATED */
}

.pricing-card .plan-description {
    font-size: 0.9em;
    color: var(--text-light); /* UPDATED */
    text-align: center;
    margin: -10px 0 15px 0;
    min-height: 40px;
}

.pricing-card .price {
    font-size: 2.8em;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 25px;
    text-align: center;
}

.pricing-card .price span {
    font-size: 0.5em;
    font-weight: 500;
    color: var(--text-light); /* UPDATED */
    margin-left: 5px;
}

.pricing-card .price.custom-price {
     font-size: 2.2em;
     padding-top: 13px;
     padding-bottom: 13px;
}

.features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    flex-grow: 1;
}

.features li {
    margin-bottom: 12px;
    font-size: 1.0em;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-normal); /* UPDATED */
}

.features li .fas {
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}

.features li .fa-check {
    color: var(--accent-green); /* UPDATED */
}

.features li .fa-times {
    color: var(--accent-red); /* UPDATED */
}

.cta-button {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    background-color: var(--text-light); /* UPDATED */
    color: var(--card-bg);
    margin-top: auto;
}

.cta-button.primary {
    background-color: var(--primary-color); /* UPDATED */
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3); /* UPDATED */
}

.cta-button:hover:not(.primary) {
    background-color: var(--text-normal); /* UPDATED */
}

.cta-button.primary:hover {
    background-color: var(--primary-color-dark); /* UPDATED */
    transform: translateY(-2px);
}

/* Enterprise CTA Box */
.enterprise-cta {
    text-align: center;
    margin-top: 40px;
    padding: 30px;
    background-color: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.enterprise-cta p {
    font-size: 1.05em;
    color: var(--text-light); /* UPDATED */
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.enterprise-cta .cta-button {
    max-width: 300px;
    margin-top: 0;
    background-color: var(--text-dark);
}
.enterprise-cta .cta-button:hover {
    background-color: var(--text-normal); /* UPDATED */
}

/* ---------- END: Pricing Page Styles ---------- */

/* ---------- SEO FIX: New Features Section Styles ---------- */
.page-features {
    padding: 30px 45px;
    background-color: var(--bg-light);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    text-align: left;
    border-radius: 0;
    box-shadow: none;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.feature-item .fas {
    font-size: 1.8em;
    color: var(--primary-color); /* UPDATED */
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 5px 0;
}

.feature-item p {
    font-size: 0.9em;
    color: var(--text-light); /* UPDATED */
    margin: 0;
    line-height: 1.5;
}

/* ---------- SEO FIX: New Footer Styles ---------- */
.page-footer {
    padding: 25px 45px;
    background-color: #e9ecef;
    border-top: 1px solid var(--border-color);
    text-align: center;
    border-radius: 0;
    box-shadow: none;
}
.page-footer p {
    margin: 0 0 5px 0;
    font-size: 0.85em;
    color: var(--text-light); /* UPDATED */
    line-height: 1.6;
}
.page-footer a {
    color: var(--primary-color); /* UPDATED */
    font-weight: 600;
    text-decoration: none;
}
.page-footer a:hover {
    text-decoration: underline;
}


/* ---------- Responsive Design ---------- */
@media (max-width: 768px) {
    body {
        -webkit-text-size-adjust: 100%;
        padding-top: var(--header-height);
    }

    .content-container {
        width: 100%;
        padding: 20px;
        min-height: 0;
        align-items: flex-start;
    }

    .page-wrapper {
        width: 100%;
        padding: 0;
        margin: 0;
        gap: 0;
    }

    /* ---------- NEW: Mobile Nav Styles ---------- */
    .main-nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        padding: 10px;
        box-shadow: 0 8px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--border-color);
        gap: 5px;
    }
    .main-nav.active {
        display: flex;
    }
    .nav-button {
        justify-content: flex-start;
        padding: 15px 20px;
        border-bottom: none;
        border-radius: 8px;
        color: var(--text-normal); /* UPDATED: Dark text on white bg */
    }
    .nav-button:hover {
        background-color: var(--bg-light); /* UPDATED */
        color: var(--primary-color); /* UPDATED */
    }
    .nav-button.active {
        border-bottom: none;
        background-color: var(--primary-color-light); /* UPDATED */
        color: var(--primary-color); /* UPDATED */
    }
    .mobile-menu-toggle {
        display: block;
    }
    .mobile-menu-toggle .fa-times {
        display: none;
    }
    .mobile-menu-toggle.active .fa-bars {
        display: none;
    }
    .mobile-menu-toggle.active .fa-times {
        display: block;
    }
    /* ---------- END: Mobile Nav Styles ---------- */


    .main-content {
        padding: 25px 20px 30px 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .tool-page h1,
    .tool-page h2 {
        font-size: 1.8em;
    }
    
    p.subtitle {
        font-size: 0.95em;
        margin-bottom: 25px;
    }

    .file-upload-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .custom-file-upload {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        box-sizing: border-box;
    }

    .options-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-bottom: 15px;
    }

    .options-group label {
        flex-basis: auto;
        text-align: left;
        margin-bottom: 2px;
    }
    
    .options-group select,
    .options-group .resize-input {
        font-size: 1.0em;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }

    .action-button {
        width: 100%;
        box-sizing: border-box;
    }

    .status-message {
        font-size: 1em;
        min-height: 20px;
    }

    .pdf-preview-item {
        width: 80px;
        height: 80px;
    }

    .page-features {
        grid-template-columns: 1fr;
        padding: 25px 20px;
        gap: 20px;
    }
    .feature-item {
        align-items: center;
        text-align: center;
    }

    .page-footer {
        padding: 20px;
    }
}

/* Tablet view for pricing grid */
@media (min-width: 769px) and (max-width: 991px) { /* Updated breakpoint */
     .page-wrapper.container-wide {
        max-width: 1200px;
     }
     .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
    }
     .pricing-card.featured {
        transform: scale(1.03); 
    }
    .page-features {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop view for pricing grid */
@media (min-width: 992px) {
    .page-wrapper.container-wide {
        max-width: 1200px;
    }
    .pricing-grid {
        grid-template-columns: repeat(4, 1fr); /* UPDATED: Show 4 columns */
    }
     .pricing-card.featured {
        transform: scale(1); /* UPDATED: Remove scaling to fit 4 columns */
    }
     .pricing-card:hover { /* NEW: Add hover rule to re-apply hover effect */
        transform: translateY(-5px);
    }
    .page-features {
        grid-template-columns: 1fr 1fr;
    }
}

