/* Global Styles - Ivy Foodie Palace Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Noto+Serif+TC:wght@400;700&display=swap');

:root {
    /* Palette */
    --ivy-green: #2F4F4F;
    /* Primary Dark Green */
    --ivy-green-light: #3f6666;
    /* Hover Green */
    --ivy-gold: #D4AF37;
    /* Accent Gold */
    --ivy-cream: #F9F5F0;
    /* Background Cream */
    --ivy-white: #FFFFFF;
    /* Card Background */
    --text-primary: #2c3e50;
    /* Dark Grey Text */
    --text-secondary: #596b7d;
    /* Light Grey Text */
    --border-color: #e2e8f0;
    /* Light Border */

    /* Functional Colors */
    --primary-color: var(--ivy-green);
    --secondary-color: var(--ivy-gold);
    --success-color: #27ae60;
    --danger-color: #c0392b;
    --warning-color: #f39c12;

    /* UI Variables */
    --bg-color: var(--ivy-cream);
    --surface-color: var(--ivy-white);
    --card-color: var(--ivy-white);
    --shadow-soft: 0 10px 30px rgba(47, 79, 79, 0.05);
    --shadow-hover: 0 20px 40px rgba(47, 79, 79, 0.15);
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', 'Microsoft JhengHei', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 5% 5%, rgba(212, 175, 55, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 95% 95%, rgba(47, 79, 79, 0.03) 0%, transparent 20%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background: transparent;
    box-shadow: none;
}

header h1 {
    font-family: 'Noto Serif TC', serif;
    font-size: 2.8em;
    color: var(--ivy-green);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
    display: inline-block;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--ivy-gold);
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    margin-top: 15px;
    text-transform: uppercase;
}

/* Step sections */
.step-section {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.step-section:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(212, 175, 55, 0.3);
}

.step-section.hidden {
    display: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.step-number {
    background: var(--ivy-green);
    color: var(--ivy-gold);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-family: 'Noto Serif TC', serif;
    font-size: 1.1em;
    border: 2px solid var(--ivy-gold);
}

.step-header h2 {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.6em;
    color: var(--ivy-green);
    font-weight: 600;
}

/* Upload area */
.upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-box:hover {
    border-color: var(--ivy-gold);
    background: rgba(212, 175, 55, 0.05);
    transform: translateY(-2px);
}

.upload-box.drag-over {
    border-color: var(--ivy-green);
    background: rgba(47, 79, 79, 0.05);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--ivy-green);
}

.upload-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* File list */
.file-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.file-item:hover {
    border-color: var(--ivy-green);
    transform: translateX(5px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 1.5em;
    color: var(--ivy-gold);
}

.file-details h4 {
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 1em;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.file-remove {
    background: #fff0f0;
    color: var(--danger-color);
    border: 1px solid #ffcccc;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
}

.file-remove:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(47, 79, 79, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #cbd5e1 !important;
    background-image: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--ivy-green);
    color: white;
    background-image: linear-gradient(135deg, var(--ivy-green), var(--ivy-green-light));
}

.btn-secondary {
    background: white;
    color: var(--ivy-green);
    border: 1px solid var(--ivy-green);
}

.btn-secondary:hover {
    background: var(--ivy-green);
    color: white;
}

.btn-success {
    background: var(--ivy-gold);
    color: white;
    background-image: linear-gradient(135deg, var(--ivy-gold), #eec042);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

/* Mapping Table */
.mapping-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: white;
}

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

.mapping-table th {
    background: var(--ivy-green);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
    font-family: 'Noto Serif TC', serif;
}

.mapping-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.mapping-table tbody tr:hover {
    background: #f8fafc;
}

.mapping-table input,
.mapping-table select {
    width: 100%;
    min-width: 55px;
    /* Force minimum width for readability */
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
}

.mapping-table input:focus,
.mapping-table select:focus {
    outline: none;
    border-color: var(--ivy-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Stats */
.category-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--ivy-gold);
    box-shadow: var(--shadow-soft);
}

.category-title {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.4em;
    margin-bottom: 20px;
    color: var(--ivy-green);
    font-weight: 600;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.product-card {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.product-card:hover {
    border-color: var(--ivy-green);
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.product-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.product-quantity strong {
    color: var(--ivy-green);
    font-size: 1.3em;
}

/* Toast */
.toast {
    background: white;
    color: var(--text-primary);
    border-left: 4px solid var(--ivy-green);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-family: 'Noto Serif TC', serif;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .step-section {
        padding: 20px;
    }
}