* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
}

:root {
    --primary: #6750a4;
    --primary-dark: #5e47a1;
    --primary-light: #e8def8;
    --secondary: #7d5260;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --info: #2196f3;
    --light: #f8f9fa;
    --dark: #1c1b1f;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --surface: #fef7ff;
    --on-surface: #1c1b1f;
    --surface-variant: #e7e0ec;
    --bg-gradient: linear-gradient(135deg, #6750a4 0%, #4a4458 100%);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --nav-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --border-radius-lg: 20px;
    --border-radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 100%;
    min-height: 100vh;
    background: var(--surface);
    position: relative;
}

/* Enhanced Header */
.header {
    background: var(--bg-gradient);
    color: white;
    padding: 24px 16px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    margin: 0 8px 16px;
}

.header-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white;
    text-align: center;
    flex: 1;
    padding: 0 8px;
}

.header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
    margin-bottom: 16px;
}

.header-stats {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
}

/* Enhanced Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.side-menu-header {
    background: var(--bg-gradient);
    color: white;
    padding: 40px 24px 24px;
    text-align: center;
    position: relative;
}

.side-menu-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.side-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    margin-bottom: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-email {
    font-size: 14px;
    opacity: 0.9;
}

.side-menu-content {
    padding: 24px;
}

.menu-section {
    margin-bottom: 28px;
}

.menu-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    color: var(--dark);
    text-decoration: none;
    margin-bottom: 4px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.menu-item:hover {
    background: var(--gray-light);
}

.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 20px;
}

.menu-item-text {
    font-weight: 500;
    font-size: 15px;
}

.login-section {
    display: flex;
    align-items: center;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Main Content */
.main-content {
    padding: 0 16px 90px;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Cards */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--surface-variant);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    width: 100%;
}

.card-subtitle {
    font-size: 14px;
    color: var(--gray);
    margin-top: 4px;
    text-align: center;
    width: 100%;
}

.card-action {
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.card-action:hover {
    background: var(--primary-light);
}

/* Enhanced Profile Cards Grid */
.profile-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.profile-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6eeff 100%);
    padding: 20px 16px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid rgba(67, 97, 238, 0.1);
    transition: var(--transition);
    cursor: pointer;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
}

.profile-card.highlight {
    background: var(--bg-gradient);
    color: white;
}

.profile-card.highlight::before {
    background: rgba(255, 255, 255, 0.3);
}

.profile-card.highlight .profile-value,
.profile-card.highlight .profile-label {
    color: white;
}

.profile-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}

.profile-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
    line-height: 1.2;
}

/* Enhanced Search */
.search-container {
    position: relative;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 16px 52px 16px 16px;
    border: 1px solid var(--surface-variant);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: white;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-icon:hover {
    background: var(--gray-light);
}

.voice-search-btn {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.voice-search-btn:hover {
    background: var(--primary-light);
}

/* Enhanced Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--surface-variant);
}

.pagination-btn {
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: var(--gray);
}

/* Enhanced Traffic List */
.traffic-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.traffic-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9ff;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    cursor: pointer;
}

.traffic-item:hover {
    background: #f0f4ff;
    transform: translateX(4px);
}

.traffic-item.high {
    border-left-color: var(--danger);
}

.traffic-item.medium {
    border-left-color: var(--warning);
}

.traffic-item.low {
    border-left-color: var(--success);
}

.traffic-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.traffic-icon.high { background: #ffebee; color: var(--danger); }
.traffic-icon.medium { background: #fff3e0; color: var(--warning); }
.traffic-icon.low { background: #e8f5e8; color: var(--success); }

.traffic-info {
    flex: 1;
}

.traffic-location {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.traffic-details {
    font-size: 13px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.traffic-time {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.traffic-severity {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.traffic-severity.high { background: #ffebee; color: var(--danger); }
.traffic-severity.medium { background: #fff3e0; color: var(--warning); }
.traffic-severity.low { background: #e8f5e8; color: var(--success); }

/* Enhanced Report Grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.report-btn {
    padding: 20px 12px;
    border: 1px solid var(--surface-variant);
    background: white;
    border-radius: var(--border-radius);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.report-btn:active {
    transform: scale(0.98);
    background: #f5f5f5;
}

.report-btn i {
    font-size: 24px;
}

.report-btn.heavy { border-color: #ffcdd2; color: var(--danger); }
.report-btn.accident { border-color: #ffccbc; color: var(--warning); }
.report-btn.blocked { border-color: #ffe0b2; color: #ff9800; }
.report-btn.water { border-color: #b3e5fc; color: var(--info); }
.report-btn.clear { border-color: #c8e6c9; color: var(--success); }
.report-btn.other { border-color: #e1bee7; color: #9c27b0; }

/* Enhanced Form Elements */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    color: var(--dark);
}

.text-input, .select-input, .textarea-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--surface-variant);
    border-radius: var(--border-radius);
    font-size: 16px;
    background: white;
    transition: var(--transition);
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
}

.text-input:focus, .select-input:focus, .textarea-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

/* Enhanced Time Selector */
.time-selector {
    display: flex;
    gap: 10px;
    margin: 16px 0;
}

.time-btn {
    flex: 1;
    padding: 14px 8px;
    border: 1px solid var(--surface-variant);
    background: white;
    border-radius: var(--border-radius);
    font-size: 14px;
    text-align: center;
    transition: var(--transition);
    color: var(--dark);
    font-weight: 500;
}

.time-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(103, 80, 164, 0.3);
}

/* Enhanced Primary Button */
.primary-btn {
    width: 100%;
    padding: 18px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(103, 80, 164, 0.3);
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.primary-btn:active::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.primary-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(103, 80, 164, 0.3);
}

.primary-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Enhanced Map Container */
#map {
    height: 240px;
    width: 100%;
    border-radius: var(--border-radius);
    margin: 16px 0;
    z-index: 1;
}

/* Enhanced Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--surface-variant);
    display: flex;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: var(--nav-shadow);
    backdrop-filter: blur(10px);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border: none;
    background: none;
    color: var(--gray);
    font-size: 12px;
    gap: 6px;
    transition: var(--transition);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
    margin: 0 4px;
    position: relative;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(103, 80, 164, 0.05);
}

.nav-icon {
    font-size: 22px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
    color: var(--primary);
}

.nav-text {
    font-weight: 500;
    transition: var(--transition);
}

.nav-item.active .nav-text {
    font-weight: 600;
    color: var(--primary);
}

.nav-indicator {
    position: absolute;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.nav-item.active .nav-indicator {
    opacity: 1;
}

/* Enhanced Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--dark);
    color: white;
    padding: 16px 24px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

/* Enhanced Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
    font-size: 15px;
}

.loading i {
    font-size: 28px;
    margin-bottom: 12px;
    color: var(--primary);
}

/* Form Validation Styles */
.input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2) !important;
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    transition: var(--transition);
    width: 0%;
}

.password-weak {
    background: var(--danger);
    width: 25%;
}

.password-medium {
    background: var(--warning);
    width: 50%;
}

.password-strong {
    background: var(--success);
    width: 100%;
}

/* Enhanced Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.login-modal.active {
    display: flex;
}

.login-modal-content {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.login-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.login-modal-subtitle {
    font-size: 16px;
    color: var(--gray);
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--surface-variant);
}

.login-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.login-tab.active {
    color: var(--primary);
}

.login-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

/* Enhanced Login Modal Styles */
.login-modal-content {
    background: white;
    border-radius: var(--border-radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--surface-variant);
}

.login-modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-modal-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-modal-subtitle {
    font-size: 16px;
    color: var(--gray);
    font-weight: 500;
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--surface-variant);
    background: var(--surface-variant);
    border-radius: var(--border-radius);
    padding: 4px;
}

.login-tab {
    flex: 1;
    padding: 14px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border-radius: var(--border-radius);
}

.login-tab.active {
    color: var(--primary);
    background: white;
    box-shadow: var(--card-shadow);
}

.login-input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--surface-variant);
    border-radius: var(--border-radius);
    font-size: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
    background: var(--surface);
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

.login-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(103, 80, 164, 0.3);
}

.login-submit-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 6px rgba(103, 80, 164, 0.3);
}

.guest-btn {
    width: 100%;
    padding: 16px;
    background: var(--gray);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.guest-btn:active {
    transform: translateY(2px);
}

/* Enhanced Profile Section Styles */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--surface-variant);
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(103, 80, 164, 0.3);
}

.profile-details {
    flex: 1;
}

.profile-name-large {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--dark);
}

.profile-email-large {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 8px;
}

.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(103, 80, 164, 0.2);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.profile-stat {
    background: white;
    padding: 20px 16px;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--surface-variant);
    transition: var(--transition);
    box-shadow: var(--card-shadow);
}

.profile-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.profile-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.profile-stat-label {
    font-size: 12px;
    color: var(--gray);
    font-weight: 500;
}

/* Mobile Responsive for Profile */
@media (max-width: 480px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .profile-avatar-large {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .profile-stat {
        padding: 16px 12px;
    }
    .profile-stat-value {
        font-size: 16px;
    }
    .login-modal-content {
        padding: 24px;
    }
    .login-modal-title {
        font-size: 24px;
    }
}

/* Verification Step Styles */
.verification-step {
    display: none;
}

.verification-step.active {
    display: block;
}

.verification-code {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.verification-code input {
    width: 40px;
    height: 40px;
    border: 2px solid var(--surface-variant);
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    transition: var(--transition);
}

.verification-code input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(103, 80, 164, 0.2);
}

/* Remember Me Checkbox */
.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.remember-me input {
    margin-right: 8px;
    width: 18px;
    height: 18px;
}

.remember-me label {
    font-size: 14px;
    color: var(--dark);
}

/* Password Reset Link */
.password-reset-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.password-reset-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Login Modal Footer */
.login-modal-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray);
}

.login-switch-mode {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Help Section Styles */
.help-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.help-item {
    padding: 16px;
    border: 1px solid var(--surface-variant);
    border-radius: var(--border-radius);
    background: white;
    transition: var(--transition);
}

.help-item:hover {
    box-shadow: var(--card-shadow);
}

.help-question {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
}

.help-answer {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.5;
    margin-left: 32px;
}

/* Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Fullscreen Map Styles */
.fullscreen-map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    display: none;
}

.map-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-gradient);
    color: white;
    padding: 16px;
    z-index: 2001;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-fullscreen {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.3);
}

#fullscreen-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Prediction Cards Styles */
.prediction-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000ff;
        --success: #008000;
        --warning: #ffa500;
        --danger: #ff0000;
    }
    .card {
        border: 2px solid var(--surface-variant);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Landscape orientation for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 12px 16px 8px;
        margin-bottom: 8px;
    }
    .header h1 {
        font-size: 18px;
    }
    .main-content {
        padding: 0 16px 70px;
    }
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
    .bottom-nav {
        padding: 4px 0;
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .main-content {
        padding: 0 8px 80px;
    }
    .card {
        padding: 12px;
    }
    .profile-cards-grid {
        grid-template-columns: 1fr;
    }
    .header h1 {
        font-size: 18px;
    }
    .header-stats {
        flex-direction: column;
        gap: 8px;
    }
    .stat-item {
        flex-direction: row;
        gap: 8px;
    }
}

/* Animation for live pulse */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.live-indicator::before {
    content: "";
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

/* Enhanced Guest Badge */
.guest-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --surface: #1c1b1f;
        --on-surface: #e6e1e5;
        --surface-variant: #49454f;
        --light: #2d2d2d;
        --gray-light: #3a3a3a;
    }
    .card {
        background: var(--light);
        border-color: var(--surface-variant);
    }
    .search-input, .text-input, .select-input, .textarea-input {
        background: var(--light);
        color: var(--on-surface);
        border-color: var(--surface-variant);
    }
}

/* Pull to refresh */
.pull-to-refresh {
    text-align: center;
    padding: 10px;
    color: var(--gray);
}

/* Connection status */
.connection-status {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--danger);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 1001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.connection-status.show {
    transform: translateY(0);
}

.connection-status.connected {
    background: var(--success);
}