/* --- Global Styles & CSS Variables --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #231d36, #1a1a2a);
    --panel-color: #1e1b2e;
    --card-color: #2a253f;
    --input-color: #3b3553;
    --primary-blue: #4D53CE;
    --primary-blue-hover: #3a3f9e;
    --text-white: #FFFFFF;
    --text-grey: #a0a0a0;
    --text-lightgrey: #c0c0c0;
    --accent-green: #00C853;
    --accent-red: #D50000;
    --border-color: #4a4a4a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Login & Register Page Styles --- */
.auth-container {
    width: 900px;
    max-width: 90vw;
    background: var(--panel-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    overflow: hidden;
}

.auth-image {
    flex: 1;
}

.auth-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-form {
    flex: 1;
    padding: 60px 50px;
}

.auth-form h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.auth-form .subtitle {
    font-size: 1rem;
    color: var(--text-grey);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

/* Special group for first/last name */
.form-group-split {
    display: flex;
    gap: 20px;
}
.form-group-split .form-group {
    flex: 1;
}

.form-input {
    width: 100%;
    background: var(--input-color);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1rem;
    color: var(--text-white);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-grey);
}

.form-input:focus {
    border-color: var(--primary-blue);
}

.recaptcha {
    margin: 30px 0;
}

.form-btn {
    width: 100%;
    padding: 15px 20px;
    background: var(--primary-blue);
    border: none;
    border-radius: 10px;
    color: var(--text-white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-btn:hover {
    background: var(--primary-blue-hover);
}

/* --- Main App Layout Styles --- */
.app-container {
    width: 100vw;
    height: 100vh;
    max-width: 1600px; /* Max width of the app */
    max-height: 900px; /* Max height */
    background: var(--panel-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: grid;
    grid-template-columns: 240px 1fr 320px; /* Sidenav, Main, Transactions */
    grid-template-rows: 1fr;
    overflow: hidden;
    padding: 20px;
    gap: 20px;
}

/* --- 1. Sidenav (Left Column) --- */
.sidenav {
    display: flex;
    flex-direction: column;
}

.sidenav-logo {
    height: 60px;
    background: var(--card-color);
    border-radius: 12px;
    margin-bottom: 20px;
    /* --- New lines below --- */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 15px;
}

.sidenav-logo ion-icon {
    font-size: 1.8rem;
    color: var(--primary-blue);
}

.sidenav-logo h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin: 0; /* Removes default heading margin */
}

.sidenav-menu, .sidenav-user {
    background: var(--card-color);
    border-radius: 12px;
    padding: 10px;
}

.sidenav-menu {
    flex-grow: 1;
}

.sidenav-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    margin-bottom: 5px;
    border-radius: 10px;
    color: var(--text-grey);
    text-decoration: none;
    font-weight: 500;
}

.sidenav-menu a.active, .sidenav-menu a:hover {
    background: #3c3558; /* Slightly lighter on hover/active */
    color: var(--text-white);
}

.sidenav-menu a ion-icon {
    font-size: 1.3rem;
}

.sidenav-user {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidenav-user .avatar {
    width: 40px;
    height: 40px;
    background: var(--input-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sidenav-user .user-info h4 {
    font-weight: 600;
    color: var(--text-white);
    font-size: 0.9rem;
}
.sidenav-user .user-info span {
    color: var(--text-grey);
    font-size: 0.8rem;
}


/* --- 2. Main Content (Center Column) --- */
.main-content {
    background: var(--card-color);
    border-radius: 12px;
    padding: 30px 40px;
    overflow-y: auto; /* Make it scrollable if content is long */
}

.main-header {
    margin-bottom: 30px;
}

.main-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
}

.main-header h2 { /* e.g., "Transfer Money" */
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

/* Balance Display */
.balance-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.balance-card .balance-amount {
    font-size: 3rem;
    font-weight: 700;
}
.balance-card .balance-amount .cents {
    font-size: 2rem;
    color: var(--text-grey);
}

.balance-card .currency-tag {
    background: var(--input-color);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.balance-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-green);
}
.balance-stat.negative {
    color: var(--accent-red);
}
.balance-stat ion-icon {
    font-size: 1.2rem;
}

/* Action Buttons (Transfer/Request) */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: var(--primary-blue);
    color: var(--text-white);
    border: none;
    border-radius: 12px;
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.action-btn:hover {
    background: var(--primary-blue-hover);
}
.action-btn ion-icon {
    font-size: 1.4rem;
}
.action-btn.secondary {
    background: var(--input-color);
}
.action-btn.secondary:hover {
    background: #4a4369;
}


/* Summary Cards (Earnings/Spending) */
.summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.summary-card {
    background: var(--panel-color); /* Darker than main content */
    border-radius: 12px;
    padding: 25px;
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-grey);
    font-weight: 500;
    margin-bottom: 15px;
}
.summary-card-header ion-icon {
    font-size: 1.3rem;
}

.summary-card-amount {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.summary-card-amount .cents {
    font-size: 1.5rem;
    color: var(--text-grey);
}

/* --- Transfer/Request Form Styles --- */
.transfer-form .form-label {
    display: block;
    color: var(--text-grey);
    font-weight: 500;
    margin-bottom: 10px;
}

.transfer-form .form-input {
    background: var(--panel-color); /* Match summary cards */
    padding: 18px 20px;
    font-size: 1rem;
}

.transfer-form .form-group {
    margin-bottom: 25px;
}

/* --- Confirmation Page Styles --- */
.confirmation-details {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}
.confirmation-details h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-white);
}
.confirmation-details p {
    font-size: 1.2rem;
    color: var(--text-grey);
    margin-bottom: 40px;
}

.confirmation-summary {
    background: var(--panel-color);
    border-radius: 12px;
    padding: 20px 30px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--input-color);
}
.summary-row:last-child {
    border-bottom: none;
}
.summary-row .label {
    font-size: 1rem;
    color: var(--text-grey);
}
.summary-row .value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}
.summary-row .value.total {
    font-size: 1.5rem;
    color: var(--primary-blue);
}


/* --- 3. Transactions Sidebar (Right Column) --- */
.transactions-sidebar {
    background: var(--card-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.transactions-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--input-color);
}
.transactions-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}
.transactions-header ion-icon {
    font-size: 1.3rem;
    color: var(--text-grey);
    cursor: pointer;
}

.transactions-list {
    padding: 10px 15px;
    overflow-y: auto; /* Make list scrollable */
    flex-grow: 1;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;
    border-radius: 10px;
}
.transaction-item:hover {
    background: var(--panel-color); /* Hover effect */
}

.transaction-item .icon {
    width: 45px;
    height: 45px;
    background: var(--input-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.transaction-item .details {
    flex-grow: 1;
}
.transaction-item .details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-white);
}
.transaction-item .details span {
    font-size: 0.85rem;
    color: var(--text-grey);
}

.transaction-item .amount {
    font-weight: 600;
    font-size: 1rem;
}
.transaction-item .amount.positive {
    color: var(--accent-green);
}
.transaction-item .amount.negative {
    color: var(--accent-red);
}

/* Empty State (the rounded rect in your UI) */
.empty-state {
    height: 60px;
    background: var(--panel-color);
    border-radius: 12px;
    margin: 20px 25px;
    border: 2px dashed var(--input-color);
}


/* --- Inbox Page Styles --- */
.inbox-container {
    display: grid;
    grid-template-columns: 300px 1fr; /* Message List, Chat Window */
    height: 100%; /* Fill the main-content area */
    gap: 20px;
}

/* Inbox - Left Side (Message List) */
.message-list {
    background: var(--panel-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.message-list-header {
    padding: 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--input-color);
}
.message-list-header h3 {
    font-size: 1.2rem;
}
.message-list-header ion-icon {
    font-size: 1.3rem;
    color: var(--text-grey);
    cursor: pointer;
}

.message-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--input-color);
    position: relative;
}
.message-search input {
    width: 100%;
    background: var(--input-color);
    border: none;
    border-radius: 8px;
    padding: 12px 15px 12px 40px; /* Space for icon */
    color: var(--text-white);
}
.message-search ion-icon {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-grey);
    font-size: 1.2rem;
}
.message-filter {
    padding: 15px 20px;
    border-bottom: 1px solid var(--input-color);
}

.message-previews {
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px;
}
.message-preview-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
}
.message-preview-item.active,
.message-preview-item:hover {
    background: var(--input-color);
}
.message-preview-item .avatar {
    width: 45px;
    height: 45px;
    background: var(--input-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.message-preview-item .preview-details {
    overflow: hidden; /* To truncate text */
}
.preview-details .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.preview-details .header h4 {
    font-weight: 600;
    color: var(--text-white);
}
.preview-details .header span {
    font-size: 0.8rem;
    color: var(--text-grey);
}
.preview-details .message-excerpt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-grey);
    font-size: 0.9rem;
}


/* Inbox - Right Side (Chat Window) */
.chat-window {
    background: var(--panel-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--input-color);
}
.chat-header .contact-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.chat-header .contact-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
}
.chat-header .contact-info span {
    font-size: 0.85rem;
    color: var(--text-grey);
}
.chat-header .chat-actions {
    display: flex;
    gap: 20px;
    font-size: 1.3rem;
    color: var(--text-grey);
}
.chat-header .chat-actions ion-icon {
    cursor: pointer;
}

.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.chat-timestamp {
    text-align: center;
    color: var(--text-grey);
    font-size: 0.85rem;
    font-weight: 500;
}
.message-bubble {
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 70%;
    line-height: 1.5;
}
.message-bubble.recipient {
    background: var(--input-color);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.message-bubble.sender {
    background: var(--primary-blue);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    color: var(--text-white);
}

.chat-footer {
    padding: 20px;
    border-top: 1px solid var(--input-color);
    /* This part isn't in your design, but you'll need it */
    background: var(--panel-color);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}
.chat-footer input {
    width: 100%;
    background: var(--input-color);
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    color: var(--text-white);
    font-size: 1rem;
}

/* --- Transaction Page Styles --- */
.filter-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.filter-btn {
    background: var(--input-color);
    color: var(--text-grey);
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.filter-btn:hover {
    background: #4a4369;
}

.filter-btn.active {
    background: var(--primary-blue);
    color: var(--text-white);
}

.full-transaction-list .transaction-item {
    background: var(--panel-color);
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.full-transaction-list .transaction-item .details {
    flex-grow: 1;
}
.full-transaction-list .transaction-item .amount {
    font-size: 1.1rem;
}
.full-transaction-list .transaction-item .timestamp {
    width: 100px;
    text-align: right;
    color: var(--text-grey);
    font-size: 0.9rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.page-header .action-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    gap: 8px;
    margin: 0;
}

.search-bar {
    margin-bottom: 25px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper .form-input {
    background: var(--panel-color);
    padding-left: 50px;
    font-size: 1rem;
    width: 100%;
}

.search-input-wrapper ion-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-grey);
    font-size: 1.3rem;
}

.contact-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.contact-card {
    background: var(--panel-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-card .avatar {
    width: 70px;
    height: 70px;
    background: var(--input-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 15px;
}

.contact-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 5px;
}

.contact-card .email {
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-bottom: 20px;
}

.contact-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.contact-actions .action-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.9rem;
}

.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Dim background */
}

.modal-content {
    background-color: var(--panel-color);
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close-btn {
    color: var(--text-grey);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-label {
    display: block;
    color: var(--text-grey);
    font-weight: 500;
    margin-bottom: 10px;
}

/* --- Textarea Style --- */
textarea.form-input {
    min-height: 120px;
    resize: vertical;
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif; /* Ensure font matches */
}   

/* --- Currency Selector Styles --- */
.balance-card .currency-selector-wrapper {
    position: relative; /* This is the anchor for our new arrow */
    display: flex;
    align-items: center;
}

.currency-selector-wrapper select.form-input {
    width: 100px;
    background: var(--input-color);
    padding: 10px 30px 10px 15px; /* Added right-padding for the new arrow */
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    color: var(--text-lightgrey);
    cursor: pointer;
    
    /* Hide the default browser arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* This creates our new, custom arrow */
.currency-selector-wrapper::after {
    content: ''; /* Required for a pseudo-element */
    position: absolute;
    right: 15px; /* Position 15px from the right */
    top: 50%;
    transform: translateY(-50%); /* Center it vertically */
    
    /* This creates a small white triangle */
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-lightgrey); /* The arrow */
    
    pointer-events: none; /* Makes sure you can click the select box */
}

/* --- News Feed Styles --- */
.news-feed-container {
    display: grid;
    /* This will create 1 column on small screens and 
       auto-fit columns on larger screens */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.news-card {
    background: var(--panel-color); /* Matches summary cards */
    border-radius: 12px;
    overflow: hidden; /* To make the image corners rounded */
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.news-card-image {
    height: 150px;
    width: 100%;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the area */
}

.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Makes all cards the same height */
}

.news-card-source {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-white);
    line-height: 1.4;
}

/* --- Market Ticker Styles --- */
.market-ticker-wrapper {
    background-color: #111; /* A very dark background */
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    overflow: hidden;
    padding: 10px 0;
}

.market-ticker-strip {
    display: flex;
    width: 200%; /* Start with a wide width, JS will adjust */
    
    /* This is the scrolling animation */
    animation: scroll-left 40s linear infinite;
}

.ticker-item {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0 20px;
    border-right: 1px solid #333;
}

.ticker-item .symbol {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-right: 15px;
}

.ticker-item .price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-white);
    margin-right: 15px;
}

.ticker-item .change {
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}
.ticker-item .change ion-icon {
    font-size: 1.1rem;
    margin-right: 2px;
}

/* Green/Red for price changes */
.change.positive {
    color: var(--accent-green);
}
.change.negative {
    color: var(--accent-red);
}

/* Scrolling Keyframes */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* This creates the seamless loop */
    }
}