* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --accent: #e94560;
    --accent-gradient: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --success: #4ade80;
    --warning: #fbbf24;
    --info: #38bdf8;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 1000;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    background: var(--accent-gradient);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 20px 60px rgba(233, 69, 96, 0.4);
    font-size: 60px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.loading-location {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    text-align: center;
}

.loading-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
}

.weather-temp {
    font-size: 72px;
    font-weight: 300;
    letter-spacing: -2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.weather-desc {
    font-size: 18px;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.weather-location {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.loading-time {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
}

.loading-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.loading-footer a {
    color: var(--accent);
    text-decoration: none;
}

.current-time {
    font-size: 48px;
    font-weight: 200;
    letter-spacing: -1px;
    line-height: 1;
}

.current-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Main App */
.app-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 100px;
}

.app-header {
    position: sticky;
    top: 0;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px 20px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-title span {
    color: var(--accent);
}

.header-weather {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.header-weather-icon {
    font-size: 20px;
}

/* Section */
.section {
    padding: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.section-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* News Cards */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.news-card:active {
    transform: scale(0.98);
}

.news-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.news-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent);
}

.news-category.info { background: rgba(56, 189, 248, 0.15); color: var(--info); }
.news-category.warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.news-category.success { background: rgba(74, 222, 128, 0.15); color: var(--success); }

.news-time {
    font-size: 12px;
    color: var(--text-muted);
}

.news-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-preview {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Project Blocks */
.project-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.project-block {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.project-block:active {
    transform: scale(0.97);
}

.project-block.wide {
    grid-column: span 2;
    text-align: left;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}

.project-block.wide .project-icon {
    margin: 0 16px 0 0;
    flex-shrink: 0;
}

.project-content {
    display: flex;
    align-items: center;
}

.project-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.project-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.project-stat {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}

.project-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 0 -20px;
    padding: 0 20px 8px;
}

.quick-action {
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 160px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-action:active {
    background: var(--bg-secondary);
}

.quick-action:hover {
    background: var(--bg-secondary);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.quick-action-icon.emergency { background: rgba(233, 69, 96, 0.15); }
.quick-action-icon.services { background: rgba(56, 189, 248, 0.15); }
.quick-action-icon.transport { background: rgba(74, 222, 128, 0.15); }

.quick-action-text {
    font-size: 13px;
    font-weight: 500;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s ease;
    cursor: pointer;
}

.nav-item.active {
    color: var(--accent);
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0;
}

/* News loading */
.news-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner-small {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* News on main page */
.main-news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.main-news-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    transition: transform 0.2s ease;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: var(--text-primary);
}

.main-news-card:active {
    transform: scale(0.98);
}

.main-news-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.main-news-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent);
}

.main-news-category.info { background: rgba(56, 189, 248, 0.15); color: var(--info); }
.main-news-category.warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.main-news-category.success { background: rgba(74, 222, 128, 0.15); color: var(--success); }

.main-news-time {
    font-size: 12px;
    color: var(--text-muted);
}

.main-news-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 6px;
}

.main-news-preview {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* News page styles */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}

.news-item:active {
    transform: scale(0.98);
}

.news-item-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(233, 69, 96, 0.15);
    color: var(--accent);
    margin-bottom: 10px;
}

.news-item-category.info { background: rgba(56, 189, 248, 0.15); color: var(--info); }
.news-item-category.warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.news-item-category.success { background: rgba(74, 222, 128, 0.15); color: var(--success); }

.news-item-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-item-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.news-item-source {
    color: var(--accent);
}

.news-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
}

.news-back:active {
    opacity: 0.7;
}

.no-news {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}
