/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #1c1e21;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Container Styles */
.login-container, .dashboard-container, .result-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* Header Styles */
.dashboard-container header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 40px;
    padding: 10px 0;
}

/* Result Header */
.result-container header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.result-container header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: #1c1e21;
}

.result-back-btn {
    width: auto;
    padding: 10px 14px;
    background-color: #ffffff;
    color: #1877f2;
    border: 1px solid #e7f3ff;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.result-back-btn:hover {
    background-color: #f8fbff;
}

.header-left h1 {
    font-size: 1.8rem;
    color: #1877f2;
    font-weight: 800;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.welcome-text {
    font-size: 0.95rem;
    color: #65676b;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 5px;
}

.balance-display {
    background-color: #ffffff;
    padding: 8px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e7f3ff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.balance-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #1877f2;
}

.balance-breakdown {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 12px;
    min-width: 180px;
    z-index: 110;
    border: 1px solid rgba(0,0,0,0.05);
    animation: slideDown 0.2s ease-out;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #f0f2f5;
}

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

.bank-label {
    color: #65676b;
    font-weight: 500;
}

.breakdown-item span:last-child {
    font-weight: 700;
    color: #1c1e21;
}

.balance-label {
    font-size: 13px;
    color: #65676b;
    font-weight: 600;
}

.balance-amount {
    font-size: 15px;
    color: #1877f2;
    font-weight: 800;
}

.dropdown-balance {
    margin-top: 4px;
    font-weight: 700;
    color: #1877f2;
    font-size: 15px;
}

/* Card Styles */
.login-card, .dashboard-card, .result-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1, h2 {
    margin-bottom: 25px;
    color: #333;
}

/* Form Elements */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #1877f2;
}

.helper-text {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

.db-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.db-status--info {
    background-color: #f0f7ff;
    color: #1877f2;
    border: 1px solid #e7f3ff;
}

.db-status--success {
    background-color: #eef8f0;
    color: #1e7a2e;
    border: 1px solid #d7f0dc;
}

.db-status--error {
    background-color: #fff1f1;
    color: #b91c1c;
    border: 1px solid #ffd6d6;
}

/* Settings Page */
.settings-page-container {
    width: 100%;
    max-width: 650px;
    padding: 20px;
}

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

.settings-card {
    background-color: #fff;
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.settings-section {
    padding: 10px 0 18px 0;
    border-bottom: 1px solid #f0f2f5;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.settings-section h2 {
    margin-bottom: 14px;
}

button {
    width: 100%;
    padding: 12px;
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #166fe5;
}

.menu-btn {
    width: 100%;
    padding: 10px 16px;
    background-color: transparent;
    color: #1c1e21;
    text-align: left;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    font-size: 14px;
}

.menu-btn:hover {
    background-color: #f0f2f5;
}

#logout-btn {
    width: 100%;
    padding: 10px 16px;
    background-color: transparent;
    color: #fa3e3e;
    text-align: left;
    border-radius: 6px;
    display: flex;
    align-items: center;
    border: none;
    font-size: 14px;
}

#logout-btn:hover {
    background-color: #fff1f1;
}

/* Profile Icon & Dropdown */
.profile-container {
    position: relative;
}

.profile-icon {
    width: 42px;
    height: 42px;
    background-color: #ffffff;
    color: #1877f2;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border: 2px solid #e7f3ff;
    transition: all 0.2s ease;
}

.profile-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    background-color: #f8fbff;
}

.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background-color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 12px;
    min-width: 200px;
    z-index: 100;
    animation: slideDown 0.2s ease-out;
    border: 1px solid rgba(0,0,0,0.05);
}

.dropdown-header {
    padding: 4px 16px 12px 16px;
    text-align: left;
}

.dropdown-header strong {
    display: block;
    font-size: 14px;
    color: #1c1e21;
}

.dropdown-header span {
    font-size: 12px;
    color: #65676b;
}

.dropdown-divider {
    height: 1px;
    background-color: #ebedf0;
    margin: 4px 0 8px 0;
}

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

/* Balance Page Styles */
.balance-page-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background-color: #ffffff;
    color: #1c1e21;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: #f8fbff;
    color: #1877f2;
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.balance-page-container .header-left h1 {
    font-size: 1.6rem;
    color: #1c1e21;
    margin-bottom: 0;
}

.total-balance-card {
    background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.2);
}

.total-balance-card .label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-balance-card h2 {
    font-size: 42px;
    margin: 10px 0 0 0;
    color: white;
}

.bank-balances-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.bank-card {
    background-color: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.bank-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 20px;
}

.telebirr .bank-icon { background-color: #e7f3ff; color: #1877f2; }
.cbe .bank-icon { background-color: #fff1f1; color: #fa3e3e; }
.abyssinia .bank-icon { background-color: #f0f7ff; color: #0056b3; }

.bank-info {
    display: flex;
    flex-direction: column;
}

.bank-name {
    font-size: 13px;
    color: #65676b;
}

.bank-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1c1e21;
}

.history-section h3 {
    margin-bottom: 20px;
    color: #1c1e21;
    font-size: 1.2rem;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
}

.kebab-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background-color: #ffffff;
    border: 1px solid #f0f2f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0;
    cursor: pointer;
}

.kebab-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #65676b;
    display: inline-block;
}

.kebab-menu {
    position: absolute;
    top: 44px;
    right: 0;
    background-color: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 8px;
    min-width: 160px;
    z-index: 200;
}

.kebab-item {
    width: 100%;
    background: transparent;
    color: #1c1e21;
    border: none;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.kebab-item:hover {
    background-color: #f0f2f5;
}

.history-item {
    background-color: white;
    padding: 16px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.history-main {
    display: flex;
    flex-direction: column;
}

.history-main strong {
    font-size: 16px;
    color: #1c1e21;
}

.history-main span {
    font-size: 13px;
    color: #65676b;
}

.history-side {
    text-align: right;
    display: flex;
    flex-direction: column;
}

.history-side .amount {
    font-size: 18px;
    font-weight: 700;
    color: #42b72a;
}

.history-side .sender {
    font-size: 12px;
    color: #8a8d91;
}

/* Error Messages */
.error {
    color: #fa3e3e;
    font-size: 14px;
    margin-top: 15px;
}

/* Result Styles */
.result-details {
    margin-top: 25px;
    text-align: left;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.detail-item label {
    margin-bottom: 0;
    color: #777;
    font-weight: 400;
}

.detail-item span {
    font-weight: 600;
}

.status-success { color: #42b72a; }
.status-error { color: #fa3e3e; }

/* Bank Selector Horizontal */
.bank-selector-horizontal {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bank-btn {
    flex: 1;
    padding: 10px;
    background-color: #f0f2f5;
    color: #555;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.bank-btn:hover {
    background-color: #e4e6eb;
}

.bank-btn.active {
    background-color: #e7f3ff;
    color: #1877f2;
    border-color: #1877f2;
}

/* History Styles */
.history-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
    text-align: left;
}

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

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 8px;
    cursor: default;
    transition: background-color 0.2s;
    text-align: left;
    gap: 12px;
}

.history-item:hover {
    background-color: #f0f2f5;
}

.history-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-delete-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(250, 62, 62, 0.25);
    background: #ffffff;
    color: #fa3e3e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.history-delete-btn:hover {
    background: rgba(250, 62, 62, 0.08);
}

.history-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.history-info {
    display: flex;
    flex-direction: column;
}

.history-info strong {
    font-size: 0.95rem;
    color: #333;
}

.history-info span {
    font-size: 0.85rem;
    color: #777;
}

.history-amount {
    font-weight: 600;
    color: #1877f2;
    font-size: 0.95rem;
}

/* Utilities */
.hidden { display: none; }

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1877f2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
