/*
  Assets: style.css
  Description: Main CSS stylesheet for BondPay Deposit Demo.
  Theme: Modern, clean, green gradient-based theme, fully mobile responsive.
*/

:root {
    --primary-color: #10b981; /* Emerald Green */
    --primary-hover: #059669;
    --primary-light: #ecfdf5;
    --bg-dark: #0f172a; /* Slate 900 for dark layouts */
    --bg-light: #f8fafc; /* Slate 50 for page bg */
    --card-bg: #ffffff;
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --success-color: #10b981;
    --pending-color: #f59e0b; /* Amber 500 */
    --failed-color: #ef4444; /* Red 500 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.btn-nav-logout {
    padding: 0.5rem 1rem;
    background: #fee2e2;
    color: #ef4444;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-nav-logout:hover {
    background: #fca5a5;
    color: #b91c1c;
}

/* Authentication Page Wrapper */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #f8fafc 100%);
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: #f8fafc;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px -1px rgba(16, 185, 129, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Alert Boxes */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #ef4444;
    border: 1px solid #fca5a5;
}

.alert-success {
    background-color: #ecfdf5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

.welcome-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.welcome-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.welcome-title span {
    color: var(--primary-color);
}

.date-badge {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Balance & Actions Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.balance-card {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    color: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
}

.balance-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-deposit-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    color: #065f46;
    text-decoration: none;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-deposit-action:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Main Content Cards */
.content-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    overflow: hidden;
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-subtitle-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.card-subtitle-link:hover {
    text-decoration: underline;
}

/* Deposit Form Specific */
.deposit-box {
    max-width: 600px;
    margin: 3rem auto;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

.preset-btn {
    padding: 0.5rem;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.preset-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.limits-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: -0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
}

/* History Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.transaction-table th {
    background: #f8fafc;
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1.5px solid var(--border-color);
}

.transaction-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.transaction-table tr:last-child td {
    border-bottom: none;
}

.transaction-table tr:hover td {
    background-color: #fafafa;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: capitalize;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Success/Failed Screens */
.result-card {
    text-align: center;
    max-width: 500px;
    margin: 4rem auto;
    padding: 3rem;
}

.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
}

.result-icon.success {
    background-color: #d1fae5;
    color: #10b981;
}

.result-icon.failed {
    background-color: #fee2e2;
    color: #ef4444;
}

.result-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.result-msg {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.result-details {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: left;
}

.result-details-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
}

.result-details-row:last-child {
    border-bottom: none;
}

.result-details-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.result-details-val {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.btn-container-flex {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-secondary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Footer Section */
footer {
    margin-top: auto;
    background: var(--bg-dark);
    color: #94a3b8;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid #334155;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
}

.footer-logo span {
    color: var(--primary-color);
}

.footer-copy {
    color: #64748b;
}

/* Documentation panel for beginner explanation */
.doc-box {
    margin-top: 2rem;
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.doc-box h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.doc-box p {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.doc-box ul {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.doc-box li {
    margin-bottom: 0.25rem;
}

/* =========================================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================= */

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.auth-card {
    animation: fadeInUp 0.5s ease-out;
}

.content-card {
    animation: fadeInUp 0.4s ease-out;
}

.balance-card {
    animation: fadeInUp 0.4s ease-out;
}

.balance-amount {
    animation: pulseGlow 3s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.result-icon {
    animation: fadeInUp 0.5s ease-out;
}

.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::after {
    left: 100%;
}

/* Form field error state */
.form-control.error {
    border-color: var(--failed-color);
    background-color: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS — MOBILE FIRST
   ========================================================================= */

/* Tablets: 768px and below */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }

    .nav-links {
        gap: 0.75rem;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .welcome-title {
        font-size: 1.5rem;
    }

    .balance-card {
        padding: 1.75rem;
    }

    .balance-amount {
        font-size: 2.25rem;
    }

    .content-card {
        padding: 1.25rem;
    }

    .transaction-table th,
    .transaction-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .result-card {
        padding: 2rem 1.25rem;
        margin: 2rem auto;
    }

    .btn-container-flex {
        flex-direction: column;
    }

    .btn-container-flex .btn-primary,
    .btn-container-flex .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .amount-presets {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

/* Small phones: 480px and below */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
        border-radius: var(--radius-md);
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .balance-amount {
        font-size: 1.8rem;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .limits-note {
        flex-direction: column;
        gap: 0.25rem;
    }

    .dashboard-container {
        padding: 0 1rem;
        margin: 1.25rem auto;
    }

    .deposit-box {
        margin: 1.5rem auto;
    }

    .doc-box {
        padding: 1rem;
        font-size: 0.85rem;
    }
}
