/* © 2025 VEX LLC. All rights reserved. */
/* ===================================================================
   LAYOUT.CSS - Header, Navigation, Bottom Nav, Screens, Sections
   =================================================================== */

        /* Header - Clean White Style */
        .header { background: white; color: var(--text);
            padding: calc(var(--safe-top) + 16px) 20px 16px; position: sticky; top: 0; z-index: 100;
            border-bottom: 1px solid var(--border); }
        .header-row { display: flex; justify-content: space-between; align-items: center; }
        .header-greeting { display: flex; align-items: center; gap: 12px; }
        .header-avatar { width: 48px; height: 48px; border-radius: 24px; overflow: hidden; }
        .header-avatar img { width: 100%; height: 100%; object-fit: cover; }
        .header-text { }
        .header-hello { font-size: 14px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }
        .header-name { font-size: 18px; font-weight: 700; color: var(--text); }
        .logo { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
        .logo-icon { font-size: 28px; }
        .header-actions { display: flex; gap: 8px; }
        .header-btn { width: 44px; height: 44px; border-radius: 22px; background: transparent;
            border: 1px solid var(--border); color: var(--text); font-size: 20px; cursor: pointer; position: relative; }
        .header-badge { position: absolute; top: 0; right: 0; background: var(--danger);
            width: 18px; height: 18px; border-radius: 9px; font-size: 10px; font-weight: 700;
            display: flex; align-items: center; justify-content: center; color: white; }

        /* Hero Banner */
        .hero-banner { margin: 16px 20px; border-radius: 24px; overflow: hidden;
            background: linear-gradient(135deg, #4B7BF5 0%, #6B8DF5 100%);
            position: relative; min-height: 180px; }
        .hero-content { padding: 24px; color: white; position: relative; z-index: 1; }
        .hero-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
        .hero-text { font-size: 14px; opacity: 0.9; line-height: 1.5; margin-bottom: 16px; }
        .hero-btn { display: inline-block; padding: 12px 24px; background: white; color: var(--primary);
            border-radius: 30px; font-size: 14px; font-weight: 600; text-decoration: none; }
        .hero-image { position: absolute; right: -20px; bottom: 0; width: 180px; height: auto; }
        .hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
            display: flex; gap: 6px; }
        .hero-dot { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.4); }
        .hero-dot.active { background: white; width: 24px; }

        /* Quick Actions - Services Grid */
        .section-header { display: flex; justify-content: space-between; align-items: center;
            padding: 0 20px; margin: 24px 0 16px; }
        .section-title { font-size: 18px; font-weight: 700; color: var(--text); }
        .section-link { font-size: 14px; color: var(--primary); font-weight: 600; }

        .quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0 20px; }
        .quick-item {
            background: white; border-radius: 20px; padding: 16px 8px; text-align: center;
            cursor: pointer; transition: all 0.2s; border: 1px solid var(--border);
        }
        .quick-item:active { transform: scale(0.95); background: var(--primary-light); border-color: var(--primary); }
        .quick-icon { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 28px;
            background: var(--primary-light); display: flex; align-items: center; justify-content: center;
            font-size: 24px; }
        .quick-label { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.3; }

        /* Section */
        .section { padding: 0 20px 16px; }

        /* Pet Carousel */
        .pets-carousel { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
            -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: none; }
        .pets-carousel::-webkit-scrollbar { display: none; }
        .pet-card { flex: 0 0 120px; scroll-snap-align: start; background: white; border-radius: 16px;
            padding: 14px; text-align: center; box-shadow: 0 2px 8px var(--shadow); cursor: pointer; }
        .pet-card:active { background: var(--primary-light); }
        .pet-avatar { width: 56px; height: 56px; border-radius: 28px; background: var(--bg);
            display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 8px; }
        .pet-name { font-weight: 600; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .pet-breed { font-size: 11px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .pet-add { background: var(--bg); border: 2px dashed #CBD5E1; }
        .pet-add .pet-avatar { background: transparent; color: var(--text-light); }

        /* Bottom Nav */
        .bottom-nav {
            position: fixed; bottom: 0; left: 0; right: 0; background: white;
            display: flex; justify-content: space-around;
            padding: 12px 16px calc(var(--safe-bottom) + 12px);
            border-top: 1px solid var(--border); z-index: 100;
        }
        .nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px;
            font-size: 10px; color: var(--text-light); cursor: pointer; padding: 8px 12px;
            border-radius: 12px; transition: all 0.2s; position: relative; font-weight: 500; }
        .nav-item.active { color: var(--primary); }
        .nav-item.active .nav-icon-wrapper { background: var(--primary); }
        .nav-item.active .nav-icon-wrapper svg { stroke: white; }
        .nav-icon { font-size: 24px; }
        .nav-icon-wrapper { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
            border-radius: 8px; transition: all 0.2s; }

        /* Screens */
        .screen { display: none; min-height: calc(100vh - 160px); }
        .screen.active { display: block; }

        /* Loading */
        .loading { width: 20px; height: 20px; border: 2px solid transparent; border-top-color: currentColor;
            border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Hidden */
        .hidden { display: none !important; }

        /* Toast */
        .toast { position: fixed; top: calc(var(--safe-top) + 70px); left: 16px; right: 16px;
            background: var(--text); color: white; padding: 14px 18px; border-radius: 12px;
            display: none; z-index: 400; font-size: 14px; }
        .toast.active { display: flex; align-items: center; gap: 10px; animation: fadeIn 0.3s; }
        .toast.success { background: var(--primary); }
        .toast.error { background: var(--danger); }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

        /* Floating Action Button (FAB) */
        .fab-container {
            position: fixed;
            bottom: calc(100px + var(--safe-bottom));
            right: 20px;
            display: flex;
            flex-direction: column-reverse;
            align-items: flex-end;
            gap: 12px;
            z-index: 99;
        }
        .fab-main {
            width: 60px;
            height: 60px;
            border-radius: 30px;
            background: linear-gradient(135deg, #4B7BF5 0%, #6B8DF5 100%);
            border: none;
            color: white;
            font-size: 28px;
            cursor: pointer;
            box-shadow: 0 6px 20px rgba(75,123,245,0.45);
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .fab-main:active { transform: scale(0.92); }
        .fab-main.open { transform: rotate(45deg); background: #374151; }
        .fab-options {
            display: flex;
            flex-direction: column;
            gap: 10px;
            opacity: 0;
            transform: translateY(20px);
            pointer-events: none;
            transition: all 0.3s ease;
        }
        .fab-options.show {
            opacity: 1;
            transform: translateY(0);
            pointer-events: all;
        }
        .fab-option {
            display: flex;
            align-items: center;
            gap: 10px;
            background: white;
            padding: 10px 16px 10px 12px;
            border-radius: 30px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.15);
            cursor: pointer;
            transition: all 0.2s;
            animation: fabPopIn 0.3s ease forwards;
        }
        .fab-option:hover { transform: translateX(-5px); }
        .fab-option-icon {
            width: 40px;
            height: 40px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
        }
        .fab-option-icon.consulta { background: #E0F2FE; }
        .fab-option-icon.ia { background: #F3E8FF; }
        .fab-option-icon.comunidade { background: #FEF3C7; }
        .fab-option-icon.sos { background: #FEE2E2; }
        .fab-option-label { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
        @keyframes fabPopIn {
            from { opacity: 0; transform: scale(0.5) translateX(20px); }
            to { opacity: 1; transform: scale(1) translateX(0); }
        }

        /* Quick Actions Bar - Below Hero */
        .quick-actions-bar {
            display: flex;
            gap: 8px;
            padding: 0 20px 8px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .quick-actions-bar::-webkit-scrollbar { display: none; }
        .quick-action-chip {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 10px 16px;
            background: white;
            border: 1px solid var(--border);
            border-radius: 24px;
            font-size: 13px;
            font-weight: 500;
            color: var(--text);
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            flex-shrink: 0;
        }
        .quick-action-chip:active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            transform: scale(0.95);
        }
        .quick-action-chip .chip-icon { font-size: 16px; }

        /* Improved navigation with badges */
        .nav-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            min-width: 18px;
            height: 18px;
            background: var(--danger);
            color: white;
            border-radius: 9px;
            font-size: 10px;
            font-weight: 700;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 5px;
        }

        /* Smooth page transitions */
        .screen {
            animation: screenFadeIn 0.3s ease;
        }
        @keyframes screenFadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Welcome message animation */
        .welcome-wave {
            display: inline-block;
            animation: wave 1.5s ease-in-out infinite;
            transform-origin: 70% 70%;
        }
        @keyframes wave {
            0%, 100% { transform: rotate(0deg); }
            25% { transform: rotate(20deg); }
            75% { transform: rotate(-10deg); }
        }

        /* App Layout Wrapper */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        /* Main Content Area */
        .main-content {
            flex: 1;
            min-width: 0;
        }
