/* 
   HomeoCare - Mobile App Theme
   Tailored for native mobile application feel
*/

:root {
    --primary-color: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    --accent-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --nav-height: 64px;
    --header-height: 60px;
    --app-radius: 20px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 6px 16px rgba(13, 148, 136, 0.08);
    --shadow-lg: 0 12px 28px rgba(0,0,0,0.12);
}

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

input, textarea, select {
    user-select: auto;
    -webkit-user-select: auto;
}

body {
    font-family: 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #e2e8f0;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* On Desktop screens: Render as sleek mobile phone frame */
.mobile-app-wrapper {
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    background-color: var(--bg-color);
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 481px) {
    body {
        padding: 20px 0;
        background: radial-gradient(circle at top right, #99f6e4 0%, #cbd5e1 60%);
    }
    .mobile-app-wrapper {
        border-radius: 36px;
        min-height: 860px;
        max-height: 92vh;
        border: 7px solid #1e293b;
        position: relative;
    }
}

/* App Header */
.app-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.brand-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin: 0;
    line-height: 1.1;
}

.brand-tagline {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
}

/* App Content Area */
.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 14px 14px calc(var(--nav-height) + 20px) 14px;
    scroll-behavior: smooth;
}

.app-content::-webkit-scrollbar {
    width: 4px;
}
.app-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Bottom Navigation Bar - ALWAYS FIXED */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--nav-height) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--border-color) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    z-index: 1050 !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08) !important;
}

@media (min-width: 481px) {
    .bottom-nav {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        max-width: 440px !important;
        border-radius: 0 0 28px 28px !important;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: var(--primary-dark);
    font-weight: 700;
}

.nav-item.active i {
    transform: translateY(-2px) scale(1.1);
    color: var(--primary-color);
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-indicator {
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
    display: none;
}
.nav-item.active .nav-indicator {
    display: block;
}

/* User Greeting Banner */
.user-welcome-card {
    background: var(--primary-gradient);
    border-radius: var(--app-radius);
    padding: 18px;
    color: white;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.25);
}

.user-welcome-card::after {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -30px;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.user-welcome-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-welcome-subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Search Bar in App */
.search-container {
    margin-bottom: 16px;
    position: relative;
}

.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrap i.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: 12px 38px 12px 42px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.92rem;
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    display: none;
}

/* Horizontal Category Pills Carousel */
.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.category-chip {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.category-chip:active {
    transform: scale(0.95);
}

/* Medicine Card */
.med-card {
    background: white;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
}

.med-card:hover {
    box-shadow: var(--shadow-md);
}

.med-card:active {
    transform: scale(0.985);
}

.med-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.med-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.med-header-text {
    flex: 1;
    margin-left: 12px;
}

.med-name-bn {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    line-height: 1.25;
}

.med-name-en {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    margin: 0;
}

.med-category-badge {
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--primary-dark);
    font-weight: 600;
}

.med-short-desc {
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.45;
    margin: 6px 0 10px 0;
}

.med-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    margin-top: 6px;
}

.btn-detail-sheet {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 15px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-detail-sheet:active {
    background: var(--primary-color);
    color: white;
}

.bookmark-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.bookmark-btn.saved {
    color: #ef4444;
}

/* Bottom Sheet Modal (Native Mobile Feel) */
.sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sheet-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    background: white;
    border-radius: 24px 24px 0 0;
    z-index: 2005;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.sheet-backdrop.open .bottom-sheet {
    transform: translateX(-50%) translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: #cbd5e1;
    border-radius: 10px;
    margin: 12px auto 8px auto;
}

.sheet-header {
    padding: 8px 18px 12px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sheet-title-bn {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-dark);
}

.sheet-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
}

.sheet-body {
    padding: 16px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Sections inside Sheet / Detail */
.detail-section {
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary-color);
}

.detail-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-section-content {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.6;
    white-space: pre-line;
}

/* Entry Gate Page Styling */
.gate-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 20px 30px 20px;
    background: radial-gradient(circle at top, #f0fdf4 0%, #ffffff 80%);
    text-align: center;
}

.gate-hero-icon {
    width: 90px;
    height: 90px;
    margin: 20px auto 16px auto;
    border-radius: 28px;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    box-shadow: 0 12px 30px rgba(13, 148, 136, 0.35);
    animation: floatAnim 3s ease-in-out infinite;
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.gate-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.gate-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto 20px auto;
    line-height: 1.5;
}

.gate-features {
    background: white;
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    text-align: left;
}

.gate-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
    color: #334155;
}
.gate-feature-item:last-child {
    border-bottom: none;
}
.gate-feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* Social Entry Buttons (IMO, GitHub, Discord) */
.social-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-social-entry {
    width: 100%;
    padding: 13px 20px;
    border-radius: 30px;
    border: none;
    font-size: 0.96rem;
    font-weight: 700;
    font-family: 'Hind Siliguri', 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    position: relative;
}

.btn-social-entry:hover {
    opacity: 0.95;
    color: white;
}

.btn-social-entry:active {
    transform: scale(0.96);
}

.btn-social-entry i, .btn-social-entry svg {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* IMO Button */
.btn-imo {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
}

.imo-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
}

/* GitHub Button */
.btn-github {
    background: #181717;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(24, 23, 23, 0.35);
}

/* Discord Button */
.btn-discord {
    background: #5865F2;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.35);
}

/* Big Action Button */
.btn-app-primary {
    background: var(--primary-gradient);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 30px;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-app-primary:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

/* Modal Form Controls */
.app-form-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
    display: block;
}

.app-form-control {
    width: 100%;
    padding: 13px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    background: #f8fafc;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.app-form-control:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.25s ease-in-out;
}

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

/* Touch Active Feedback */
.btn:active, .card:active {
    transform: scale(0.97);
}
