* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    background-color: #f8fafc;
}

.hidden {
    display: none !important;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.2rem;
    color: #4F46E5;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
}

.tagline {
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #94a3b8;
    z-index: 2;
}

.input-group input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #1e293b;
}

.input-group input:focus {
    outline: none;
    border-color: #4F46E5;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #4F46E5;
}

.login-btn {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.login-btn:active {
    transform: translateY(0);
}

.separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: #9ca3af;
}

.separator::before,
.separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.separator-text {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0 10px;
    color: #64748b;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background-color: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.google-btn:hover {
    background-color: #f9fafb;
    border-color: #adb5bd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.google-btn svg {
    width: 22px;
    height: 22px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
}

.login-footer p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    background: #f8fafc;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #1f2937;
}

.logo-section i {
    color: #4F46E5;
    font-size: 1.5rem;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: #6b7280;
    font-weight: 500;
}

.logout-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.dashboard-main {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 20px;
    padding: 20px;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.user-details {
    flex: 1;
}

.sidebar-email {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    margin-bottom: 2px;
    word-break: break-all;
}

.user-status {
    color: #10B981;
    font-size: 0.8rem;
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.nav-item.active {
    background: #4F46E5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}


.nav-item.active:hover {
    background: #4338ca;
}


.nav-item i {
    width: 20px;
    text-align: center;
}

/* Content Styles */
.content {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    min-height: 500px;
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 5px;
}

.section-header p {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Form Styles */
.payment-form {
    max-width: 400px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #4F46E5;
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Button Styles */
.action-btn {
    background: #4F46E5;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.2);
}

.action-btn.secondary {
    background: #f1f5f9;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: none;
}

.action-btn.secondary:hover {
    background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.action-btn.full-width {
    width: 100%;
    justify-content: center;
}

/* Receive Money Styles */
.receive-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.qr-section {
    text-align: center;
}

.qr-code-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    display: inline-block;
    border: 1px solid #e5e7eb;
}

.upi-id-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.upi-id-card h3 {
    margin-bottom: 15px;
    color: #1f2937;
}

.upi-id-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.upi-id-display span {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4F46E5;
    word-break: break-all;
}

.copy-btn {
    background: #10B981;
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #059669;
}

/* Balance Styles */
.balance-container {
    max-width: 500px;
}

.balance-card {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.balance-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.balance-header i {
    font-size: 1.5rem;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 20px;
}

.currency {
    font-size: 1.5rem;
    font-weight: 500;
}

.amount {
    font-size: 3rem;
    font-weight: 700;
}

.balance-footer {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Transaction Styles */
#transactionsList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.transaction-icon.received {
    background: #10B981;
}

.transaction-icon.sent {
    background: #ef4444;
}

.transaction-details {
    flex: 1;
}

.transaction-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.transaction-time {
    font-size: 0.8rem;
    color: #9ca3af;
}

.transaction-amount {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
}

.transaction-amount.received {
    color: #10B981;
}

.transaction-amount.sent {
    color: #ef4444;
}

.no-transactions-msg {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 1rem;
}
.no-transactions-msg.error {
    color: #ef4444;
}


/* QR Reader Styles */
#qr-reader {
    max-width: 500px;
    margin: 20px auto;
    border: 2px dashed #d1d5db;
    border-radius: 16px;
    overflow: hidden;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #10B981;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: transform 0.4s ease-in-out;
}

.notification:not(.hidden) {
    transform: translateX(0);
}

.notification.hidden {
    transform: translateX(120%);
}

.notification.error {
    border-left-color: #ef4444;
}

.notification-icon {
    font-size: 1.4rem;
}

.notification.error .notification-icon {
    color: #ef4444;
}

.notification.success .notification-icon {
    color: #10B981;
}

/* New Notification Bell Styles */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    color: #6b7280;
}

.notification-count {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid white;
}

.notification-panel {
    position: absolute;
    top: 65px;
    right: 20px;
    width: 350px;
    max-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    z-index: 110;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notification-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

.notification-list {
    flex: 1;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item-content {
    flex: 1;
}

.notification-item-content p {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.4;
}

.notification-item-content p strong {
    font-weight: 600;
    color: #1f2937;
}

.notification-item-content .timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
}

.notification-item .pay-now-btn {
    background: #10B981;
    color: white;
    border: none;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.notification-item .pay-now-btn:hover {
    background: #059669;
}

.no-notifications {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
}

/* Flash Notification Styles */
.flash-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 25px 40px;
    border-radius: 16px;
    z-index: 2000;
    text-align: center;
    opacity: 1;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    transform: translate(-50%, -50%) scale(0.9);
}

.flash-notification:not(.hidden) {
    transform: translate(-50%, -50%) scale(1);
}


.flash-notification.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.flash-notification i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.flash-notification .flash-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.flash-notification .flash-message {
    font-size: 1.1rem;
    color: #e5e7eb;
}

.flash-notification.sent i {
    color: #ef4444;
}

.flash-notification.received i {
    color: #10B981;
}

/* Chat Feature Styles */
.chat-icon {
    font-size: 1.8rem;
    color: #25D366;
    cursor: pointer;
    transition: transform 0.3s;
}

.chat-icon:hover {
    transform: scale(1.1);
}

.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.chat-app {
    width: 90%;
    height: 90%;
    max-width: 1000px;
    background: #e5ddd5;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    overflow: hidden;
}

.chat-sidebar {
    width: 35%;
    background: #fff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.chat-sidebar-header {
    padding: 15px;
    background: #ededed;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-chat-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #4F46E5;
}

.chat-list {
    overflow-y: auto;
    flex: 1;
}

.chat-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.chat-list-item:hover, .chat-list-item.active {
    background: #f5f5f5;
}
.chat-list-item .user-avatar { width: 40px; height: 40px; font-size: 1rem; }
.chat-list-item .chat-list-details { flex: 1; margin-left: 10px; }
.chat-list-item .chat-list-email { font-weight: 600; }
.chat-list-item .chat-list-preview { font-size: 0.9rem; color: #666; }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background-color: #f8fafc;
}
.chat-welcome-screen i { font-size: 5rem; color: #25D366; margin-bottom: 20px; }

#no-contacts-view { margin-top: 20px; }

.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: #ededed;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}
.close-chat-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    max-width: 70%;
    width: fit-content;
    line-height: 1.4;
}
.message-bubble.sent {
    background: #dcf8c6;
    margin-left: auto;
}
.message-bubble.received {
    background: #fff;
    margin-right: auto;
}
.message-bubble .timestamp {
    font-size: 0.75rem;
    color: #aaa;
    display: block;
    text-align: right;
    margin-top: 5px;
}
.payment-message {
    background: #e0f7fa;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    border-radius: 8px;
    color: #00796b;
}
.payment-message i { margin-right: 5px; }


.chat-message-form {
    display: flex;
    padding: 10px;
    background: #f0f0f0;
}
#message-input { flex: 1; padding: 10px; border-radius: 20px; border: 1px solid #ddd; }
.chat-message-form button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4F46E5;
    cursor: pointer;
    padding: 0 15px;
}
.chat-payment-btn { color: #075E54 !important; }

/* Modal Styles */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}
.modal-content form { display: flex; flex-direction: column; gap: 15px; }
.modal-content h3 { margin-bottom: 20px; }


/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-main {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }
    .sidebar, .content { width: 100%; order: initial; }
    .header-content, .dashboard-main { padding: 0 15px; }
    .user-email { display: none; }
    .receive-container { grid-template-columns: 1fr; gap: 30px; }
    .nav-item { justify-content: center; flex-direction: column; padding: 10px; }

    /* --- MOBILE CHAT ENHANCEMENTS --- */
    .chat-container {
        padding: 0;
        background: #f0f2f5;
        backdrop-filter: none;
    }

    .chat-app {
        flex-direction: column;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    /* By default on mobile, show the user list (sidebar) and hide the chat window (main) */
    .chat-sidebar {
        width: 100%;
        height: 100%;
        border-right: none;
        border-bottom: none;
        display: flex;
        flex-direction: column;
    }

    .chat-main {
        display: none; /* Hide the main chat view by default */
        height: 100%;
    }

    /* When a chat is active on mobile, hide the list and show the chat window */
    .chat-app.mobile-chat-active .chat-sidebar {
        display: none;
    }

    .chat-app.mobile-chat-active .chat-main {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    .chat-window {
        height: 100%; /* Ensure chat window takes full height of chat-main */
    }

    .chat-header #close-chat-btn {
        font-size: 1.5rem;
        padding: 10px 15px;
    }

    /* Hide original mobile-specific classes if they exist to avoid conflict */
    .chat-main.hidden-mobile, .chat-sidebar.hidden-mobile { 
        display: none; 
    }
}

@media (max-width: 480px) {
    .login-card, .content { padding: 30px 20px; }
    .logo h1, .section-header h2 { font-size: 1.5rem; }
    .balance-amount .amount { font-size: 2.5rem; }
    .notification, .notification-panel { width: calc(100% - 20px); right: 10px; }
    .flash-notification { width: 90%; }
}

