:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-dark: rgba(255, 255, 255, 0.4);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.5);
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: #0f172a;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

.background-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 30vw;
    height: 30vw;
    background: linear-gradient(to right, #4f46e5, #ec4899);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: linear-gradient(to right, #06b6d4, #3b82f6);
}

.container {
    width: 100%;
    max-width: 800px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    margin: 0 auto 1rem;
    box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.5);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e293b, #475569);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
}

.upload-section {
    border: 2px dashed rgba(79, 70, 229, 0.3);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--surface-dark);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-section:hover, .upload-section.dragover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.9);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.image-preview {
    position: relative;
    max-height: 300px;
    display: flex;
    justify-content: center;
}

.image-preview img {
    max-height: 300px;
    max-width: 100%;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-remove {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.btn-remove:hover {
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

.action-section {
    margin: 2rem 0;
    text-align: center;
}

.btn-scan {
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px -5px rgba(236, 72, 153, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(236, 72, 153, 0.5);
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.result-section {
    animation: fadeIn 0.5s ease;
    margin-top: 1rem;
}

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

.result-section h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.result-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-card h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

th {
    font-weight: 600;
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.kdv-list {
    list-style: none;
}

.kdv-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}

.total-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.total-card h3 {
    color: #94a3b8;
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
