/**
 * Custom Mobile-First Styles for GPF Tracker (กบข.)
 * Designed for smartphones with touch targets, safe areas, and smooth animations.
 */

:root {
    --primary: #4f46e5;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --surface: #ffffff;
    --bg-page: #f8fafc;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: #1e293b;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* รองรับ SafeArea ของ iOS Notch / Home Bar */
.safe-bottom {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 16px));
}

.bottom-nav-safe {
    padding-bottom: env(safe-area-inset-bottom, 12px);
}

/* Glassmorphism & Soft Surfaces */
.glass-nav {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Smooth Touch Buttons */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Custom Scrollbar for sleek UI */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Bottom Nav Active State */
.nav-item.active {
    color: #4f46e5;
    font-weight: 600;
}

.nav-item.active .nav-icon-wrapper {
    background-color: #eef2ff;
    transform: translateY(-2px);
}

/* Tap to Upload Zone */
.dropzone-active {
    border-color: #4f46e5 !important;
    background-color: #eef2ff !important;
}

/* Chart Canvas container fix for mobile */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 220px;
}
