/* ========================================
   DESIGN SYSTEM - 2025 Modern Clean Style
   ReadyBebe Global Stylesheet
   ======================================== */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Primary - Sophisticated Coral Pink */
    --primary: #FF7B8F;
    --primary-dark: #F0627A;
    --primary-light: #FFF0F3;
    --primary-soft: #FFE4E9;
    --primary-gradient: linear-gradient(135deg, #FFA5B3 0%, #FF7B8F 50%, #FF6B82 100%);

    /* Clean Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;

    /* Soft Pastel Accents */
    --accent-blue: #60A5FA;
    --accent-blue-light: #EFF6FF;
    --accent-blue-soft: #DBEAFE;
    --accent-mint: #34D399;
    --accent-mint-light: #ECFDF5;
    --accent-mint-soft: #D1FAE5;
    --accent-yellow: #FBBF24;
    --accent-yellow-light: #FFFBEB;
    --accent-yellow-soft: #FEF3C7;
    --accent-purple: #A78BFA;
    --accent-purple-light: #F5F3FF;
    --accent-purple-soft: #EDE9FE;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-quaternary: #D1D5DB;
    --text-muted: #9CA3AF;

    /* Borders & Shadows */
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --border-default: #E5E7EB;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.02);
    --shadow-glow: 0 4px 20px rgba(255, 123, 143, 0.25);
    --shadow-purple: 0 4px 20px rgba(167, 139, 250, 0.25);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);

    /* Status Colors */
    --danger: #EF4444;
    --success: #10B981;

    /* Timeline */
    --timeline-gradient: linear-gradient(180deg, #FF7B8F 0%, #A78BFA 50%, #34D399 100%);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #E5E7EB;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ========================================
   APP CONTAINER - Mobile-First Layout
   ======================================== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-secondary);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
}

@media (max-width: 480px) {
    body {
        background: var(--bg-secondary);
    }
    .app-container {
        box-shadow: none;
    }
}

/* ========================================
   HEADER - Glassmorphism Style
   ======================================== */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 0.875rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title i {
    color: var(--primary);
}

.header-back {
    color: var(--text-secondary);
    font-size: 1.5rem;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.header-back:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.header-placeholder {
    width: 40px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-icons a {
    color: var(--text-secondary);
    font-size: 1.375rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-icons a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================
   BABY SELECTOR DROPDOWN
   ======================================== */
.baby-selector-wrapper {
    position: relative;
}

.baby-selector {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--primary-light);
    padding: 0.4375rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-dark);
    border: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.baby-selector:hover {
    background: var(--primary);
    color: white;
}

.baby-selector-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border-light);
    padding: 0.5rem;
    display: none;
    z-index: 200;
    transform-origin: top right;
}

.baby-selector-dropdown.show {
    display: block;
    animation: dropdownPopIn 0.2s ease;
}

.baby-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 12px;
    border: none;
    background: none;
    width: 100%;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.baby-option:hover {
    background: var(--bg-secondary);
}

.baby-option.active {
    background: var(--primary-light);
}

.baby-option-avatar {
    font-size: 1.25rem;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main {
    padding: 1rem 1rem 100px;
}

/* ========================================
   BOTTOM NAVIGATION
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 0.625rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item i {
    font-size: 1.375rem;
    margin-bottom: 0.1875rem;
}

.nav-item:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

/* ========================================
   COMMON BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 14px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 123, 143, 0.35);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-default);
}

.btn-danger {
    background: var(--bg-primary);
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-danger:hover {
    background: #FEF2F2;
}

/* ========================================
   COMMON CARDS & SECTIONS
   ======================================== */
.section {
    background: var(--bg-primary);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 0.875rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 1.125rem;
    color: var(--primary);
}

.section-more {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.section-more:hover {
    background: var(--primary-light);
}

/* ========================================
   TASK CARDS - Clickable Items
   ======================================== */
.task-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: 14px;
    margin-bottom: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    text-decoration: none;
    color: inherit;
}

.task-card:last-child {
    margin-bottom: 0;
}

.task-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-default);
    transform: translateX(4px);
}

.task-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.task-icon.vaccine {
    background: var(--accent-blue-soft);
}

.task-icon.benefit {
    background: var(--accent-yellow-soft);
}

.task-icon.checkup {
    background: var(--accent-mint-soft);
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-badges {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.task-badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.1875rem 0.5rem;
    border-radius: 6px;
}

.badge-vaccine {
    background: var(--accent-blue-soft);
    color: #2563EB;
}

.badge-benefit {
    background: var(--accent-yellow-soft);
    color: #D97706;
}

.badge-checkup {
    background: var(--accent-mint-soft);
    color: #059669;
}

.task-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.task-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-dday {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.task-dday.urgent {
    background: #FEE2E2;
    color: #DC2626;
}

/* ========================================
   SERVICE CARDS (for new users)
   ======================================== */
.service-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem;
    background: var(--bg-secondary);
    border-radius: 14px;
    margin-bottom: 0.625rem;
}

.service-card:last-child {
    margin-bottom: 0;
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.service-content {
    flex: 1;
}

.service-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.service-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.625rem;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* ========================================
   FILTER PILLS / TABS
   ======================================== */
.filter-pills,
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
}

.filter-pills::-webkit-scrollbar,
.filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-pill,
.filter-tab {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    border: 1.5px solid var(--border-default);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.filter-pill.active,
.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.filter-pill:not(.active):hover,
.filter-tab:not(.active):hover {
    border-color: var(--primary-light);
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #E5E7EB;
    transition: 0.3s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-slider {
    background: var(--primary-gradient);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ========================================
   MENU SECTIONS (Settings Page)
   ======================================== */
.menu-section {
    background: var(--bg-primary);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
}

.menu-header {
    padding: 1rem 1.25rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-item i {
    font-size: 1.25rem;
    margin-right: 1rem;
    color: var(--text-muted);
}

.menu-item span {
    flex: 1;
}

.menu-item .arrow {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.menu-item.danger {
    color: var(--danger);
}

.menu-item.danger i {
    color: var(--danger);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdownPopIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation Utility Classes */
.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out both;
}

.animation-delay-1 {
    animation-delay: 0.05s;
}

.animation-delay-2 {
    animation-delay: 0.1s;
}

.animation-delay-3 {
    animation-delay: 0.15s;
}

.animation-delay-4 {
    animation-delay: 0.2s;
}
