:root {
    --primary-red: #CE1212;
    --primary-green: #1B5E20;
    --primary-brown: #a67c52;
    --primary-purple: #7b1fa2;
    --primary-white: #FCFBF6;
    --accent-gold: #D4AF37;
    --accent-emerald: #1DE9B6;
    --text-dark: #232323;
    --text-light: #666666;
    --white-bg: #FFFFFF;
    --shadow-premium: 0 12px 40px rgba(0, 0, 0, 0.06);
    --radius-lg: 24px;
    --radius-sm: 12px;
    --glass-bg: rgba(255, 255, 255, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, sans-serif;
    background: radial-gradient(circle at top right, #fff, #F5F2E9);
    background-attachment: fixed;
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: linear-gradient(135deg, #FCFBF6 0%, #F5F2E9 100%);
}

/* GLOBAL HEADER (FIXED & STABLE) */
#global-header {
    text-align: center;
    padding: 30px 20px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    margin: -20px -20px 0 -20px; /* Aligné en haut */
}

.back-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: inherit;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
}

.back-btn:active { transform: scale(0.95); }

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tiger-icon {
    font-size: 2.5rem;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-red);
}

h1.oils-title { color: var(--primary-green); }

h1 span {
    color: var(--accent-gold);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 400;
}

/* PROFILES BAR */
.profiles-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding: 5px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.profiles-bar::-webkit-scrollbar { display: none; }

.profile-btn {
    background: white;
    border: 1px solid #eee;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.profile-btn.active {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
    box-shadow: 0 4px 10px rgba(197, 160, 89, 0.3);
}

/* MENU HOME */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.menu-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-premium);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-card.fav {
    background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);
    color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: none;
}

.menu-card.fav .card-icon { 
    background: rgba(255, 255, 255, 0.2); 
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0;
    margin-right: 15px;
}
.menu-card.fav .card-btn { background: rgba(255, 255, 255, 0.3); color: white; border: 1px solid rgba(255,255,255,0.4); }

.menu-card:hover {
    border: 1px solid rgba(255,255,255,1);
    position: relative;
    overflow: hidden;
}

.menu-card:active { transform: scale(0.96); }

.menu-card.tiger { border-left: 5px solid var(--primary-red); }
.menu-card.oils { border-left: 5px solid var(--primary-green); }
.menu-card.plants { border-left: 5px solid var(--primary-brown); }

.card-icon { font-size: 2.5rem; margin-bottom: 10px; }
.menu-card h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin-bottom: 5px; }
.menu-card p { font-size: 0.9rem; color: #666; margin-bottom: 15px; }
.card-btn { font-size: 0.85rem; font-weight: 600; color: var(--accent-gold); text-transform: uppercase; }

/* SEARCH SECTION */
.search-section {
    position: relative;
    margin: 15px 0;
    z-index: 10;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--white-bg);
    border-radius: 20px;
    padding: 4px 20px;
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-container:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 15px 45px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

input {
    width: 100%;
    padding: 12px 10px;
    border: none;
    outline: none;
    font-size: 1.1rem;
    font-family: inherit;
    background: transparent;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white-bg);
    margin-top: 5px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.suggestion-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cat-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.cat-badge.tiger { background: #fee2e2; color: var(--primary-red); }
.cat-badge.oils { background: #dcfce7; color: var(--primary-green); }
.cat-badge.plants { background: #fdf4ec; color: var(--primary-brown); }

/* THEMATIC DISCOVERY */
.thematic-discovery {
    margin-top: 15px;
    margin-bottom: 5px;
}

.thematic-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.thematic-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 5px 0 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thematic-scroll::-webkit-scrollbar { display: none; }

.theme-pill {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.06);
    border-color: var(--accent-gold);
}

.theme-pill:active { transform: scale(0.95); }

.theme-pill.active {
    background: var(--accent-gold);
    color: white;
    border-color: var(--accent-gold);
}

/* FILTERS SECTION */
.filters-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #eee;
    background: white;
    transition: 0.3s;
}

.filter-pill.red { color: var(--primary-red); }
.filter-pill.white { color: #666; }
.filter-pill.green { color: var(--primary-green); border-color: var(--primary-green); background: #E8F5E9; }

.filter-pill.active { background: #333; color: white; border-color: #333; }
.filter-pill.red.active { background: var(--primary-red); color: white; border-color: var(--primary-red); }
.filter-pill.brown.active { background: var(--primary-brown); color: white; border-color: var(--primary-brown); }
.filter-pill.purple.active { background: var(--primary-purple); color: white; border-color: var(--primary-purple); }

/* VIEW HEADERS */
.view-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.view-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--text-dark);
}

/* RESULTS */
.results-section { margin-top: 20px; }
.hidden { display: none; }

.view.active-view {
    animation: fadeInUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.result-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(0,0,0,0.02);
    position: relative;
    overflow: hidden;
    animation: slideUpFade 0.4s ease-out both;
    transition: transform 0.2s, box-shadow 0.2s;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.12);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.compact-item {
    background: white;
    border-radius: 18px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid rgba(0,0,0,0.02);
}

.compact-item:hover {
    transform: translateX(5px);
    border-color: var(--accent-gold);
}

.compact-icon {
    font-size: 1.8rem;
    min-width: 45px;
    height: 45px;
    background: #fdfbf6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compact-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.compact-content p {
    font-size: 0.8rem;
    color: #888;
}

.compact-arrow {
    margin-left: auto;
    color: #ccc;
    font-weight: bold;
}

.fav-star {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.fav-star.active {
    color: #FFD700;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

.fav-star:active {
    transform: scale(0.8);
}

@keyframes starPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1.1); }
}

.fav-star.animating {
    animation: starPop 0.3s ease-out;
}

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

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

.result-card.red { border-left: 6px solid var(--primary-red); }
.result-card.white { border-left: 6px solid #ddd; }
.result-card.green { border-left: 6px solid var(--primary-green); }

.type-badge.green { background: #E8F5E9; color: var(--primary-green); }

.profile-info-card {
    background: #FFF9C4;
    border: 1px solid #FBC02D;
    color: #455A64;
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    font-size: 0.85rem;
    display: flex;
    gap: 10px;
}

.profile-info-card.danger { background: #FFEBEE; border-color: #EF5350; color: #B71C1C; }

/* ACTIONS */
.action-buttons { display: flex; gap: 10px; margin-top: 15px; }
.action-btn {
    flex: 1; padding: 12px; border-radius: var(--radius); 
    font-size: 0.85rem; font-weight: 600; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

.btn-share { background: var(--accent-gold); color: white; }
.btn-reset { background: #f5f5f5; color: #666; border: 1px solid #ddd; }

/* SECURITY TOAST */
#security-reminder {
    position: fixed; bottom: 30px; left: 20px; right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #111;
    padding: 18px 25px;
    border-radius: 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.5);
    transform: translateY(150%);
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 10000;
}

#security-reminder.show { transform: translateY(0); }

.help-card { padding: 15px; background: rgba(197, 160, 89, 0.1); border-radius: var(--radius); text-align: center; margin-top: 20px;}
.help-card.green { background: rgba(46, 125, 50, 0.05); color: var(--primary-green); }

footer { text-align: center; font-size: 0.75rem; color: #aaa; margin: 30px 0; }

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