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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #2980b9 0%, #1abc9c 50%, #27ae60 100%);
    min-height: 100vh;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: move 20s linear infinite;
    z-index: -1;
}

@keyframes move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

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

header {
    text-align: center;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.description {
    font-size: 1.1rem;
    opacity: 0.8;
}

.api-keys-section h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.api-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: white;
    font-weight: 500;
}

.glass-input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.glass-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.upload-area.dragging {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.file-types {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.process-buttons h3 {
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.glass-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 1rem 2rem;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.glass-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.glass-button.primary {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.5);
}

.glass-button.primary:hover {
    background: rgba(76, 175, 80, 0.4);
}

.button-icon {
    font-size: 1.2rem;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-result {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: white;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-processing {
    background: rgba(255, 193, 7, 0.3);
    color: #fff3cd;
}

.status-complete {
    background: rgba(76, 175, 80, 0.3);
    color: #d4edda;
}

.status-error {
    background: rgba(244, 67, 54, 0.3);
    color: #f8d7da;
}

.card-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: start;
}

.preview-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.preview-portrait {
    display: flex;
    gap: 0.5rem;
}

.preview-landscape {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-image {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.preview-image img {
    max-width: 150px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 500;
}

.ocr-result {
    flex: 1;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
}

.ocr-result h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.ocr-text {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
}

.extracted-data {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.data-field {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.field-label {
    font-weight: 600;
    opacity: 0.8;
}

.field-value {
    opacity: 0.9;
}

.card-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.action-group {
    margin-bottom: 1rem;
}

.action-group h5 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.small-button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.download-all-section {
    text-align: center;
    color: white;
}

.download-all-section h3 {
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }
    
    .card-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .preview-container {
        justify-content: center;
    }
} 