/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

/* Header and Navigation */
header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo h1 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.95;
}

/* Ad Placeholders */
.ad-section {
    padding: 2rem 0;
    background: var(--bg-tertiary);
}

.ad-placeholder {
    background: var(--bg-primary);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 auto;
    transition: all 0.3s;
}

.ad-placeholder:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.ad-banner {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

.ad-sidebar {
    width: 100%;
    max-width: 300px;
    height: 250px;
    margin: 0 auto;
}

.ad-placeholder p {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ad-placeholder span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Section Styles */
section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

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

/* Converter Section */
.converter-section,
.resizer-section {
    background: #1f2937;
    color: #ffffff;
}

.converter-section h2,
.resizer-section h2 {
    color: #ffffff;
}

.converter-section .section-description,
.resizer-section .section-description {
    color: #d1d5db;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 2rem;
}

.converter-section .upload-area,
.resizer-section .upload-area {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.converter-section .upload-area:hover,
.resizer-section .upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.converter-section .upload-area.dragover,
.resizer-section .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--primary-color);
}

.converter-section .upload-icon,
.resizer-section .upload-icon {
    color: var(--primary-color);
    filter: brightness(1.2);
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.converter-section .upload-content h3,
.resizer-section .upload-content h3 {
    color: #ffffff;
}

.upload-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.converter-section .upload-content p,
.resizer-section .upload-content p {
    color: #d1d5db;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.converter-section .file-info,
.resizer-section .file-info {
    color: #9ca3af;
}

/* Preview Container */
.preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.preview-box {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.converter-section .preview-box,
.resizer-section .preview-box {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-box h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.converter-section .preview-box h4,
.resizer-section .preview-box h4 {
    color: #ffffff;
}

.preview-box img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.svg-preview {
    max-width: 100%;
    max-height: 300px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.converter-section .svg-preview {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    min-height: 200px;
}

.svg-preview {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svg-preview svg {
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    display: block;
}

.converter-section .svg-preview svg {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    padding: 8px;
}

/* Resizer Controls */
.resizer-preview {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.resizer-section .resizer-preview {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.resizer-preview h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.resizer-section .resizer-preview h4 {
    color: #ffffff;
}

.resizer-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}

.resizer-options {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
}

.resizer-section .resizer-options {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.option-group {
    margin-bottom: 1.5rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.converter-section .option-group label,
.resizer-section .option-group label {
    color: #ffffff;
}

.option-group input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.converter-section .option-group input[type="number"],
.resizer-section .option-group input[type="number"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.option-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.converter-section .option-group input[type="number"]:focus,
.resizer-section .option-group input[type="number"]:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.15);
}

.option-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.converter-section .option-group input[type="checkbox"],
.resizer-section .option-group input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.option-group input[type="range"] {
    width: calc(100% - 60px);
    margin-right: 10px;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.converter-section .option-group input[type="range"],
.resizer-section .option-group input[type="range"] {
    background: rgba(255, 255, 255, 0.2);
}

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

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

.option-group span {
    display: inline-block;
    min-width: 50px;
    font-weight: 500;
    color: var(--primary-color);
}

.converter-section .option-group span,
.resizer-section .option-group span {
    color: var(--primary-color);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* About Section */
.about-section {
    background: var(--bg-secondary);
}

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

.feature-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* FAQ Section */
.faq-section {
    background: var(--bg-primary);
}

.faq-list {
    max-width: 800px;
    margin: 2rem auto 0;
}

.faq-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: box-shadow 0.3s;
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Footer */
footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    margin: 0;
    padding: 0;
}

.footer-brand {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    padding: 0;
    font-size: 1.5rem;
    line-height: 32px;
    font-weight: 600;
    margin-block-start: 0;
    margin-block-end: 0;
    display: block;
    height: 32px;
    box-sizing: border-box;
    transform: translateY(4px);
}

/* Contact Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--bg-primary);
    margin: auto;
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    transition: color 0.3s;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.contact-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
}

.contact-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.contact-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 2rem 1.5rem;
        width: 95%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

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

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

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        gap: 0.5rem;
    }

    .logo-img {
        height: 32px;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .ad-banner {
        max-width: 100%;
        height: 90px;
    }

    .ad-sidebar {
        max-width: 100%;
        height: 250px;
    }

    section {
        padding: 2rem 0;
    }

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

    .loading-spinner-container {
        padding: 2rem 1.5rem;
        min-width: 240px;
    }

    .loading-spinner-img {
        width: 48px;
        height: 48px;
    }

    .loading-message {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo-img {
        height: 28px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    section h2 {
        font-size: 1.5rem;
    }

    .upload-content h3 {
        font-size: 1.25rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all;
}

.loading-overlay.show {
    opacity: 1;
}

.loading-spinner-container {
    background: var(--bg-primary);
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-width: 280px;
    text-align: center;
}

.loading-spinner-img {
    width: 64px;
    height: 64px;
    animation: spin 1.5s linear infinite;
}

.loading-message {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* Success Message */
.success-message {
    background: var(--success-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
}

