/* =========================
   Reset & Base
========================= */
body {
    font-family: Arial, sans-serif;
    background: #f5f6fa;
    margin: 0;
    color: #333;
    overflow-x: hidden;
    transition: margin-left 0.3s ease; /* smooth shift */
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================
   Drawer Navigation
========================= */
.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background: #003366;
    color: #fff;
    padding-top: 2em;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.drawer.open {
    transform: translateX(0);
}

/* Shift main content when drawer is open */
body.with-drawer {
    margin-left: 250px;
}

.drawer a {
    display: block;
    padding: 1em;
    color: #fff;
    font-weight: bold;
}

.drawer a:hover,
.drawer a:focus {
    background: #00509e;
}

/* Toggle Button */
.menu-btn {
    position: fixed;
    top: 1em;
    left: 1em;
    font-size: 1.5em;
    background: #003366;
    color: #fff;
    border: none;
    padding: 0.5em 0.8em;
    cursor: pointer;
    border-radius: 5px;
    z-index: 1100;
}

.menu-btn:focus {
    box-shadow: 0 0 0 2px #0077cc;
}

/* =========================
   Main Container
========================= */
.container {
    margin: 4em auto;
    max-width: 1000px;
    background: #fff;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: relative;
    transition: margin-left 0.3s ease;
}

/* Prevent drawer effect on login/auth pages */
body.auth .container {
    margin-left: auto !important;
}

/* =========================
   Tabs
========================= */
.tabs {
    display: flex;
    gap: 1em;
    border-bottom: 2px solid #ddd;
    margin-bottom: 1em;
    overflow-x: auto;
}

.tabs button {
    background: none;
    border: none;
    padding: 1em;
    font-size: 1em;
    cursor: pointer;
    font-weight: bold;
    border-bottom: 3px solid transparent;
}

.tabs button.active {
    border-bottom: 3px solid #003366;
    color: #003366;
}

/* =========================
   Tab Content
========================= */
.tab-content {
    display: none;
    animation: slideIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* =========================
   Generic Forms
========================= */
form input,
form button,
form select {
    width: 100%;
    padding: 0.6em;
    margin-bottom: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

form button {
    background: #003366;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

form button:hover,
form button:focus {
    background: #0055aa;
}

/* Accessibility: focus highlight */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid #0077cc;
    outline-offset: 2px;
}

/* =========================
   Flash Messages
========================= */
.flash {
    padding: 0.75em;
    margin-bottom: 1em;
    border-radius: 5px;
}

.flash.success {
    background: #d4edda;
    color: #155724;
}

.flash.danger {
    background: #f8d7da;
    color: #721c24;
}

/* =========================
   Transactions
========================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

table th,
table td {
    padding: 0.8em;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

table th {
    background: #f0f0f0;
}

/* =========================
   Auth Forms (Login/Register)
========================= */
.auth-container {
    max-width: 400px;
    margin: 2em auto;
    padding: 2em;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.auth-form label {
    text-align: left;
    font-weight: bold;
    margin-bottom: 0.3em;
}

.auth-form input {
    padding: 0.6em;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
}

.auth-form button {
    padding: 0.8em;
}

.auth-note {
    margin-top: 1.5em;
}

.auth-note a {
    color: #003366;
    font-weight: bold;
}

.auth-note a:hover,
.auth-note a:focus {
    text-decoration: underline;
}

/* =========================
   Accounts Card Layout
========================= */
.accounts-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    margin: 20px 0;
    overflow: hidden;
}

.account-header {
    background: linear-gradient(to right, #004080, #0073e6);
    color: #fff;
    font-weight: bold;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-item {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

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

.account-item .balance {
    font-size: 16px;
    font-weight: bold;
    margin-top: 4px;
}

.account-item small {
    font-size: 12px;
    color: #777;
}

/* =========================
   Mobile Responsive
========================= */
@media (max-width: 768px) {
    body.with-drawer {
        margin-left: 0; /* don’t push on small screens */
    }
    .drawer {
        width: 90vw;
        max-width: 320px;
    }
    .container {
        margin: 2em 1em;
        padding: 1.5em;
    }
    .account-header {
        font-size: 12px;
        padding: 10px;
    }
    .account-item {
        padding: 10px;
    }
    .account-item .balance {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5em;
        margin: 1em 0.2em;
    }
    .drawer {
        width: 100vw;
        max-width: 100vw;
    }
}
