/* ===== JURNAL PEDI — Premium Mobile-First Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Ascunde scrollbar-ul pt feeling de app nativa pe mobil */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

* {
    box-sizing: border-box;
}

body {
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
}

/* PWA Safe Area Helpers */
:root {
    --safe-top: env(safe-area-inset-top);
    --header-h: 48px;
    --total-header-h: calc(var(--header-h) + var(--safe-top));
}

.pwa-header-spacer {
    height: var(--safe-top);
}

/* Fix Time Input for Dark Mode */
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}
.dark input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}
.dark input[type="time"] {
    color-scheme: dark;
}

/* ===== HEADER ===== */
header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dark header {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* ===== DARK MODE TOGGLE BUTTON (Sun/Moon) ===== */
#btnDarkToggle {
    position: relative;
    overflow: hidden;
}
#btnDarkToggle .icon-sun,
#btnDarkToggle .icon-moon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
#btnDarkToggle .icon-sun {
    color: #f59e0b;
}
#btnDarkToggle .icon-moon {
    color: #6366f1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(90deg) scale(0);
    opacity: 0;
}
.dark #btnDarkToggle .icon-sun {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}
.dark #btnDarkToggle .icon-moon {
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
    opacity: 1;
}

/* ===== TEMPERATURE CONTROLS ===== */
.temp-display-wrapper {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border-radius: 20px;
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}
.dark .temp-display-wrapper {
    background: linear-gradient(135deg, rgba(239,68,68,0.08) 0%, rgba(239,68,68,0.15) 100%);
}

.temp-value {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.temp-unit {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ef4444;
    opacity: 0.7;
}

.temp-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}
.temp-btn:active {
    transform: scale(0.92);
    background: #f3f4f6;
}
.dark .temp-btn {
    background: #1e1e1e;
    border-color: #374151;
    color: #e5e7eb;
}
.dark .temp-btn:active {
    background: #2d2d2d;
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 35%, #f97316 60%, #ef4444 100%);
    outline: none;
    margin: 12px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 0 0 3px rgba(239,68,68,0.2);
    border: 3px solid #ef4444;
    transition: box-shadow 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
    box-shadow: 0 2px 12px rgba(239,68,68,0.3), 0 0 0 6px rgba(239,68,68,0.15);
}

input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 3px solid #ef4444;
}

/* ===== MEDICINE BUTTONS ===== */
.med-btn {
    transition: all 0.2s ease;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}
.med-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79,156,249,0.05), rgba(79,156,249,0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}
.med-btn:active::before,
.med-btn.selected::before {
    opacity: 1;
}
.med-btn.selected {
    border-color: #4f9cf9 !important;
    color: #4f9cf9;
    box-shadow: 0 0 0 3px rgba(79,156,249,0.12);
}

/* ===== SYMPTOM TAGS ===== */
.symp-tag {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    user-select: none;
    -webkit-user-select: none;
}
.symp-tag.active {
    background: #4f9cf9 !important;
    color: white !important;
    border-color: #4f9cf9 !important;
    box-shadow: 0 2px 8px rgba(79,156,249,0.3);
    transform: scale(1.02);
}

/* ===== TIMELINE CARDS ===== */
.timeline-card {
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}
.timeline-card:active {
    transform: scale(0.98);
}
.dark .timeline-card {
    border-color: rgba(255,255,255,0.06);
}

.timeline-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ===== FAB BUTTON ===== */
#fabBtn {
    box-shadow: 0 4px 20px rgba(79, 156, 249, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#fabBtn:hover {
    box-shadow: 0 6px 28px rgba(79, 156, 249, 0.5);
}
#fabBtn:active {
    transform: scale(0.92);
}

/* ===== BOTTOM SHEET MODAL ===== */
#addModalContent {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
}

.modal-drag-handle {
    width: 36px;
    height: 5px;
    border-radius: 100px;
    background: #d1d5db;
    margin: 12px auto 8px;
}
.dark .modal-drag-handle {
    background: #4b5563;
}

/* ===== SETTINGS PANEL ===== */
#settingsMenu {
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
}
.dark #settingsMenu {
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ===== OBSERVATIONS TEXTAREA ===== */
.observations-area {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    min-height: 80px;
    outline: none;
    font-family: inherit;
}
.observations-area:focus {
    border-color: #4f9cf9;
    box-shadow: 0 0 0 3px rgba(79,156,249,0.1);
}
.dark .observations-area {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-color: #374151;
    color: #e5e7eb;
}

/* ===== PRODUCT CARDS (Recomandări) ===== */
.product-card {
    transition: all 0.25s ease;
    border: 1px solid rgba(0,0,0,0.04);
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.dark .product-card {
    border-color: rgba(255,255,255,0.06);
}

/* ===== EMPTY STATE ===== */
.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
}
.dark .empty-state-icon {
    background: linear-gradient(135deg, rgba(79,156,249,0.1) 0%, rgba(79,156,249,0.2) 100%);
}

/* ===== SAVE BUTTON ===== */
.save-btn {
    background: linear-gradient(135deg, #4f9cf9 0%, #3b82f6 100%);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 16px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(79,156,249,0.3);
    width: 100%;
}
.save-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(79,156,249,0.3);
}

/* ===== TABS ===== */
.tab-btn {
    position: relative;
    transition: color 0.25s ease;
}
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #4f9cf9;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn.active {
    color: #4f9cf9;
    font-weight: 700;
}
.tab-btn.active::after {
    width: 50%;
}

/* ===== GLOBAL DARK MODE BODY ===== */
.dark body,
body.dark-body {
    background: #0f172a;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeInUp 0.35s ease forwards;
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 4px 20px rgba(79,156,249,0.4); }
    50% { box-shadow: 0 4px 28px rgba(79,156,249,0.6); }
}
#fabBtn {
    animation: pulse-soft 3s ease-in-out infinite;
}

/* ===== FORM INPUTS PREMIUM ===== */
.form-input {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    outline: none;
    font-family: inherit;
}
.form-input:focus {
    border-color: #4f9cf9;
    box-shadow: 0 0 0 3px rgba(79,156,249,0.1);
}
.dark .form-input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* ===== TYPE SELECTOR (Radio Pill Group) ===== */
.type-selector {
    background: #f1f5f9;
    border-radius: 14px;
    padding: 4px;
}
.dark .type-selector {
    background: #1e293b;
}
.type-pill {
    padding: 10px 0;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #64748b;
}
.type-pill.active-pill {
    background: white;
    color: #1e293b;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.dark .type-pill.active-pill {
    background: #334155;
    color: #f1f5f9;
}

/* ===== SELECT DROPDOWN ===== */
.form-select {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.95rem;
    width: 100%;
    outline: none;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.dark .form-select {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* ===== DELETE BUTTON ===== */
.delete-btn {
    opacity: 0.3;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    padding: 4px 8px;
    border-radius: 8px;
}
.delete-btn:hover,
.delete-btn:active {
    opacity: 1;
    color: #ef4444;
    background: rgba(239,68,68,0.08);
}
