/**
 * Merpati Pos - Main CSS
 * Theme: Pedesaan Romantis
 * Mobile-First Design
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --primary: #2d5016;
    --primary-light: #4a7c2e;
    --primary-dark: #1a3009;
    --secondary: #8B6914;
    --accent: #D4A843;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --bg: #f5f0e6;
    --bg-card: #ffffff;
    --text: #2c1810;
    --text-light: #6b5a4e;
    --text-muted: #9e8e7e;
    --border: #e0d5c5;
    --shadow: 0 2px 12px rgba(45, 80, 22, 0.08);
    --shadow-lg: 0 8px 30px rgba(45, 80, 22, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font: 'Nunito', -apple-system, sans-serif;
    --font-display: 'Caveat', cursive;
    --nav-height: 60px;
    --bottom-nav-height: 65px;
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

/* ============================================
   App Bar (Top)
   ============================================ */
.app-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.app-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.app-bar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 800;
    font-size: 18px;
}

.logo-emoji {
    font-size: 24px;
}

.app-bar-actions {
    display: flex;
    gap: 8px;
}

.app-bar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    position: relative;
    transition: background 0.2s;
}

.app-bar-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

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

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding-top: var(--nav-height);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: 100vh;
}

.page-content {
    padding: 16px;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 1000;
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 20px;
}

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

.nav-compose {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px !important;
    margin-top: -20px;
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
}

/* ============================================
   Flash Messages
   ============================================ */
.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease;
    font-size: 13px;
    font-weight: 600;
}

.flash-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.flash-hide {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
}

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

/* ============================================
   Page Headers
   ============================================ */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 800;
}

.page-header-simple {
    margin-bottom: 20px;
}

.page-header-simple h1 {
    font-size: 22px;
    font-weight: 800;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    box-shadow: var(--shadow);
}

/* ============================================
   Welcome Header
   ============================================ */
.welcome-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.welcome-text h1 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.cage-info {
    font-size: 13px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cage-code {
    font-family: monospace;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 700;
}

.coins-badge {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    padding: 8px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(246, 211, 101, 0.3);
}

.coins-amount {
    font-weight: 800;
    font-size: 13px;
    color: #5a3e1b;
}

/* ============================================
   Stats Row
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Sections
   ============================================ */
.section {
    margin-bottom: 24px;
}

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

.section-header h2 {
    font-size: 16px;
    font-weight: 800;
}

.unread-badge {
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================
   Flight Cards (Active)
   ============================================ */
.flight-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.flight-card:active {
    transform: scale(0.98);
}

.flight-bird {
    font-size: 32px;
    animation: birdFly 1.5s ease-in-out infinite;
}

@keyframes birdFly {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.flight-info {
    flex: 1;
}

.flight-route {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
}

.flight-route i {
    color: var(--primary);
    font-size: 12px;
}

.cage-from, .cage-to {
    font-family: monospace;
    font-size: 11px;
}

.flight-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.flight-arrow {
    color: var(--text-muted);
}

/* ============================================
   Compose FAB
   ============================================ */
.compose-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.compose-fab:active {
    transform: scale(0.97);
}

.compose-fab i {
    font-size: 18px;
}

/* ============================================
   Message List
   ============================================ */
.message-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    position: relative;
}

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

.message-item:active {
    background: rgba(45, 80, 22, 0.03);
}

.message-item.unread {
    background: rgba(45, 80, 22, 0.03);
}

.message-avatar {
    font-size: 28px;
    flex-shrink: 0;
}

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

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.message-sender {
    font-weight: 700;
    font-size: 13px;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-subject {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}

.message-preview {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-status {
    margin-top: 4px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

/* ============================================
   Compose Form
   ============================================ */
.compose-form {
    max-width: 100%;
}

.form-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.form-section h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
}

.bird-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.bird-option input {
    display: none;
}

.bird-option .bird-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.bird-option input:checked + .bird-card {
    border-color: var(--primary);
    background: rgba(45, 80, 22, 0.05);
}

.bird-option.disabled .bird-card {
    opacity: 0.5;
    cursor: not-allowed;
}

.bird-emoji {
    font-size: 32px;
}

.bird-name {
    font-weight: 700;
    font-size: 12px;
    margin: 4px 0;
}

.bird-stats-mini {
    display: flex;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
}

.bird-level {
    font-size: 10px;
    color: var(--primary);
    font-weight: 700;
    margin-top: 4px;
}

.bird-warning {
    font-size: 10px;
    color: var(--danger);
    font-weight: 700;
}

.friend-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.friend-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.friend-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    background: white;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.char-count {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(45, 80, 22, 0.25);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
}

/* ============================================
   Tracking Canvas
   ============================================ */
.tracking-canvas-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.tracking-canvas-wrapper canvas {
    width: 100%;
    height: 100px;
    display: block;
}

.flight-progress-bar {
    height: 6px;
    background: var(--border);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ============================================
   Flight Detail Card
   ============================================ */
.flight-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.flight-route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.route-point {
    text-align: center;
    flex: 1;
}

.route-icon {
    font-size: 24px;
    display: block;
}

.route-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 12px;
    display: block;
}

.route-name {
    font-size: 11px;
    color: var(--text-muted);
}

.route-arrow {
    text-align: center;
    color: var(--primary);
}

.route-arrow i {
    font-size: 20px;
}

.route-distance {
    font-size: 10px;
    color: var(--text-muted);
    display: block;
}

/* ============================================
   Bird Status Card
   ============================================ */
.bird-status-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

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

.bird-emoji-lg {
    font-size: 40px;
}

.bird-bars .bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.bar-label {
    font-size: 12px;
    width: 70px;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
}

.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }
.bg-info { background: var(--info); }

/* ============================================
   ETA Card
   ============================================ */
.eta-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    color: white;
    text-align: center;
}

.eta-label {
    font-size: 12px;
    opacity: 0.8;
}

.eta-value {
    font-size: 20px;
    font-weight: 800;
    display: block;
}

.eta-actual {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

/* ============================================
   Message Detail
   ============================================ */
.message-full-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.msg-from {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bird-emoji {
    font-size: 32px;
}

.msg-sender {
    font-weight: 700;
}

.msg-cage {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.msg-time {
    font-size: 11px;
    color: var(--text-muted);
}

.msg-subject-full {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 12px;
}

.msg-body {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.msg-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.msg-status-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-distance {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Timeline
   ============================================ */
.events-section {
    margin-top: 20px;
}

.events-section h4 {
    font-size: 14px;
    margin-bottom: 12px;
}

.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.timeline-dot {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
}

.timeline-info .timeline-dot { background: var(--info); }
.timeline-warning .timeline-dot { background: var(--warning); }
.timeline-danger .timeline-dot { background: var(--danger); }

.timeline-text {
    font-size: 13px;
    line-height: 1.4;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   Bird Profile Card
   ============================================ */
.bird-profile-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.bird-profile-emoji {
    font-size: 64px;
    margin-bottom: 8px;
    position: relative;
}

.dead-bird {
    filter: grayscale(1);
}

.dead-overlay, .dead-overlay-lg {
    position: absolute;
    font-size: 32px;
    right: -10px;
    bottom: 0;
}

.dead-overlay-lg {
    font-size: 48px;
}

.bird-species-badge, .bird-level-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin: 0 4px;
}

.bird-species-badge {
    background: rgba(45, 80, 22, 0.1);
    color: var(--primary);
}

.bird-level-badge {
    background: rgba(139, 105, 20, 0.1);
    color: var(--secondary);
}

/* ============================================
   Bird Stats Grid
   ============================================ */
.bird-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.bird-stats-grid .stat-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.bird-stats-grid .stat-icon {
    font-size: 20px;
}

.bird-stats-grid .stat-value {
    font-size: 18px;
    font-weight: 800;
}

.bird-stats-grid .stat-label {
    font-size: 10px;
}

/* ============================================
   Vital Bars (Hunger/Thirst)
   ============================================ */
.vital-bars {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.vital-item {
    margin-bottom: 12px;
}

.vital-item:last-child {
    margin-bottom: 0;
}

.vital-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.vital-icon {
    font-size: 16px;
}

.vital-label {
    font-weight: 700;
    font-size: 13px;
    flex: 1;
}

.vital-value {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-muted);
}

.vital-track {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.vital-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s;
}

/* ============================================
   Bird Actions
   ============================================ */
.bird-actions {
    margin-bottom: 16px;
}

.action-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.action-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.action-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-icon {
    font-size: 20px;
}

.action-name {
    font-weight: 700;
    font-size: 13px;
    flex: 1;
}

.action-detail {
    font-size: 11px;
    color: var(--text-muted);
}

.action-qty {
    font-size: 11px;
    color: var(--primary);
    font-weight: 700;
}

/* ============================================
   Bird List Card
   ============================================ */
.bird-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bird-list-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.bird-list-card:active {
    transform: scale(0.98);
}

.bird-list-card.dead {
    opacity: 0.6;
}

.bird-card-emoji {
    font-size: 36px;
    position: relative;
}

.bird-card-info {
    flex: 1;
    min-width: 0;
}

.bird-card-info h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.bird-species {
    font-size: 11px;
    color: var(--text-muted);
}

.bird-bars-mini {
    margin-top: 6px;
}

.bar-mini {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    margin-bottom: 2px;
}

.bar-track-mini {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill-mini {
    height: 100%;
    border-radius: 2px;
}

.bird-card-arrow {
    color: var(--text-muted);
}

/* ============================================
   Bird Stats Summary
   ============================================ */
.bird-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bs-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    box-shadow: var(--shadow);
}

.bs-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.bs-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   Shop
   ============================================ */
.coins-display {
    font-weight: 800;
    font-size: 16px;
    color: var(--secondary);
}

.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

.shop-card.disabled {
    opacity: 0.5;
}

.shop-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.shop-info {
    flex: 1;
    min-width: 0;
}

.shop-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.shop-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.shop-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.stat-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.stat-badge.success {
    background: #d4edda;
    color: #155724;
}

.stat-badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

.stat-badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.shop-price {
    font-weight: 800;
    color: var(--secondary);
    font-size: 13px;
}

.shop-owned {
    font-size: 11px;
    color: var(--text-muted);
}

.shop-action {
    flex-shrink: 0;
}

/* ============================================
   Friends
   ============================================ */
.add-friend-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.add-friend-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.inline-form .input-group {
    display: flex;
    gap: 8px;
}

.inline-form input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

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

.friend-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

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

.friend-item.pending {
    opacity: 0.7;
}

.friend-avatar {
    font-size: 32px;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 700;
    font-size: 14px;
}

.friend-cage {
    font-size: 12px;
    color: var(--text-muted);
}

.friend-cage .cage-code {
    font-family: monospace;
}

.friend-actions-inline {
    display: flex;
    gap: 6px;
}

/* ============================================
   Cage Profile
   ============================================ */
.cage-profile-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.cage-avatar {
    font-size: 64px;
    margin-bottom: 8px;
}

.cage-code-large {
    font-family: monospace;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    background: white;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin: 8px 0;
    letter-spacing: 3px;
}

.cage-owner {
    font-size: 13px;
    color: var(--text-light);
}

.cage-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
}

.cage-stat {
    text-align: center;
}

.cage-stat-value {
    font-weight: 800;
    font-size: 18px;
    color: var(--primary);
    display: block;
}

.cage-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.cage-edit-section, .share-section, .bird-stats-section, .logout-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.share-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.share-code {
    font-family: monospace;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-card-sm {
    text-align: center;
    padding: 10px 6px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.stat-card-sm .stat-icon {
    font-size: 18px;
}

.stat-card-sm .stat-value {
    font-size: 16px;
    font-weight: 800;
}

.stat-card-sm .stat-label {
    font-size: 10px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state.small {
    padding: 24px 16px;
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.empty-state p {
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-state small {
    color: var(--text-muted);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-page {
    background: linear-gradient(180deg, #e8f5e9 0%, #f5f0e6 50%, #fff3e0 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.auth-header h1 {
    font-size: 20px;
    font-weight: 800;
}

.auth-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form .form-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font);
}

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

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.register-benefits {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}

.register-benefits ul {
    list-style: none;
    padding: 0;
    margin-top: 6px;
}

.register-benefits li {
    padding: 3px 0;
}

/* ============================================
   Landing Page
   ============================================ */
.landing-page {
    background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 40%, #C8E6C9 70%, #4CAF50 100%);
    min-height: 100vh;
    overflow: hidden;
}

.landing-hero {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.flying-birds {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
}

.bird {
    position: absolute;
    font-size: 28px;
    animation: flyAcross 8s linear infinite;
}

.bird-1 { top: 0; animation-delay: 0s; }
.bird-2 { top: 30px; animation-delay: 2s; font-size: 22px; }
.bird-3 { top: 60px; animation-delay: 4s; font-size: 18px; }

@keyframes flyAcross {
    0% { left: -40px; transform: scaleX(1); }
    49% { transform: scaleX(1); }
    50% { left: calc(100% + 40px); transform: scaleX(-1); }
    100% { left: -40px; transform: scaleX(-1); }
}

.clouds {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
}

.cloud {
    position: absolute;
    font-size: 40px;
    opacity: 0.7;
    animation: cloudFloat 20s linear infinite;
}

.cloud-1 { top: 0; left: 10%; animation-delay: 0s; }
.cloud-2 { top: 40px; left: 50%; animation-delay: 5s; font-size: 30px; }
.cloud-3 { top: 20px; left: 80%; animation-delay: 10s; font-size: 35px; }

@keyframes cloudFloat {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

.landing-content {
    text-align: center;
    z-index: 10;
    max-width: 400px;
}

.landing-logo {
    margin-bottom: 30px;
}

.logo-big {
    font-size: 80px;
    display: block;
    animation: birdFly 2s ease-in-out infinite;
}

.landing-title {
    font-family: var(--font-display);
    font-size: 42px;
    color: var(--primary-dark);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.landing-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin-top: 4px;
}

.landing-illustration {
    margin: 24px 0;
}

.scene {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 32px;
}

.message-trail span {
    animation: bounce 1s ease-in-out infinite;
    display: inline-block;
}

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

.landing-features {
    margin: 24px 0;
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.feature-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.feature-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.landing-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.btn-landing {
    padding: 16px 32px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 16px;
    text-align: center;
    transition: transform 0.2s;
}

.btn-landing:active {
    transform: scale(0.97);
}

.btn-primary-landing {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
}

.btn-secondary-landing {
    background: rgba(255,255,255,0.8);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    padding: 20px;
    text-align: center;
}

.grass {
    font-size: 24px;
    letter-spacing: 8px;
}

/* ============================================
   Error Page
   ============================================ */
.error-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container {
    text-align: center;
    color: white;
    padding: 40px;
}

.error-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.error-code {
    font-size: 80px;
    font-weight: 800;
    opacity: 0.3;
    line-height: 1;
}

.error-container h1 {
    font-size: 20px;
    margin: 16px 0 8px;
}

.error-container p {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 24px;
}

/* ============================================
   Bird History
   ============================================ */
.bird-history {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.bird-history h3 {
    font-size: 14px;
    margin-bottom: 12px;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.history-item {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.history-label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.history-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
    .page-content {
        max-width: 480px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
    }

    .app-bar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 20px 20px;
    }
}

/* ============================================
   Alert (Auth pages)
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

/* ============================================
   Pagination
   ============================================ */
.pagination-wrapper {
    margin-top: 16px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    list-style: none;
}

.page-link {
    padding: 8px 12px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.page-link:hover {
    background: var(--primary);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
}

/* ============================================
   Send Note
   ============================================ */
.send-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ============================================
   Dead Bird Animation
   ============================================ */
.dead-bird {
    animation: none;
}
