:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #14b8a6;
    --bg-color: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: #e2e8f0;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --purple: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Blobs for Glassmorphism effect */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.4) 0%, rgba(79, 70, 229, 0) 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.3) 0%, rgba(20, 184, 166, 0) 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 60%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0) 70%);
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Typography and Layout */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.app-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.icon-logo {
    font-size: 2.5rem;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background-color: rgba(79, 70, 229, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    background-color: rgba(79, 70, 229, 0.08);
    border-color: var(--primary-hover);
    transform: scale(1.02);
}

.icon-upload {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.drop-zone h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.file-types {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hidden-input {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

/* File List */
.file-list-container {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.file-list-container h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.file-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.file-item i {
    margin-right: 0.75rem;
    color: var(--primary);
}

.file-item .remove-file {
    margin-left: auto;
    color: #ef4444;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    border-radius: 4px;
}

.file-item .remove-file:hover {
    background: #fee2e2;
}

/* Results Section */
.results-section {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.results-header h2 {
    color: var(--success);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-box {
    background: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.download-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-icon.blue {
    background: #eff6ff;
    color: var(--info);
}

.card-icon.green {
    background: #ecfdf5;
    color: var(--success);
}

.card-icon.purple {
    background: #f3e8ff;
    color: var(--purple);
}

.card-content {
    flex-grow: 1;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card-content p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-download {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #94a3b8;
}

.btn-download.blue:not(:disabled) {
    background: var(--info);
    color: white;
}

.btn-download.green:not(:disabled) {
    background: var(--success);
    color: white;
}

.btn-download.purple:not(:disabled) {
    background: var(--purple);
    color: white;
}

.btn-download:not(:disabled):hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.hidden {
    display: none !important;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Data Preview Section */
.data-preview-section {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.preview-block h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

.data-table tbody tr:hover {
    background: #f1f5f9;
}

/* Info Banner */
.info-banner {
    display: flex;
    gap: 1rem;
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    padding: 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    color: #92400e;
}

.info-banner i {
    font-size: 1.5rem;
    color: var(--warning);
}

.info-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #b45309;
}

.info-content p {
    font-size: 0.875rem;
}

/* App Footer */
.app-footer {
    text-align: center;
    padding: 1rem 0 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Instructions Section */
.instructions-section {
    margin-bottom: 2rem;
}

.instructions-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s ease;
}

.instructions-toggle:hover {
    background: rgba(79, 70, 229, 0.05);
    border-color: var(--primary);
}

.instructions-toggle .toggle-icon {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.instructions-content {
    margin-top: 0.75rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.instruction-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.instruction-step:last-of-type {
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.step-text strong {
    font-size: 0.95rem;
}

.step-text p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.step-text code {
    background: rgba(79, 70, 229, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--primary);
}

.instruction-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    color: #92400e;
    font-size: 0.875rem;
}

.instruction-warning i {
    color: var(--warning);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Tax Number Field */
.tax-number-field {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.required-star {
    color: #ef4444;
    font-weight: bold;
    margin-left: 2px;
}

.tax-number-field label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.error-pulse {
    border-color: #ef4444 !important;
    animation: pulse-red 0.5s ease;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

.instruction-image-container {
    margin-top: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: white;
    max-width: 100%;
}

.instruction-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.instruction-img:hover {
    transform: scale(1.02);
}


.tax-number-field label i {
    color: var(--primary);
}

.tax-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tax-input-wrapper input {
    padding: 0.65rem 1rem;
    font-size: 1.1rem;
    font-family: 'Inter', monospace;
    letter-spacing: 0.15em;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    width: 160px;
    text-align: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

.tax-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.tax-input-wrapper input::placeholder {
    color: #cbd5e1;
    letter-spacing: 0.15em;
}

.tax-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Header secure badge */
.header-secure {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 0.25rem;
    opacity: 0.9;
}

.header-secure i {
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }

    .tax-input-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
}