* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #93c5fd;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --light: #f8fafc;
    --light-gray: #e2e8f0;
    --dark: #1e293b;
    --gray: #64748b;
    --border: #cbd5e1;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

body.dark-theme {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: var(--light);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dark-theme .header {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: #334155;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 22px;
    color: var(--primary);
}

.logo h1 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-gray);
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dark-theme .btn-icon {
    background: #334155;
    color: #cbd5e1;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 30px 0 25px;
}

.hero h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.hero p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
}

.dark-theme .hero p {
    color: rgba(255, 255, 255, 0.8);
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Converter Card */
.converter-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s;
}

.dark-theme .converter-card {
    background: #1e293b;
}

.converter-card:hover {
    transform: translateY(-4px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.card-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.card-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.card-body {
    padding: 20px;
}

/* Upload Section */
.upload-section {
    position: relative;
    margin-bottom: 20px;
}

.upload-placeholder {
    border: 2px dashed var(--primary);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    background: rgba(59, 130, 246, 0.03);
    cursor: pointer;
    transition: all 0.3s;
}

.dark-theme .upload-placeholder {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary-light);
}

.upload-placeholder:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary-dark);
}

.upload-placeholder.drag-over {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-dark);
}

.upload-placeholder i {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 12px;
    opacity: 0.8;
}

.upload-placeholder h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.dark-theme .upload-placeholder h4 {
    color: #f1f5f9;
}

.upload-placeholder p {
    color: var(--gray);
    margin-bottom: 12px;
    font-size: 12px;
}

.file-types {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.file-types span {
    padding: 4px 12px;
    background: var(--light-gray);
    border-radius: 4px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 500;
}

.dark-theme .file-types span {
    background: #334155;
    color: var(--primary-light);
}

.file-selected {
    display: none;
    background: var(--light);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
}

.dark-theme .file-selected {
    background: #0f172a;
    border-color: #334155;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.file-icon {
    font-size: 24px;
    color: var(--primary);
}

.file-details {
    flex: 1;
}

.file-details h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--dark);
}

.dark-theme .file-details h5 {
    color: #f1f5f9;
}

.file-details p {
    color: var(--gray);
    font-size: 11px;
}

.file-meta {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 500;
    font-size: 12px;
}

.dark-theme .file-meta {
    border-top-color: #334155;
}

/* Fast Tag */
.fast-tag {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-convert, .btn-remove {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow);
    width: 100%;
    margin-bottom: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--gray);
    border: 1px solid var(--border);
    width: 100%;
}

.dark-theme .btn-secondary {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-remove {
    background: none;
    color: var(--gray);
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
}

.btn-remove:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #ef4444;
}

.dark-theme .btn-remove:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-convert {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 12px;
    box-shadow: var(--shadow-lg);
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    animation: modalIn 0.3s;
}

.dark-theme .modal {
    background: #1e293b;
    color: #f1f5f9;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.dark-theme .modal-header {
    border-bottom-color: #334155;
}

.modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.modal-icon.success {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.modal-body p {
    color: var(--gray);
    font-size: 13px;
    margin-bottom: 16px;
}

.dark-theme .modal-body p {
    color: #cbd5e1;
}

/* Filename Edit Section */
.filename-edit {
    margin-top: 20px;
    text-align: left;
}

.filename-edit label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark);
}

.dark-theme .filename-edit label {
    color: #f1f5f9;
}

.filename-input {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.dark-theme .filename-input {
    border-color: #475569;
}

.filename-input input {
    flex: 1;
    padding: 10px;
    border: none;
    font-size: 13px;
    background: white;
    color: var(--dark);
}

.dark-theme .filename-input input {
    background: #334155;
    color: #f1f5f9;
}

.file-ext {
    background: var(--light-gray);
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--dark);
    border-left: 1px solid var(--border);
}

.dark-theme .file-ext {
    background: #475569;
    color: #f1f5f9;
    border-left-color: #64748b;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}

.dark-theme .modal-footer {
    border-top-color: #334155;
}

.btn-download {
    flex: 1;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-close-modal {
    flex: 1;
    background: var(--light-gray);
    color: var(--gray);
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.dark-theme .btn-close-modal {
    background: #334155;
    color: #cbd5e1;
}

.btn-download:hover, .btn-close-modal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ef4444;
    color: white;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    z-index: 1001;
    animation: toastIn 0.3s;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 300px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
}