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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    color: #f1f5f9;
}

.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.status-bar {
    padding-top: env(safe-area-inset-top, 20px);
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.streak-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.streak-badge::before {
    content: "🔥";
    font-size: 14px;
}

.daily-badge {
    background: rgba(59, 130, 246, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.daily-badge::before {
    content: "📅";
    font-size: 12px;
}

.swipe-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.swipe-container:active {
    cursor: grabbing;
}

.card {
    position: absolute;
    width: calc(100% - 32px);
    max-width: 380px;
    background: rgba(30, 41, 59, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 32px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    will-change: transform;
}

.card.swiping-left {
    transform: translateX(-120%) rotate(-8deg);
    opacity: 0;
}

.card.swiping-right {
    transform: translateX(120%) rotate(8deg);
    opacity: 0;
}

.category {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: #60a5fa;
}

.card h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.card p {
    font-size: 18px;
    line-height: 1.5;
    color: #cbd5e1;
    margin-bottom: 28px;
}

.highlight-word {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    transition: opacity 0.2s;
}

.highlight-word:active {
    opacity: 0.7;
}

.info-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: center;
}

.info-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.swipe-indicator {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    margin: 0 20px;
    border-radius: 40px;
    z-index: 10;
}

.swipe-indicator span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bottom-menu {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 24px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 16px;
    border-radius: 24px;
}

.menu-item.active {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.menu-item span:first-child {
    font-size: 22px;
}

.history-view, .stats-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    overflow-y: auto;
    padding: 80px 20px 100px;
}

.history-view.open, .stats-view.open {
    transform: translateX(0);
}

.history-view h2, .stats-view h2 {
    font-size: 28px;
    margin-bottom: 24px;
    font-weight: 700;
}

.history-item {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid #60a5fa;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:active {
    transform: scale(0.98);
    background: rgba(30, 41, 59, 0.8);
}

.history-item h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.history-item p {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.history-item small {
    font-size: 11px;
    color: #60a5fa;
}

.close-btn {
    position: fixed;
    top: 60px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 201;
    backdrop-filter: blur(10px);
}

.stats-card {
    background: rgba(30, 41, 59, 0.6);
    border-radius: 24px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.stats-number {
    font-size: 48px;
    font-weight: 700;
    color: #60a5fa;
}

.empty-state {
    text-align: center;
    color: #64748b;
    padding: 40px;
}

::-webkit-scrollbar {
    display: none;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 14px;
    z-index: 300;
    animation: fadeOut 2s ease forwards;
    white-space: nowrap;
}

.definition-popup {
    position: fixed;
    bottom: 200px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 20px;
    z-index: 400;
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(96, 165, 250, 0.3);
}

.definition-popup h4 {
    color: #60a5fa;
    margin-bottom: 8px;
    font-size: 18px;
}

.definition-popup p {
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.4;
}

.definition-popup button {
    margin-top: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
}

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

@keyframes fadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Daily reminder (rappel du fait du jour) */
.daily-reminder {
    background: rgba(59, 130, 246, 0.15);
    backdrop-filter: blur(10px);
    margin: 8px 16px 0 16px;
    border-radius: 30px;
    padding: 8px 16px;
    border: 0.5px solid rgba(96, 165, 250, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 15;
}

.daily-reminder:active {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(0.98);
}

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

.reminder-icon {
    font-size: 18px;
}

.reminder-title {
    flex: 1;
    font-size: 14px;
    color: #60a5fa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-arrow {
    font-size: 18px;
    color: #60a5fa;
}

/* Calendrier avec date */
.daily-badge {
    background: rgba(59, 130, 246, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-icon {
    font-size: 14px;
}

.calendar-date {
    font-weight: 600;
    font-size: 14px;
}

/* Popup améliorée */
.info-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 28px 28px 0 0;
    padding: 24px;
    z-index: 400;
    animation: slideUp 0.3s ease;
    border-top: 1px solid rgba(96, 165, 250, 0.3);
    max-height: 70vh;
    overflow-y: auto;
}

.info-popup h4 {
    color: #60a5fa;
    margin-bottom: 12px;
    font-size: 20px;
}

.info-popup p {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.info-popup button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
}

.definition-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 28px 28px 0 0;
    padding: 24px;
    z-index: 400;
    animation: slideUp 0.3s ease;
    border-top: 1px solid rgba(96, 165, 250, 0.3);
}

.definition-popup h4 {
    color: #60a5fa;
    margin-bottom: 12px;
    font-size: 20px;
}

.definition-popup p {
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.definition-popup button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
}

/* Daily reminder (rappel du fait du jour) - EN HAUT À GAUCHE */
.daily-reminder {
    position: absolute;
    top: 70px;
    left: 16px;
    background: rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 16px;
    border: 0.5px solid rgba(96, 165, 250, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 15;
    max-width: 70%;
}

.daily-reminder:active {
    background: rgba(59, 130, 246, 0.4);
    transform: scale(0.97);
}

.reminder-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reminder-icon {
    font-size: 16px;
}

.reminder-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #60a5fa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-arrow {
    font-size: 16px;
    color: #60a5fa;
    font-weight: bold;
}

/* Status bar avec calendrier */
.status-bar {
    padding-top: env(safe-area-inset-top, 20px);
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.daily-badge {
    background: rgba(59, 130, 246, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.daily-badge span {
    font-weight: 600;
}

/* Correction pour l'affichage en mode standalone (écran d'accueil) */
@media (display-mode: standalone) {
    .status-bar {
        padding-top: 0px !important;
    }
    
    .bottom-menu {
        padding-bottom: 20px !important;
    }
    
    .swipe-indicator {
        bottom: 90px !important;
    }
    
    .daily-reminder {
        top: 50px !important;
    }
}
