:root {
    --bg-main: #F4F6F8;
    --bg-card: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    
    --border-color: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 90px;
}

/* Premium Cards */
.premium-card {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.blue-card {
    background: linear-gradient(135deg, #1E40AF, #3B82F6);
    color: #FFFFFF;
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
    position: relative;
    overflow: hidden;
}

.blue-card::after {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.text-hint, .text-secondary {
    color: var(--text-secondary);
}

.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    width: 100%;
}

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

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #F3F4F6;
    color: var(--text-primary);
    border: none;
}

.btn-secondary:active {
    background: #E5E7EB;
}

/* Inputs */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-control {
    width: 100%;
    padding: 16px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.02);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 6px;
    transition: all 0.2s ease;
    flex: 1;
}

.nav-item i, .nav-item svg {
    font-size: 1.5rem;
    width: 24px;
    height: 24px;
}

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

.nav-item:active {
    opacity: 0.5;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end; /* iOS style bottom sheet */
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: #F3F4F6;
    border: none;
    color: var(--text-primary);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
}

.toast {
    padding: 16px;
    border-radius: 16px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    animation: slideDown 0.3s ease forwards;
    font-weight: 500;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

@keyframes fadeOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-20px); opacity: 0; }
}

/* Loaders */
.loader {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.screen-loader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
