:root {
    --primary-color: #4a90e2;
    --secondary-color: #f7f9fc;
    --text-color: #333;
    --white-color: #fff;
    --danger-color: #e74c3c; /* Our RED color */
    --success-color: #28a745; 
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    background-color: var(--white-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Navbar --- */
.navbar {
    background: var(--white-color);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 1000;
    width: 100%;
    position: sticky; /* Makes the navbar sticky */
    top: 0; /* Sticks it to the top of the viewport */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.menu-icon {
    display: none;
    cursor: pointer;
    position: relative;
    width: 25px;
    height: 23px;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: 0.4s;
}

.close-icon {
    display: none;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    position: absolute;
    top: -11px;
    left: 0;
}

/* --- Section Layout & Alternating Colors --- */
main, section {
    padding: 3rem 0;
	padding-top: 0.5rem;
}

main {
    background-color: var(--secondary-color); /* First section is light blue */
}

/* Tools section will be white, How it Works will be light blue, etc. */
section:nth-of-type(odd) {
    background-color: var(--white-color);
}

section:nth-of-type(even) {
    background-color: var(--secondary-color);
}


/* --- Main Converter Section --- */
.converter-section {
    text-align: center;
    background-color: var(--white-color);
    padding: 3rem;
	padding-top:10px !important;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.converter-section h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.free-text {
    color: var(--danger-color);
    font-weight: 600;
}

.converter-section .subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.upload-area {
    border: 3px dashed #dce8f8;
    border-radius: var(--border-radius);
    padding: 3rem;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #fcfdff;
}

.upload-area.dragover {
    background-color: #f0f5ff;
    border-color: var(--primary-color);
}

.upload-area p {
    margin-top: 1rem;
    font-size: 1.1rem;
}

.upload-area span {
    font-size: 0.9rem;
    color: #999;
    display: block;
    margin-top: 1rem;
}

.browse-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

#file-info {
    margin-top: 2rem;
    text-align: left;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#file-list {
    list-style: none;
    padding: 0;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 8px;
}
#file-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    word-break: break-all;
}
#file-list li:last-child {
    border-bottom: none;
}

.remove-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    font-size: 1.5rem;
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
    margin-left: 15px;
}
.remove-btn:hover {
    opacity: 0.7;
}


#tool-options {
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

#tool-options .option-group {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
#tool-options label {
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
#tool-options input, #tool-options select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    flex: 1;
    min-width: 0;
}

.tool-error-message {
    color: var(--danger-color);
    font-weight: 500;
    margin-top: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    background-color: #fddddd;
}

#process-btn {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 400px;
}

#output-section {
    margin-top: 2rem;
}

#download-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

#download-links a {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--success-color);
    color: var(--white-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #6c757d;
    margin-top: 0.5rem;
}
.btn-secondary:hover {
     background-color: #5a6268;
}

#reset-btn {
    background-color: #6c757d;
}
#reset-btn:hover {
    background-color: #5a6268;
}

/* --- Tools Section --- */
.tools-section {
	padding-top: 0px !important;
}
.tools-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.tool-category {
    margin-top: 3rem;
}
.tool-category h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--white-color);
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.tool-card img, .tool-card svg {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

.tool-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 90%;
    width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #aaa;
    cursor: pointer;
}
.modal-close-btn:hover {
    color: var(--text-color);
}
#modal-tool-grid .tools-section {
    padding: 0;
}

/* --- How it works Section --- */
.how-it-works-section {
    text-align: center;
}

.how-it-works-section h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.how-it-works-section .section-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto 3rem auto;
}

.steps {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    flex: 1;
    max-width: 300px;
}

.step .icon-container {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    color: white;
    transition: transform 0.3s ease;
}

.step:hover .icon-container {
    transform: scale(1.1);
}

.icon-container.upload {
    background: linear-gradient(135deg, #4299e1, #3182ce);
}
.icon-container.tool {
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}
.icon-container.download {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.step h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.step p {
    color: #555;
    line-height: 1.7;
}

.highlights-band {
    display: flex;
    justify-content: center;
    gap: 2rem;
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 4rem auto 0 auto;
    flex-wrap: wrap;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
}

.highlight-item svg {
    flex-shrink: 0;
}

/* --- Promo Section --- */
.promo-section {
    padding: 1.5rem 0; /* Reduced padding for better balance */
    text-align: center;
	padding-top:1rem;
	padding-bottom:2.5rem;
}
.promo-content {
    max-width: 650px;
    margin: 0 auto;
}
.promo-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.promo-content p {
    color: #555;
    margin-bottom: 1.5rem;
}
.promo-link {
    font-weight: 500;
}
.promo-link a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- Contact Section --- */
.contact-container {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.contact-info, .contact-form-container {
    flex: 1;
}

.contact-info h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.contact-info > p {
    color: #666;
    margin-bottom: 2rem;
    max-width: 450px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-icon {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.info-text p {
    margin: 0;
    color: #666;
}

.contact-form-container {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form .form-group-split {
    display: flex;
    gap: 1rem;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.contact-form label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color);
}

.contact-form input, .contact-form textarea {
    background: var(--white-color);
    border: 1px solid #ccc;
    color: var(--text-color);
    padding: 0.8rem;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
}

.contact-form input::placeholder, .contact-form textarea::placeholder {
    color: #999;
}

.form-status {
    text-align: center;
    margin-top: 1rem;
}


/* --- Footer --- */
footer {
    background-color: #333;
    color: var(--white-color);
    padding: 3rem 0 1.5rem 0;
}

.footer-main {
    display: flex;
    gap: 2rem;
    padding-bottom: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #555;
}

.footer-about {
    flex: 2;
}
.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white-color);
    margin: 0 0 1rem 0;
}
.footer-logo span {
    color: var(--primary-color);
}
.footer-description {
    color: #ccc;
    line-height: 1.7;
}

.footer-links {
    flex: 1.5;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--white-color);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-tools-list {
    column-count: 3;
    column-gap: 20px;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links ul a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    color: #ccc;
    font-size: 0.9rem;
}

.footer-highlights {
    display: flex;
    gap: 1.5rem;
}

.footer-highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

/* --- Custom styles for file info section --- */
#change-tool-btn {
    display: block;
    margin: 0 auto 20px auto;
}
#file-info p {
    text-align: center;
}
#add-more-btn {
    display: block;
    margin: 20px auto 0 auto;
}

.tools-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.tool-category, .tools-grid {
    display: contents;
}
.tools-section .tool-category h3 {
    display: none;
}

/* --- Scroll to Top Button --- */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 100;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    font-size: 18px;
    width: 50px;
    height: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: opacity 0.3s, visibility 0.3s;
    opacity: 0;
    visibility: hidden;
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollTopBtn:hover {
    background-color: #357abd;
}

	.contact-section {
		padding-top:3rem !important;
	}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .tools-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
	.contact-info h2 {
		text-align:center !important;
	}
	.contact-info > p {
		text-align:center !important;
	}
	.contact-section {
		padding-top:0rem !important;
	}
	.highlights-band {
		margin-top:1rem !important;
	}

}

@media (max-width: 820px) {
    .contact-container {
        flex-direction: column;
        align-items: center; 
    }
    .contact-info, .contact-form-container {
        width: 100%;
        box-sizing: border-box; /* Ensures padding is included in the width, preventing overflow */
    }
    .contact-info > p {
        max-width: 100%; /* Allows the paragraph to use the full width of its container on smaller screens */
    }
    .footer-main {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .converter-section h1 { font-size: 2.5rem; }
    .steps, .contact-form .form-group-split { flex-direction: column; }
    .steps { align-items: center; }

    .menu-icon {
        display: block;
    }

    .menu-icon.active .bar {
        display: none;
    }

    .menu-icon.active .close-icon {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: var(--white-color);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        text-align: right;
        padding: 0.8rem 2rem;
        border-bottom: 1px solid #eee;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .tools-grid-container {
        grid-template-columns: 1fr;
    }

    .highlights-band {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 1rem;
    }

    .footer-tools-list {
        column-count: 1;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-highlights {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    #scrollTopBtn {
        display: block;
    }

    #tool-options .option-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    #tool-options label {
        white-space: normal;
    }

    #tool-options input, #tool-options select {
        width: 100%;
        box-sizing: border-box;
    }
}
/* --- FIX for Modal Issues --- */

/* 1. Hide the category titles inside the popup modal */
#modal-tool-grid .tool-category h3 {
    display: none;
}

/* 2. Prevent the main page from scrolling when the modal is open */
body.modal-open {
    overflow: hidden;
}
.center-captcha {
    display: table;
    margin: 0 auto 15px;
}