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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    color: white;
    padding: 20px 20px 10px 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 0px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

main {
    background: #1e293b;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin: 10px 0;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-box {
    border: 3px dashed #06b6d4;
    border-radius: 15px;
    padding: 20px 20px;
    text-align: center;
    background: #334155;
    transition: all 0.3s ease;
}

.upload-box:hover {
    background: #475569;
    border-color: #0ea5e9;
}

.upload-box.drag-over {
    background: #475569;
    border-color: #0ea5e9;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.upload-box h3 {
    color: #06b6d4;
    margin-bottom: 10px;
}

.upload-box p {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.format-selection {
    margin-top: 30px;
    padding: 20px;
    background: #334155;
    border-radius: 15px;
}

.format-selection h3 {
    color: #06b6d4;
    margin-bottom: 15px;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.format-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #1e293b;
    border: 2px solid #475569;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-option:hover {
    border-color: #06b6d4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.format-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #06b6d4;
}

.format-option input[type="checkbox"]:checked + .format-label {
    color: #06b6d4;
}

.format-label {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: #e2e8f0;
}

.format-label strong {
    font-size: 1.1em;
    margin-bottom: 3px;
}

.format-label small {
    color: #94a3b8;
    font-size: 0.85em;
}

.selected-file-info {
    margin-top: 30px;
    padding: 25px;
    background: #064e3b;
    border: 2px solid #10b981;
    border-radius: 15px;
    animation: fadeIn 0.3s ease;
}

.selected-file-info h3 {
    color: #10b981;
    margin-bottom: 15px;
}

.selected-file-info p {
    color: #d1fae5;
    margin: 8px 0;
}

.selected-file-info strong {
    color: #34d399;
}

.btn-convert {
    margin-top: 20px;
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1em;
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: #334155;
    color: #06b6d4;
    border: 2px solid #06b6d4;
}

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

.processing-section {
    text-align: center;
    padding: 60px 20px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #334155;
    border-top: 4px solid #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.result-section {
    animation: fadeIn 0.5s ease;
}

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

.result-section h2 {
    color: #06b6d4;
    text-align: center;
    margin-bottom: 20px;
}

.result-info {
    background: #334155;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    color: #e2e8f0;
}

.result-info p {
    margin: 8px 0;
}

.result-actions {
    text-align: center;
    margin: 20px 0;
}

.result-files {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.file-card {
    background: #334155;
    border: 2px solid #475569;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.file-card:hover {
    border-color: #06b6d4;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
    transform: translateY(-2px);
}

.file-card h4 {
    color: #06b6d4;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.file-card p {
    color: #cbd5e1;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download {
    background: #06b6d4;
    color: white;
}

.btn-download:hover {
    background: #0891b2;
}

.btn-preview {
    background: #1e293b;
    color: #06b6d4;
    border: 1px solid #06b6d4;
}

.btn-preview:hover {
    background: #334155;
}

.preview-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #06b6d4;
    color: white;
    border-radius: 15px 15px 0 0;
}

.preview-content {
    background: #1e293b;
    max-width: 900px;
    max-height: 80vh;
    width: 100%;
    border-radius: 0 0 15px 15px;
    overflow: auto;
    padding: 30px;
    color: #e2e8f0;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

pre {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9em;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

footer {
    text-align: center;
    color: #cbd5e1;
    padding: 20px;
    font-size: 0.9em;
}

footer a {
    color: #06b6d4;
    text-decoration: underline;
}

footer a:hover {
    color: #0ea5e9;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .format-options {
        grid-template-columns: 1fr;
    }

    .result-files {
        grid-template-columns: 1fr;
    }
}
