:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-hover: #059669;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #020617, #0f172a);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 50px;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

header h1 span {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
    transition: color 0.3s ease;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Vues */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}
.view-section.active {
    display: block;
}

/* Accueil Btons */
.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 50px;
}
.home-btn {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    font-size: 1.5rem;
    height: auto;
    border-radius: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    width: 100%;
}
.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.accent-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    width: 100%;
}
.accent-btn:hover:not(:disabled) {
    background: #7c3aed;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.success-btn {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    width: 100%;
    margin-top: 15px;
    font-size: 1.1rem;
    padding: 14px 24px;
}
.success-btn:hover:not(:disabled) {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    margin-bottom: 25px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.back-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateX(-4px);
    color: white;
}

.export-btn {
    background: var(--accent);
    color: white;
    padding: 10px 18px;
    font-size: 0.95rem;
    border-radius: 8px;
}
.export-btn:hover:not(:disabled) {
    background: #7c3aed;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

.reader-container {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(59, 130, 246, 0.4);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
}

.reader-container video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.scanner-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.barcode-result {
    text-align: center;
    margin-top: 15px;
    color: var(--success);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
}

/* Product Section */
.product-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: slideUp 0.4s ease;
}

.product-visual {
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    border: 1px solid rgba(255,255,255,0.05);
}
.product-visual img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

.product-details {
    display: flex;
    flex-direction: column;
}
.product-details h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
}
.product-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.price-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.price-input-group label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-muted);
}
.price-input-group input {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-family: inherit;
    font-size: 1.5rem;
    outline: none;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
    width: 100%;
}
.price-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* List Section */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scanned-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scanned-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.item-info h4 {
    margin-bottom: 6px;
    font-size: 1.05rem;
    color: white;
}
.item-info .barcode {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
    background: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

.item-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
}
.compare-prices {
    display: flex;
    gap: 10px;
    font-size: 1.1rem;
}
.compare-prices .p1 {
    color: var(--success);
    font-weight: bold;
}
.compare-prices .p2 {
    color: var(--accent);
    font-weight: bold;
}

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

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

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round:before { border-radius: 50%; }

/* Update Banner */
.update-banner {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 90%;
    max-width: 450px;
    justify-content: space-between;
}

.update-banner.show {
    bottom: 20px;
}

.update-banner span {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

/* App Version */
.app-version {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.6;
    z-index: 1000;
    pointer-events: none;
}
