/* ============================================
   CSS VARIABLES & ROOT STYLES
   ============================================ */

:root {
    /* Primary Colors - Based on Robovito Design */
    --primary-color: #2d9e48;
    --primary-light: #5dae73;
    --primary-lighter: #d9f0de;
    --primary-dark: #1a5c28;
    
    /* Neutrals */
    --background: #ffffff;
    --foreground: #1a1a1a;
    --surface: #f5f5f5;
    --surface-light: #fafafa;
    --border: #e0e0e0;
    --text-secondary: #666666;
    --text-muted: #999999;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Safe Area */
    --safe-area-top: 0;
    --safe-area-right: 0;
    --safe-area-bottom: 0;
    --safe-area-left: 0;
}

/* Dark Mode */
body.dark-mode {
    --background: #1a1a1a;
    --foreground: #ffffff;
    --surface: #2a2a2a;
    --surface-light: #333333;
    --border: #404040;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--foreground);
    background-color: var(--background);
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* Remove default mobile browser behaviors */
input,
button,
textarea,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    padding: 0 var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
}

.logo-icon {
    font-size: var(--font-size-2xl);
}

.logo-text {
    letter-spacing: -0.5px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
}

.theme-toggle:active {
    background-color: var(--border);
    transform: scale(0.95);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-2xl) var(--space-md);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: drift 20s linear infinite;
}

@keyframes drift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.hero p {
    font-size: var(--font-size-lg);
    opacity: 0.95;
    margin-bottom: var(--space-lg);
}

.hero-emoji {
    font-size: var(--font-size-3xl);
    letter-spacing: var(--space-sm);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   CONTAINER & SPACING
   ============================================ */

.container {
    max-width: 100%;
    padding: var(--space-xl) var(--space-md);
    padding-bottom: 100px; /* Space for bottom nav */
}

section {
    margin-bottom: var(--space-2xl);
}

section h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--foreground);
}

section h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

/* ============================================
   STATS SECTION
   ============================================ */

.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.stat-card:hover {
    background-color: var(--surface-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-number {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================
   PETS GRID
   ============================================ */

.pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-md);
}

.pet-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
}

.pet-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-lg);
}

.pet-image {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, var(--primary-lighter), var(--surface));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
}

.pet-info {
    padding: var(--space-md);
}

.pet-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
}

.pet-type {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.pet-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: var(--font-size-sm);
}

/* ============================================
   ACTIONS SECTION
   ============================================ */

.actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.action-btn {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
    color: var(--foreground);
    font-weight: 500;
}

.action-btn:active {
    background-color: var(--primary-lighter);
    border-color: var(--primary-color);
    transform: scale(0.95);
}

.action-icon {
    font-size: var(--font-size-2xl);
}

.action-text {
    font-size: var(--font-size-sm);
    text-align: center;
}

/* ============================================
   FEATURES SECTION
   ============================================ */

.features-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.feature-item {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

.feature-icon {
    font-size: var(--font-size-2xl);
    flex-shrink: 0;
    line-height: 1;
}

.feature-text h3 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.feature-text p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================
   TRUST SECTION
   ============================================ */

.trust-section {
    background: linear-gradient(135deg, var(--primary-lighter), var(--surface));
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.trust-section h3 {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-md);
}

.trust-section p {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    padding: var(--space-sm) 0;
    padding-bottom: var(--space-sm);
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    transition: all var(--transition-fast);
    flex: 1;
}

.nav-item:active {
    transform: scale(1.1);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: var(--font-size-xl);
}

.nav-label {
    font-weight: 500;
}

/* ============================================
   LOADING & ANIMATIONS
   ============================================ */

.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--surface);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 300;
}

.toast {
    background-color: var(--surface);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    min-width: 250px;
    animation: slideIn 300ms ease-out;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--error);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 640px) {
    .hero h1 {
        font-size: var(--font-size-2xl);
    }
    
    .hero p {
        font-size: var(--font-size-base);
    }
    
    .container {
        padding: var(--space-lg) var(--space-md);
    }
    
    section h2 {
        font-size: var(--font-size-xl);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .bottom-nav,
    .header {
        display: none;
    }
}
