/* Base Styles */
:root {
    --primary-color: #4a6cf7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7ff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    color: var(--dark-gray);
    line-height: 1.3;
}

p {
    margin-bottom: 1.25rem;
    color: #555;
}

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

a:hover {
    color: #3a5bd9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #3a5bd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
}

.btn-text {
    background: none;
    color: var(--primary-color);
    padding: 5px 10px;
}

.btn-text:hover {
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-gray);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--dark-gray);
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
}

/* Main Content */
.main-content {
    padding: 2rem 0 4rem;
}

.converter-section {
    margin-bottom: 4rem;
}

.converter-section h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    color: var(--dark-gray);
}

.subtitle {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Converter Box */
.converter-box {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.upload-area {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed #d1d5db;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover, #dropZone.dragover .upload-area {
    border-color: var(--primary-color);
    background-color: #f8f9ff;
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-gray);
}

.upload-area p {
    margin: 1rem 0;
    color: var(--secondary-color);
}

/* Preview Section */
.preview-container {
    margin-top: 1.5rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.preview-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
}

.preview-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

.preview-item:last-child {
    border-bottom: none;
}

.preview-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 1rem;
    background-color: #f8f9fa;
    padding: 4px;
    border: 1px solid #e9ecef;
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.preview-info h4 {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--secondary-color);
    flex-wrap: wrap;
}

.remove-btn {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.5rem;
    opacity: 0.7;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.remove-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Conversion Options */
.conversion-options {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.option {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option:last-child {
    margin-bottom: 0;
}

.option label {
    font-weight: 500;
    color: var(--dark-gray);
    display: block;
}

.option input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    margin: 0.5rem 0;
}

.option input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

/* Color Picker */
.color-picker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0;
    background: none;
    cursor: pointer;
}

.color-picker span {
    font-family: monospace;
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Select Dropdown */
select {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    font-size: 0.95rem;
    width: 100%;
    max-width: 300px;
    margin-top: 0.25rem;
}

/* Checkbox */
.option input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.option label[for] {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* Convert Button */
.btn-convert {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-convert i {
    animation: spin 2s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Download Section */
.download-section {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-top: 2rem;
}

.download-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.download-list {
    margin-bottom: 1.5rem;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.download-item:last-child {
    margin-bottom: 0;
}

.download-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.download-info i {
    color: var(--success-color);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.download-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
    flex-shrink: 0;
    margin-left: 1rem;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.file-size {
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Info Section */
.info-section {
    background: white;
    padding: 3rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}

.feature {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: #f8f9ff;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature h4 {
    margin-bottom: 0.75rem;
    color: var(--dark-gray);
}

/* FAQ Section */
.faq {
    margin-top: 3rem;
}

.faq h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.faq-question {
    padding: 1.25rem;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: #e9ecef;
}

.faq-question h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-gray);
    font-weight: 500;
}

.faq-answer {
    padding: 0 1.25rem;
    display: none;
    animation: fadeIn 0.3s ease;
    background: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.footer {
    background: #2d3748;
    color: #e2e8f0;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 {
    color: white;
    margin-bottom: 1.25rem;
}

.footer-section p {
    color: #cbd5e0;
    margin-bottom: 1.25rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section a {
    color: #cbd5e0;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #4a5568;
    color: #a0aec0;
    font-size: 0.9rem;
}

/* Loading State */
.loading .btn-convert i {
    display: inline-block;
}

.loading .btn-convert span {
    display: none;
}

/* Success/Error Messages */
.message {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message i {
    font-size: 1.25rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 2rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .converter-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .download-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .download-btn {
        width: 100%;
        margin: 0.5rem 0 0;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .converter-box {
        padding: 1.25rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .preview-item {
        flex-direction: column;
        text-align: center;
    }

    .preview-info {
        width: 100%;
        margin-top: 0.75rem;
        text-align: center;
    }

    .preview-meta {
        justify-content: center;
    }

    .conversion-options {
        padding: 1rem;
    }

    .btn-convert {
        font-size: 1rem;
    }
    
    .color-picker {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .faq-question h4 {
        font-size: 1rem;
        padding-right: 1rem;
    }
}
