:root {
    /* Petlify Brand Colors */
    --petlify-green: #7CB342;
    --petlify-teal: #4DB6AC;
    --petlify-teal-dark: #26A69A;
    --petlify-navy: #1A4D5C;

    /* Legacy/Complementary */
    --primary-orange: #FF9F4A;
    --primary-orange-hover: #e68840;
    --secondary-blue: #64B5F6;

    --bg-color: #F8F9FA;
    --text-dark: #2D3748;
    --text-light: #718096;
    --card-white: #FFFFFF;
    --success-green: #48BB78;
    --highlight-yellow: #FFD54F;
    --alert-red: #EF5350;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: transparent;
}

.user-welcome h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
}

.wave {
    display: inline-block;
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% {
        transform: rotate(0.0deg)
    }

    10% {
        transform: rotate(14.0deg)
    }

    20% {
        transform: rotate(-8.0deg)
    }

    30% {
        transform: rotate(14.0deg)
    }

    40% {
        transform: rotate(-4.0deg)
    }

    50% {
        transform: rotate(10.0deg)
    }

    60% {
        transform: rotate(0.0deg)
    }

    100% {
        transform: rotate(0.0deg)
    }
}

.notification-btn {
    background: var(--card-white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
}

.badge-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--primary-orange);
    border-radius: 50%;
    border: 2px solid var(--card-white);
}

/* Home Page Wave Background */
body.home-page {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(248, 249, 250, 0.3) 50%, #F8F9FA 100%);
    background-image: url('../assets/ondas-home-bg.webp'), linear-gradient(180deg, #E3F2FD 0%, #F8F9FA 100%);
    background-size: 100% auto, 100%;
    background-position: center 50px, center;
    background-repeat: no-repeat, repeat;
    background-attachment: scroll, scroll;
}

/* Hero Decoration */
.hero-decoration {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 30px;
    margin-top: -10px;
    margin-bottom: -20px;
    z-index: 0;
    position: relative;
    padding: 20px;
}

.mascot {
    width: 90px;
    height: 90px;
    object-fit: contain;
    animation: mascot-float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

@keyframes mascot-float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

.mascot-left {
    animation-delay: 0s;
}

.mascot-right {
    animation-delay: 0.5s;
}

/* Status Card */
.status-card-container {
    padding: 0 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

.status-card {
    background: linear-gradient(135deg, var(--petlify-green) 0%, #8BC34A 100%);
    color: white;
    padding: 20px;
    border-radius: 18px;
    margin: 0;
    /* Remove margin to match button width */
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(124, 179, 66, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124, 179, 66, 0.3), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-card:active {
    transform: translateY(0px);
    box-shadow: 0 4px 16px rgba(124, 179, 66, 0.25);
}

.status-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.truck-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.status-label {
    font-size: 0.85rem;
    opacity: 0.9;
    display: block;
}

.status-text {
    flex: 1;
    min-width: 0;
    /* Essential for text-overflow to work in flex */
}

.status-text h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Progress Bar */
.progress-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.progress-bar-bg {
    background: rgba(255, 255, 255, 0.3);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    background: var(--primary-orange);
    height: 100%;
    border-radius: 10px;
    position: relative;
}

.progress-percent {
    position: absolute;
    right: 5px;
    top: -18px;
    font-size: 0.7rem;
    font-weight: 800;
    color: white;
}

.progress-info {
    font-size: 0.8rem;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Action Button */
.action-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.btn-primary {
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 159, 74, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 159, 74, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    animation: button-bounce 0.3s;
}

@keyframes button-bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.95);
    }
}

/* Action Grid 2x2 */
.action-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 160px;
    /* Space for banner + nav */
}

.action-card {
    background: linear-gradient(135deg, #FF9F4A 0%, #FF6F00 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-height: 100px;
}

.action-card i {
    font-size: 1.8rem;
}

.action-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.action-card:active {
    transform: translateY(-2px);
}

/* Card Colors */
.orange-card {
    background: linear-gradient(135deg, #FF9F4A 0%, #FF6F00 100%);
}

.yellow-card {
    background: linear-gradient(135deg, #FFD166 0%, #FFA726 100%);
}

.green-card {
    background: linear-gradient(135deg, #66D9A5 0%, #38A169 100%);
}

.purple-card {
    background: linear-gradient(135deg, #B794F4 0%, #6B46C1 100%);
}

/* Ad Banner */
.ad-banner-link {
    text-decoration: none;
    display: block;
    margin: 0 20px 24px 20px;
}

.ad-banner {
    background: #5A2D81;
    /* Petlove purple approx */
    border-radius: var(--radius-md);
    padding: 16px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ad-banner:active {
    transform: scale(0.98);
}

.ad-content .brand-logo {
    font-weight: 900;
    font-size: 1.1rem;
    margin-bottom: 4px;
    display: block;
    color: #FFD700;
    /* Gold highlight for brand */
}

.ad-content p {
    font-size: 0.9rem;
    line-height: 1.3;
}

.ad-content .small {
    font-size: 0.75rem;
    opacity: 0.8;
    text-decoration: underline;
}

/* Banner Carousel */
.banner-carousel-container {
    margin: 0 20px 24px 20px;
    position: relative;
}

.banner-carousel {
    position: relative;
    height: 80px;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    text-decoration: none;
    display: block;
}

.banner-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-indicator.active {
    background: var(--primary-orange);
    width: 24px;
    border-radius: 6px;
    transform: scale(1);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-white);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px 0;
    /* Extra padding for iPhone home bar */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #A0AEC0;
    font-size: 0.75rem;
    gap: 4px;
    transition: color 0.3s;
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-item.active,
.nav-item.active i,
.nav-item.active span {
    background: linear-gradient(135deg, #1E3A8A 0%, #14B8A6 50%, #7CB342 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Fallback for images (paw icon) */
.nav-item.active .nav-paw-icon {
    filter: drop-shadow(0 0 2px #14B8A6);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(20px);
    background: var(--alert-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--card-white);
}

/* Navigation Paw Icon - Global */
.nav-paw-icon {
    width: 31px;
    height: 31px;
    object-fit: contain;
    margin-bottom: -2px;
    /* Slight adjustment for alignment */
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-dark);
    transition: border-color 0.2s;
    background: #FAFAFA;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    background: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-card {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 14px;
    pointer-events: auto;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 6px solid var(--primary-orange);
}

.toast-card.fadeOut {
    animation: toast-out 0.4s forwards cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

.toast-icon {
    width: 40px;
    height: 40px;
    background: #FFF3E0;
    color: var(--primary-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.4;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
}