/* ===== TULAY - OFW Emergency Connection ===== */
/* Glassmorphism Design System */

/* CSS Variables */
:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --secondary: #1e3a5f;
    --accent: #16a34a;
    --accent-light: #22c55e;
    --danger: #dc2626;
    --warning: #fbbf24;
    --info: #3b82f6;
    --purple: #a855f7;

    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-bg-hover: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 24px;

    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0a0f1a 0%, #1a1f3a 50%, #0d1b2a 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ===== BACKGROUND ANIMATIONS ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.4) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(30, 58, 95, 0.5) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

.orb-4 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, transparent 70%);
    bottom: 20%;
    right: 10%;
    animation-delay: -10s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.1); }
    50% { transform: translate(-30px, 40px) scale(0.95); }
    75% { transform: translate(-40px, -20px) scale(1.05); }
}

/* Rain Effect */
.rain-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 299;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.rain-effect.active {
    opacity: 1;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3));
    animation: rainFall linear infinite;
}

@keyframes rainFall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* ===== GLASS CARD ===== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.glass-card:active {
    transform: scale(0.98);
}

/* ===== APP CONTAINER ===== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 100px;
}

/* ===== HEADER ===== */
.header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-center {
    text-align: center;
}

.icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.icon-btn:hover {
    background: var(--glass-bg-hover);
}

.icon-btn:active {
    transform: scale(0.95);
}

.header-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #f97316 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.header-avatar:hover {
    transform: scale(1.05);
}

.header-avatar:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 9px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 0 5px;
}

/* ===== BALANCE CARD ===== */
.balance-card {
    padding: 24px;
    margin: 0 20px 20px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(30, 58, 95, 0.35) 100%);
    border: 1px solid rgba(255, 107, 53, 0.25);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: rotateBg 25s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.balance-content {
    position: relative;
    z-index: 1;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.balance-trend {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-xs {
    width: 14px;
    height: 14px;
}

.balance-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
}

/* ===== TOGGLE VIEW ===== */
.toggle-view {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 5px;
    margin: 0 20px 20px;
}

.toggle-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.toggle-sub {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 400;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #f97316 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
}

.toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* ===== ALERT BANNER ===== */
.alert-banner {
    margin: 0 20px 20px;
    padding: 14px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    border: 1px solid rgba(251, 191, 36, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideDown 0.6s ease-out;
    cursor: pointer;
}

.alert-pulse {
    width: 10px;
    height: 10px;
    background: var(--warning);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.alert-content {
    flex: 1;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 20px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 18px;
    animation: slideUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(34, 197, 94, 0.1));
}

.stat-icon.orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(249, 115, 22, 0.1));
}

.chart-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 3px;
    animation: barFill 1.5s ease-out forwards;
}

.chart-bar-fill.green {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
}

.chart-bar-fill.orange {
    background: linear-gradient(90deg, var(--primary) 0%, #f97316 100%);
}

@keyframes barFill {
    from { width: 0; }
}

/* ===== FEATURE GRID ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 0 20px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: scaleIn 0.5s ease-out backwards;
    cursor: pointer;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }

.feature-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feature-icon.green {
    background: rgba(34, 197, 94, 0.15);
}

.feature-icon.blue {
    background: rgba(59, 130, 246, 0.15);
}

.feature-icon.purple {
    background: rgba(168, 85, 247, 0.15);
}

.feature-icon.red {
    background: rgba(239, 68, 68, 0.15);
}

.feature-icon.pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

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

.feature-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== AMOUNT SECTION ===== */
.amount-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.section-header {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.amount-card {
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out backwards;
}

.amount-card:nth-child(1) { animation-delay: 0.1s; }
.amount-card:nth-child(2) { animation-delay: 0.2s; }
.amount-card:nth-child(3) { animation-delay: 0.3s; }

.amount-card.selected {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.3), rgba(255, 107, 53, 0.15)) !important;
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.25);
}

.amount-text {
    font-weight: 700;
    font-size: 18px;
    margin: 8px 0 4px;
}

.amount-label {
    color: var(--text-muted);
    font-size: 11px;
}

/* ===== INPUT ===== */
.input-glass {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: white;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.input-glass:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.input-glass::placeholder {
    color: var(--text-muted);
}

.input-glass select {
    background: transparent;
    color: white;
}

.custom-amount-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.currency-symbol {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 600;
}

.custom-amount-wrapper .input-glass {
    padding-left: 50px;
}

.currency-symbol {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* ===== MESSAGE SECTION ===== */
.message-section {
    margin-bottom: 16px;
}

.message-box {
    min-height: 70px;
    resize: none;
    line-height: 1.4;
}

.success-message {
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== FAMILY CHIPS ===== */
.family-selector {
    margin-bottom: 16px;
}

.family-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.family-chip {
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.family-chip:hover {
    background: rgba(255, 255, 255, 0.08);
}

.family-chip.selected {
    background: linear-gradient(135deg, var(--primary), #f97316);
    border-color: var(--primary);
}

.family-chip-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 16px;
    padding: 16px 24px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.9), rgba(249, 115, 22, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.4);
}

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

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 107, 53, 0.5);
    color: var(--primary);
}

.btn-secondary:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--primary);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.link-btn {
    background: none;
    border: none;
    color: #fb923c;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

/* ===== TRANSACTIONS ===== */
.transactions-section, .family-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title h3 {
    font-weight: 600;
    font-size: 14px;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transaction-item {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: slideUp 0.5s ease-out backwards;
    cursor: pointer;
}

.transaction-item:nth-child(1) { animation-delay: 0.1s; }
.transaction-item:nth-child(2) { animation-delay: 0.2s; }
.transaction-item:nth-child(3) { animation-delay: 0.3s; }

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-icon.success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.25), rgba(22, 163, 74, 0.1));
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.transaction-icon.pending {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(251, 191, 36, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ===== FAMILY AVATARS ===== */
.family-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.family-avatar {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    animation: scaleIn 0.5s ease-out backwards;
}

.family-avatar:nth-child(1) { animation-delay: 0.1s; }
.family-avatar:nth-child(2) { animation-delay: 0.2s; }
.family-avatar:nth-child(3) { animation-delay: 0.3s; }
.family-avatar:nth-child(4) { animation-delay: 0.4s; }
.family-avatar:nth-child(5) { animation-delay: 0.5s; }

.family-avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.3s ease;
}

.family-avatar-circle:active {
    transform: scale(0.9);
}

.family-avatar-name {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Avatar Gradients */
.avatar-pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.avatar-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.avatar-purple { background: linear-gradient(135deg, #a855f7, #8b5cf6); }
.avatar-green { background: linear-gradient(135deg, #22c55e, #10b981); }
.avatar-orange { background: linear-gradient(135deg, #f97316, #fb923c); }
.avatar-red { background: linear-gradient(135deg, #ef4444, #dc2626); }

/* ===== FOUNDER CARD ===== */
.founder-card {
    padding: 24px;
    margin: 0 20px 20px;
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.35), rgba(255, 107, 53, 0.15));
    border: 1px solid rgba(255, 107, 53, 0.2);
    animation: slideUp 0.6s ease-out 0.5s backwards;
    text-align: center;
}

.founder-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
    margin: 0 auto 14px;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.35);
}

.founder-name {
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.founder-title {
    text-align: center;
    color: #fb923c;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 12px;
}

.founder-quote {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.founder-tagline {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.founder-tagline p {
    text-align: center;
    color: #fb923c;
    font-weight: 600;
    font-size: 12px;
}

/* ===== SUCCESS BANNER ===== */
.success-banner {
    margin: 20px;
    padding: 24px;
    text-align: center;
    animation: scaleIn 0.5s ease-out;
}

.success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
}

.received-amount {
    display: inline-block;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin-top: 16px;
}

/* ===== SMS BUBBLE ===== */
.sms-section {
    padding: 0 20px;
    margin-bottom: 24px;
}

.sms-bubble {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 20px 6px;
    padding: 16px 18px;
    position: relative;
    border: 1px solid var(--glass-border);
}

.sms-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 14px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 10px solid var(--glass-border);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    padding: 0 20px;
    margin-bottom: 24px;
}

.quick-actions h3 {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.action-card {
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    cursor: pointer;
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-content {
    flex: 1;
}

/* ===== RECEIVED HISTORY ===== */
.received-history {
    padding: 0 20px;
    margin-bottom: 24px;
}

.received-history h3 {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

.received-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.received-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #fb923c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.received-badge {
    font-size: 11px;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 4px 10px;
    border-radius: 12px;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    border-radius: 24px 24px 0 0;
    border: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item.active {
    background: rgba(255, 107, 53, 0.15);
}

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

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

.nav-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-sos {
    position: relative;
}

.sos-pulse {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: sosPulse 1.5s ease-in-out infinite;
}

@keyframes sosPulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.sos-icon {
    color: var(--danger) !important;
}

.sos-label {
    color: var(--danger) !important;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    width: 100%;
    max-width: 340px;
    padding: 32px 24px;
    text-align: center;
    animation: scaleIn 0.4s ease;
}

.modal-large {
    max-width: 380px;
    text-align: left;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* ===== SPINNER ===== */
.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SUCCESS CHECK ===== */
.success-check {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
}

.success-check svg {
    width: 100%;
    height: 100%;
}

.success-check circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: circleDraw 0.6s ease forwards;
}

.success-check path {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkDraw 0.4s ease 0.4s forwards;
}

@keyframes circleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

/* ===== SCHEDULE FORM ===== */
.schedule-form, .add-family-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.relation-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.relation-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.relation-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.relation-option.selected {
    background: linear-gradient(135deg, var(--primary), #f97316);
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.relation-emoji {
    font-size: 20px;
    margin-bottom: 4px;
}

.relation-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.relation-option.selected .relation-name {
    color: white;
}

.relation-sub {
    font-size: 9px;
    color: var(--text-muted);
}

.relation-option.selected .relation-sub {
    color: rgba(255, 255, 255, 0.7);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.frequency-options {
    display: flex;
    gap: 8px;
}

.freq-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.freq-btn.active {
    background: linear-gradient(135deg, var(--primary), #f97316);
    border-color: var(--primary);
    color: white;
}

/* ===== EMERGENCY SCREEN ===== */
.emergency-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 50%, #7f1d1d 100%);
    z-index: 300;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 40px 20px;
    text-align: center;
    overflow-y: auto;
}

.emergency-screen.active {
    display: flex;
    animation: emergencyIn 0.5s ease;
}

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

.emergency-icon {
    animation: emergencyShake 0.5s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes emergencyShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-8px) rotate(-3deg); }
    75% { transform: translateX(8px) rotate(3deg); }
}

.emergency-info, .emergency-contacts, .family-status {
    width: 100%;
    max-width: 360px;
    padding: 20px;
    margin-bottom: 16px;
}

.emergency-contacts h3, .family-status h3 {
    text-align: left;
    margin-bottom: 12px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.family-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.family-status-item:last-child {
    border-bottom: none;
}

.status-safe {
    color: #22c55e;
}

.status-warning {
    color: #fbbf24;
}

.status-danger {
    color: #ef4444;
}

.emergency-tip {
    padding: 16px 20px;
    border-radius: 16px;
    background: white;
    color: #dc2626;
    width: 100%;
    max-width: 360px;
    text-align: center;
    margin-bottom: 16px;
}

.emergency-close {
    background: white;
    color: #dc2626;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===== PAGES ===== */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ===== HISTORY PAGE ===== */
.filter-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.filter-tab {
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary), #f97316);
    border-color: var(--primary);
    color: white;
}

.history-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.history-date {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== PAMILYA PAGE ===== */
.family-stats {
    margin: 0 20px 20px;
    padding: 20px;
}

.family-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.family-list-item {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.family-list-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.family-list-info {
    flex: 1;
}

.family-list-location {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.family-list-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot-green { background: #22c55e; }
.status-dot-yellow { background: #fbbf24; }
.status-dot-red { background: #ef4444; }

/* ===== PROFILE PAGE ===== */
.profile-card {
    padding: 32px 24px;
    margin: 20px;
    text-align: center;
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 28px;
    margin: 0 auto 16px;
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.35);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 24px;
}

.profile-stat {
    padding: 20px 12px;
    text-align: center;
}

.settings-list {
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 20px;
    z-index: 500;
    font-size: 13px;
    text-align: center;
    max-width: 300px;
    animation: slideDown 0.3s ease;
    white-space: pre-line;
}

.toast-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== CONFETTI ===== */
.confetti {
    position: fixed;
    z-index: 1000;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== ICON SIZES ===== */
.icon-svg {
    width: 24px;
    height: 24px;
}

.icon-svg-lg {
    width: 32px;
    height: 32px;
}

/* ===== UTILITY CLASSES ===== */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-around { justify-content: space-around; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-4xl { font-size: 36px; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-white\/50 { color: rgba(255, 255, 255, 0.5); }
.text-white\/60 { color: rgba(255, 255, 255, 0.6); }
.text-white\/40 { color: rgba(255, 255, 255, 0.4); }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }

.text-orange-400 { color: #fb923c; }
.text-green-400 { color: #22c55e; }
.text-red-200 { color: #fca5a5; }
.text-blue-400 { color: #60a5fa; }
.text-yellow-400 { color: #facc15; }

.text-green-400 { color: #22c55e; }

.w-9 { width: 36px; }
.w-full { width: 100%; }

.h-7 { height: 28px; }

.rounded-full { border-radius: 9999px; }

.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }

.ml-auto { margin-left: auto; }

.bg-white\/10 { background: rgba(255, 255, 255, 0.1); }
.bg-white\/15 { background: rgba(255, 255, 255, 0.15); }
.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--from), var(--to));
}

.from-pink-500 { --from: #ec4899; }
.to-rose-500 { --to: #f43f5e; }
.from-blue-500 { --from: #3b82f6; }
.to-cyan-500 { --to: #06b6d4; }
.from-purple-500 { --from: #a855f7; }
.to-violet-500 { --to: #8b5cf6; }
.from-green-500 { --from: #22c55e; }
.to-emerald-500 { --to: #10b981; }
.from-orange-500 { --from: #f97316; }
.to-amber-500 { --to: #f59e0b; }

.border-2 { border-width: 2px; }
.border-dashed { border-style: dashed; }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-t { border-top-width: 1px; }
.pt-3 { padding-top: 12px; }

.space-y-3 > * + * { margin-top: 12px; }
.space-y-2 > * + * { margin-top: 8px; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
