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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
}

main {
    padding: 2rem;
}

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: scale(1.02);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin: 0 auto 1rem;
}

.upload-area h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.upload-area p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.supported-formats {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.preview-section {
    margin-bottom: 2rem;
}

.preview-container {
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
}

.preview-container img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

.results-section {
    margin-top: 2rem;
}

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

.info-card {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.info-content {
    font-size: 0.9375rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-valid {
    background: #d1fae5;
    color: #065f46;
}

.status-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.reset-button {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.error-section {
    padding: 2rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: #fef2f2;
    border-radius: 1rem;
    border: 2px solid #fecaca;
}

.error-icon {
    width: 64px;
    height: 64px;
    color: var(--error-color);
    margin: 0 auto 1rem;
}

.error-message h3 {
    color: var(--error-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-message p {
    color: #991b1b;
    margin-bottom: 1.5rem;
}

footer {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

footer p {
    margin: 0.25rem 0;
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 1rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-value {
        max-width: 50%;
    }
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}
