/* NaijaFinance - Native Mobile App Style */
:root {
    --primary: #0A7C71;
    --primary-dark: #065F56;
    --primary-light: #E0F2F1;
    --success: #00C853;
    --danger: #FF5252;
    --warning: #FF9800;
    --dark: #1A1A2E;
    --gray: #757575;
    --gray-light: #E0E0E0;
    --bg: #F5F7FA;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Stock and Property Images */
.stock-img, .property-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: linear-gradient(135deg, var(--primary-light), #E8EAF6);
    object-fit: cover;
    flex-shrink: 0;
}

.stock-img img, .property-img img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.stock-img-small {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-light), #E8EAF6);
    flex-shrink: 0;
    margin-right: 12px;
}

/* Fallback for broken images */
.stock-img[src=""], 
.property-img[src=""],
img[src=""] {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: bold;
}

/* Ensure images display properly */
.stock-item, .property-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Property card images */
.property-card-image {
    width: 100%;
    height: 120px;
    border-radius: 12px 12px 0 0;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), #E0F2F1);
}

.stock-img, .property-img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, #E0F2F1, #B2DFDB);
    flex-shrink: 0;
}
/* Splash Screen */
.splash-screen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeOut 0.5s ease 2s forwards;
}

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-logo {
    font-size: 5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.splash-title {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 1rem;
}

.splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    margin: 1.5rem auto 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Screens */
.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Auth Screen */
.auth-screen {
    padding: 2rem 1.5rem;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.auth-header-large {
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 4rem;
}

.auth-header-large h1 {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255,255,255,0.2);
    padding: 0.25rem;
    border-radius: 2rem;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: white;
    font-weight: 600;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-tab.active {
    background: white;
    color: var(--primary);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    border: none;
    border-radius: var(--radius);
    background: white;
    font-size: 1rem;
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-demo {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
}

/* Main Screen */
.main-screen {
    background: var(--bg);
}

/* App Header */
.app-header {
    padding: 0.75rem 1rem;
    padding-top: calc(0.75rem + var(--safe-top));
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.125rem;
}

.header-greeting {
    display: flex;
    flex-direction: column;
}

.greeting-label {
    font-size: 0.75rem;
    color: var(--gray);
}

.greeting-name {
    font-weight: 700;
    font-size: 1.125rem;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--dark);
    font-size: 1.125rem;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 0.625rem;
    padding: 2px 6px;
    border-radius: 1rem;
    font-weight: 600;
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: calc(80px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}

/* View */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Balance Card */
.balance-card-main {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 1rem;
}

.balance-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.balance-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.credit-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

/* Quick Stats */
.quick-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stat-item {
    flex: 1;
    background: white;
    padding: 0.75rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-detail {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-weight: 700;
    font-size: 1rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-btn {
    background: white;
    border: none;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--dark);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.action-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

.action-btn:active {
    transform: scale(0.95);
    background: var(--primary-light);
}

/* Sections */
.section {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Stock Items */
.stock-item, .property-item, .loan-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.stock-item:last-child {
    border-bottom: none;
}

.stock-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 0.75rem;
    object-fit: cover;
}

.stock-info {
    flex: 1;
}

.stock-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.stock-symbol {
    font-size: 0.75rem;
    color: var(--gray);
}

.stock-price-info {
    text-align: right;
}

.stock-price {
    font-weight: 600;
}

.stock-change {
    font-size: 0.875rem;
}

.stock-change.positive {
    color: var(--success);
}

.stock-change.negative {
    color: var(--danger);
}

/* Property Items */
.property-img {
    width: 50px;
    height: 40px;
    border-radius: 8px;
    margin-right: 0.75rem;
    object-fit: cover;
}

.property-info {
    flex: 1;
}

.property-name {
    font-weight: 600;
}

.property-detail {
    font-size: 0.75rem;
    color: var(--gray);
}

.property-value {
    font-weight: 700;
    color: var(--primary);
}

/* Tip Banner */
.tip-banner {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.tip-banner i {
    color: var(--warning);
    font-size: 1.25rem;
}

.tip-banner span {
    font-size: 0.875rem;
    color: var(--dark);
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    border-top: 1px solid var(--gray-light);
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--gray);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: all 0.2s;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Modals (Popups) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: none;
    max-width: 480px;
    margin: 0 auto;
}

.modal {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: white;
    width: 100%;
    max-width: 480px;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 501;
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.modal.active {
    transform: translateX(-50%) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-light);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-light);
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.btn-modal {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

/* Loan Options in Modal */
.loan-options-modal {
    margin-bottom: 1rem;
}

.loan-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.loan-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.loan-option i {
    font-size: 1.5rem;
    color: var(--primary);
}

.loan-option h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.loan-option p {
    font-size: 0.75rem;
    color: var(--gray);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: white;
    z-index: 400;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 480px;
    margin: 0 auto;
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    text-align: center;
}

.user-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 auto 0.75rem;
}

.side-menu-items {
    padding: 1rem;
}

.side-menu-items button {
    width: 100%;
    padding: 1rem;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
    color: var(--dark);
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.side-menu-items button:hover {
    background: var(--bg);
}

.side-menu-items button i {
    width: 24px;
    color: var(--primary);
}

.side-menu-items hr {
    margin: 0.75rem 0;
    border: none;
    border-top: 1px solid var(--gray-light);
}

/* Toast */
.toast-container {
    position: fixed;
    top: calc(60px + var(--safe-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--dark);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    text-align: center;
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    box-shadow: var(--shadow-lg);
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Text Colors */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Search Bar */
.search-bar {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.search-bar i {
    color: var(--gray);
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
}

/* Credit Score Card */
.credit-score-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.credit-score-large span {
    color: var(--gray);
    font-size: 0.875rem;
}

.credit-score-large h2 {
    font-size: 3rem;
    color: var(--primary);
}

.credit-rating {
    display: inline-block;
    padding: 0.25rem 1rem;
    background: var(--success);
    color: white;
    border-radius: 1rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.credit-progress-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    margin-top: 1rem;
    overflow: hidden;
}

.credit-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* Portfolio Summary */
.portfolio-summary-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 1.5rem;
    border-radius: var(--radius);
    color: white;
    margin-bottom: 1rem;
}

.portfolio-summary-card h3 {
    opacity: 0.9;
    font-size: 1rem;
}

.portfolio-summary-card h2 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.portfolio-breakdown {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}