:root {
    --primary-color: #4A90E2;
    --secondary-color: #7B68EE;
    --success-color: #50C878;
    --warning-color: #FFB347;
    --error-color: #FF6B6B;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --card-hover: 0 8px 12px rgba(0, 0, 0, 0.15);
    --card-surface: #f3f6ff;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

header h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.95;
}

main {
    animation: fadeIn 0.8s ease;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

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

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, #e0e7ff 0%, #cfd9ef 100%);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #d4f4dd 0%, #c3f2d5 100%);
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.upload-hint {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 10px;
    border-left: 4px solid var(--success-color);
}

/* Mapping Section */
.info-text {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.mapping-item label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.column-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    transition: border-color 0.3s;
}

.column-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-top: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #50C878, #48bb78);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(80, 200, 120, 0.4);
}

.btn-outline {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.25);
}

.btn-secondary {
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 101, 101, 0.4);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 10px;
    font-weight: 500;
}

.stats-bar span {
    padding: 5px 15px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Error Box */
.error-box {
    background: #ffe5e5;
    border-left: 4px solid var(--error-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.error-box h4 {
    color: var(--error-color);
    margin-bottom: 10px;
}

/* Preview Section */
.preview-container h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
}

.preview-area {
    background: #f5f7ff;
    border: 2px solid rgba(74, 144, 226, 0.15);
    border-radius: 20px;
    padding: 30px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Card Preview Styles */

.card-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.card-preview {
    display: flex;
    flex-direction: column;
    border-radius: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(100, 116, 139, 0.18);
    min-height: 200px;
}

.card-preview-header {
    background: var(--primary-color);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.card-preview-name {
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.1px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-preview-tag {
    background: #5e82f5;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: auto;
}

.card-preview-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-right: 8px;
}

.card-preview-logo.hidden {
    display: none;
}

.card-preview-body {
    padding: 18px;
    background: var(--card-surface, #f3f6ff);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-preview-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-preview-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
}

.card-preview-value {
    font-size: 1.05rem;
    font-weight: 500;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.card-preview-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    max-width: 100%;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: #ffffff;
    background: var(--secondary-color);
}

.card-preview-footer {
    padding: 0 18px 16px;
    font-size: 0.7rem;
    color: #94a3b8;
}

/* Output Options */
.output-options {
    margin: 25px 0;
}

.output-options label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.output-options input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
}

.output-options input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.logo-options {
    margin: 20px 0 10px;
}

.logo-options label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.logo-options input[type="file"] {
    display: block;
    margin-bottom: 8px;
}

.logo-hint {
    font-size: 0.85rem;
    color: #64748b;
}

.logo-preview {
    margin-top: 12px;
    padding: 10px;
    border: 1px dashed rgba(100, 116, 139, 0.4);
    border-radius: 8px;
    width: fit-content;
    background: rgba(243, 246, 255, 0.6);
}

.logo-preview img {
    max-height: 80px;
    max-width: 160px;
    object-fit: contain;
}

.logo-preview.hidden {
    display: none;
}

/* Loading Overlay */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading p {
    margin-top: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 20px;
    font-size: 0.9em;
    opacity: 0.9;
}

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

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

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .card {
        padding: 20px;
    }
    
    .preview-area {
        padding: 20px;
    }

    .card-preview-grid {
        grid-template-columns: 1fr;
    }

    .mapping-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
    }
}

