:root {
    --primary: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg-dark: #0f172a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --radius-lg: 20px;
    --radius-md: 12px;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 10%, #1e1b4b 0%, #0f172a 100%);
    z-index: -1;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 60px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.hero-section {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s var(--transition);
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 20px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-sub);
    max-width: 600px;
    margin: 0 auto;
}

/* Upload Dropzone */
.upload-container {
    position: relative;
    background: var(--bg-card);
    border: 2px dashed var(--border);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    animation: fadeInUp 0.8s 0.2s both;
}

.upload-container:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
}

.upload-container.dragover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: 0.3s;
}

.upload-container:hover .icon-wrapper {
    background: var(--primary);
    color: white;
}

.icon-wrapper svg {
    width: 40px;
    height: 40px;
}

.text-group .main-text {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.text-group .sub-text {
    color: var(--text-sub);
}

.test-file-link {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.progress-bar {
    position: absolute;
    bottom: -10px;
    left: 20px;
    right: 20px;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    opacity: 0;
    transition: 0.3s;
}

.progress-bar.active {
    opacity: 1;
    bottom: 20px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s;
}

/* Results Section */
.results-container {
    margin-top: 60px;
    animation: fadeIn 0.8s;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.results-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
}

.file-result-section {
    margin-bottom: 60px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 30px;
}

.file-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-section-title::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z' /%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z' /%3E%3C/svg%3E") no-repeat center;
}

.file-content-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sub-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-sub);
    font-weight: 600;
}

.text-preview-box {
    width: 100%;
    max-height: 300px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: 'monospace', sans-serif;
    font-size: 0.9rem;
    color: #cbd5e1;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

.images-extraction-container {
    border-top: 1px solid var(--border);
    padding-top: 30px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    transform: scale(1.02);
}

.image-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #050b1a; /* Dark background for transparent/contain images */
    border-bottom: 1px solid var(--border);
}

.image-info {
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(0,0,0,0.1);
}

.image-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    min-width: 80px;
}

.btn-tiny {
    padding: 4px 10px;
    font-size: 0.65rem;
}

.btn.success {
    background: #10b981;
}

.hidden { display: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 60px;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 640px) {
    .title { font-size: 2.5rem; }
    .hero-section { margin-bottom: 40px; }
    .images-grid { grid-template-columns: 1fr; }
}
