/* Mobile App Styles for Gram Panchayat Januna */
:root {
    --primary-color: #FF9800;
    --secondary-color: #4CAF50;
    --accent-color: #2196F3;
    --error-color: #F44336;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --text-primary: #212121;
    --text-secondary: #757575;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --border-color: #E0E0E0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    overflow-x: hidden;
    padding-bottom: 70px;
    /* Space for bottom nav */
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary-color), #F57C00);
    color: white;
    padding: 12px 16px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    padding: 4px;
}

.header-title h1 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.header-title p {
    font-size: 11px;
    opacity: 0.9;
    margin: 2px 0 0 0;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.header-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Quick Stats Banner */
.quick-stats {
    background: white;
    padding: 16px;
    margin: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-item {
    text-align: center;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Quick Links Grid */
.quick-links {
    padding: 0 16px 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.link-card {
    background: white;
    border-radius: 12px;
    padding: 16px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.link-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-lg);
}

.link-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), #F57C00);
    color: white;
}

.link-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* News/Announcements Carousel */
.announcements-section {
    padding: 16px;
    background: white;
    margin: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.announcement-carousel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 12px;
    padding: 12px 0;
    scrollbar-width: none;
}

.announcement-carousel::-webkit-scrollbar {
    display: none;
}

.announcement-card {
    min-width: 280px;
    scroll-snap-align: start;
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--accent-color);
}

.announcement-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.announcement-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.announcement-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Featured Services */
.featured-services {
    padding: 16px;
}

.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
}

.service-item:active {
    transform: scale(0.98);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary-color), #388E3C);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.service-info {
    flex: 1;
}

.service-info h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.service-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.service-arrow {
    color: var(--text-secondary);
    font-size: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s;
    border-radius: 8px;
    min-width: 60px;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:active {
    background: var(--bg-secondary);
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--error-color), #D32F2F);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.fab:active {
    transform: scale(0.95);
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 70px;
    left: 16px;
    right: 16px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 98;
    animation: slideUp 0.3s ease;
}

.install-prompt.show {
    display: flex;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-icon {
    font-size: 32px;
}

.install-content {
    flex: 1;
}

.install-content h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.install-content p {
    font-size: 12px;
    color: var(--text-secondary);
}

.install-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.install-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 60px;
    left: 16px;
    right: 16px;
    background: var(--warning-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 99;
}

.offline-indicator.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .links-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .quick-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Pull to refresh indicator */
.pull-to-refresh {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    font-size: 12px;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 99;
}

.pull-to-refresh.show {
    display: flex;
}

/* Emergency Contact Banner */
.emergency-banner {
    background: linear-gradient(135deg, var(--error-color), #D32F2F);
    color: white;
    padding: 12px 16px;
    margin: 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.emergency-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emergency-icon {
    font-size: 28px;
}

.emergency-text h3 {
    font-size: 13px;
    margin-bottom: 2px;
}

.emergency-text p {
    font-size: 16px;
    font-weight: 700;
}

.emergency-call {
    background: white;
    color: var(--error-color);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}