/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #92400e;
    color: #fef3c7;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    text-align: center;
}

.logo-container img {
    width: 128px;
    height: 128px;
    object-fit: contain;
}

.header-title h1 {
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0 5px;
}

.header-title p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
    padding: 40px 0;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    background: #fef3c7;
    padding: 20px;
    border-bottom: 2px solid #fbbf24;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-description {
    font-size: 0.875rem;
    color: #b45309;
}

.card-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #d97706;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #b45309;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn-danger {
    background: #dc2626;
    color: white;
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-outline {
    background: transparent;
    border: 2px solid #d97706;
    color: #d97706;
}

.btn-outline:hover {
    background: #d97706;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-full {
    width: 100%;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: #d97706;
    color: white;
}

.badge-outline {
    background: transparent;
    border: 2px solid #d97706;
    color: #d97706;
}

.badge-lg {
    padding: 8px 16px;
    font-size: 1rem;
}

/* Result Cards */
.result-card {
    animation: slideUp 0.5s ease-out;
}

.result-card.valid {
    border: 3px solid #22c55e;
    background: #f0fdf4;
}

.result-card.scanned {
    border: 3px solid #eab308;
    background: #fefce8;
}

.result-card.invalid {
    border: 3px solid #dc2626;
    background: #fef2f2;
}

.result-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 3rem;
}

.result-card.valid .result-icon {
    background: #22c55e;
}

.result-card.scanned .result-icon {
    background: #eab308;
}

.result-card.invalid .result-icon {
    background: #dc2626;
}

.result-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 12px;
}

.result-card.valid .result-title {
    color: #16a34a;
}

.result-card.scanned .result-title {
    color: #ca8a04;
}

.result-card.invalid .result-title {
    color: #dc2626;
}

.result-message {
    text-align: center;
    color: #6b7280;
    margin-bottom: 20px;
}

/* Table */
.table-container {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

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

thead {
    background: #fef3c7;
    position: sticky;
    top: 0;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #92400e;
    border-bottom: 2px solid #fbbf24;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background: #fef3c7;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    color: #92400e;
    font-size: 0.875rem;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 25px rgba(0,0,0,0.1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-description {
    color: #6b7280;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top-color: #d97706;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d97706 0%, #b45309 100%);
    border-radius: 12px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #d97706;
    margin: 8px 0 16px;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

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

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

/* Footer */
footer {
    background: #92400e;
    color: #fef3c7;
    padding: 16px 0;
    text-align: center;
}

footer a {
    color: #fef3c7;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .header-title h1 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 16px;
    }

    .btn {
        font-size: 0.875rem;
        padding: 10px 16px;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 8px;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Tooltip for buttons */
.btn-sm[title] {
    position: relative;
}

.btn-sm[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Arrow for tooltip */
.btn-sm[title]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    z-index: 1001;
    pointer-events: none;
}

/* Loading */
