/* Thiết kế CSS Thuần Hiện Đại - Phong cách UI/UX Clean Minimalist */
:root {
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --primary-hover: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-hover: #4f46e5;
    --radius-lg: 16px;
    --radius-md: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    line-height: 1.5;
}

/* Header Component */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.logo-area i {
    color: #4f46e5;
    width: 24px;
    height: 24px;
}

.icon-spin {
    animation: spin 8s linear infinite;
}

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

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main Content Layout */
.main-content {
    max-width: 768px;
    margin: 0 auto;
    padding: 3rem 1rem;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.title-section {
    text-align: center;
    margin-bottom: 2rem;
}

.title-section h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

.title-section p {
    color: var(--text-muted);
    max-width: 450px;
    margin: 0 auto;
    font-size: 1rem;
}

/* Error Box */
.alert-box {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #b91c1c;
    font-size: 0.875rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.alert-box i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Form Container Card */
.converter-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#uploadForm {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Drag & Drop Area */
.drop-zone {
    border: 2px dashed #cbd5e1;
    background-color: rgba(248, 250, 252, 0.5);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease-in-out;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--border-hover);
    background-color: rgba(79, 70, 229, 0.03);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    color: #94a3b8;
    transition: color 0.2s;
}

.drop-zone:hover .icon-wrapper {
    color: #4f46e5;
}

.prompt-text {
    font-size: 0.875rem;
}

.highlight {
    font-weight: 600;
    color: #4f46e5;
}

.sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Image Preview Block */
.preview-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

.preview-container img {
    max-height: 192px;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

.file-info {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.btn-change {
    pointer-events: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

.btn-change:hover {
    color: #dc2626;
}

/* Output Configuration Box */
.config-bar {
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .config-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.config-label {
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.config-label i {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

@media (min-width: 640px) {
    .select-wrapper {
        width: 210px;
    }
}

.select-wrapper select {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.select-wrapper select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 1px #4f46e5;
}

.select-icon {
    position: absolute;
    inset-y: 0;
    right: 0;
    display: flex;
    align-items: center;
    padding-right: 0.75rem;
    pointer-events: none;
    color: #94a3b8;
}

.select-icon i {
    width: 16px;
    height: 16px;
}

/* Custom Submit Button Component */
.btn-submit {
    width: 100%;
    background: var(--primary-gradient);
    color: #ffffff;
    font-weight: 600;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
}

.btn-submit:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.btn-submit i {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.btn-submit:hover i {
    transform: translateY(2px);
}

/* Footer Section */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}