* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1700px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.main-content {
    padding: 40px;
}

.upload-section {
    background: #f8f9ff;
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-section:hover {
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.upload-section.drag-over {
    background: #e8ecff;
    border-color: #5a67d8;
}

.upload-icon {
    font-size: 4em;
    color: #667eea;
    margin-bottom: 20px;
    display: block;
}

.upload-text {
    font-size: 1.2em;
    color: #4a5568;
    margin-bottom: 15px;
}

.upload-hint {
    color: #718096;
    font-size: 0.9em;
}

#fileInput {
    display: none;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-save {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.btn-save:hover {
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

.text-center {
    text-align: center;
}

.progress-container {
    display: none;
    margin: 30px 0;
    text-align: center;
}

.progress-container p {
    margin-bottom: 10px;
    color: #4a5568;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.result-container {
    display: none;
    margin-top: 30px;
}

.result-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab {
    padding: 15px 25px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #718096;
}

.tab.active {
    border-bottom-color: #667eea;
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* FORM STYLES */
.invoice-form {
    background: #f7fafc;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control.error {
    border-color: #e53e3e;
    background-color: #fed7d7;
}

.form-control.success {
    border-color: #38a169;
    background-color: #c6f6d5;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.validation-info {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.validation-info h4 {
    color: #234e52;
    margin-bottom: 10px;
}

.validation-item {
    color: #2c7a7b;
    font-size: 13px;
    margin-bottom: 5px;
}

.validation-score {
    font-weight: bold;
    color: #234e52;
}

.error-message {
    background: #fed7d7;
    border: 1px solid #fc8181;
    color: #c53030;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
}

.success-message {
    background: #c6f6d5;
    border: 1px solid #68d391;
    color: #2f855a;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    display: none;
}

.warning-message {
    background: #fef5e7;
    border: 1px solid #f6ad55;
    color: #c05621;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 5px;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preview-image {
    max-width: 100%;
    max-height: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    object-fit: contain;
    display: block;
    margin: 20px auto;
}

.json-viewer {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 20px;
    display: inline-block;
}

.status-loading {
    background: #fef5e7;
    color: #c05621;
}

.status-success {
    background: #c6f6d5;
    color: #2f855a;
}

.status-error {
    background: #fed7d7;
    color: #c53030;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    .main-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2em;
    }

    .result-tabs {
        flex-direction: column;
    }

    .tab {
        text-align: center;
        border-bottom: 1px solid #e2e8f0;
        border-left: 3px solid transparent;
    }

    .tab.active {
        border-bottom-color: #e2e8f0;
        border-left-color: #667eea;
    }
}

