:root {
    --primary: #1E6FD9;
    --primary-dark: #1557B0;
    --primary-light: #E3F2FD;
    --secondary: #FF8C42;
    --accent: #00BFA6;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --error: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --border: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --nav-height: 70px;
    --header-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 20px);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* Header Styles */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-back {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon-btn {
    position: relative;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.header-icon-btn.has-badge::after {
    content: attr(data-badge);
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary);
}

/* App Brand */
.app-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-name {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.2rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: var(--surface);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 0 10px;
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    flex: 1;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

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

.nav-item.active i {
    transform: translateY(-2px);
}

/* Layout Containers */
.app-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background-color: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(30, 111, 217, 0.3);
}

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

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

/* Grid System for Dashboard */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.menu-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
}

.menu-item:active .menu-icon {
    transform: scale(0.9);
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

/* Custom Icon Backgrounds */
.bg-orange { background: linear-gradient(135deg, #FFB75E, #ED8F03); color: white; }
.bg-blue { background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; }
.bg-teal { background: linear-gradient(135deg, #13f1fc, #0470dc); color: white; }
.bg-yellow { background: linear-gradient(135deg, #f6d365, #fda085); color: white; }
.bg-purple { background: linear-gradient(135deg, #a18cd1, #fbc2eb); color: white; }
.bg-green { background: linear-gradient(135deg, #84fab0, #8fd3f4); color: white; }

/* Dashboard Header */
.dash-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 30px 20px 60px 20px;
    margin: -20px -20px 20px -20px;
    color: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: relative;
}

.user-welcome h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.user-welcome p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.user-avatar-dash {
    position: absolute;
    top: 30px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
}

/* Stats Progress Card */
.stats-card {
    margin-top: -40px;
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-lg);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 1.4rem;
    font-weight: 700;
}

.stat-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-divider {
    font-size: 1.2rem;
    color: var(--border);
    font-weight: 300;
}

.progress-container {
    height: 8px;
    background-color: var(--primary-light);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
}

/* Recent Activity */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-info {
    flex: 1;
}

.activity-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(180deg, var(--primary-light) 0%, #ffffff 100%);
}

.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.login-brand .brand-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.login-brand h1 {
    font-size: 2.5rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Map Placeholder */
.map-container {
    width: 100%;
    height: 300px;
    background-color: #e5e7eb;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    color: var(--error);
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger { background-color: #FEE2E2; color: #B91C1C; }
.alert-success { background-color: #D1FAE5; color: #065F46; }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

/* Bottom Sheet (for mobile interactions) */
.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 2000;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
    padding: 30px 20px 40px 20px;
}

.bottom-sheet.open {
    bottom: 0;
}

.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
    backdrop-filter: blur(2px);
}

.sheet-overlay.open {
    display: block;
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background: var(--border);
    border-radius: 10px;
    margin: -15px auto 20px auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}
