/* Reset all margins and paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------------- */
/* General Site Layout                                                   */
/* ----------------------------------------------------------------------- */
:root {
    --primary: #4361ee;
    --secondary: #3a0ca3;
    --success: #4cc9f0;
    --warning: #f72585;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    /*--card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);*/
    --card-shadow: 0 4px 20px rgba(30, 40, 150, 0.15);
    --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

body {
    background-color: #909090;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

h1 {
  font-size: 1.5rem;       /* Set font size */
  color: #333;           /* Set color */
  font-family: Arial, sans-serif; /* Change font style */
  margin-bottom: 1rem;   /* Add space below */
  margin-top: 1rem; 
  text-align: center;    /* Center the text */
  text-transform: uppercase; /* Make uppercase */
}

.message-banner {
  /* Background color */
  background-color: #ffebcc; /* Pastel orange */
  background-color: #fff3e0; /* Alternative slightly lighter pastel orange */
  
  /* Text color */
  color: #d84315; /* Bright orange/brown for contrast */
  color: #bf360c; /* Alternative slightly darker text */
  
  /* Typography */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  
  /* Spacing & Layout */
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: 8px;
  border-left: 4px solid #ff9800; /* Accent border */
  
  /* Positioning & Display */
  display: block;
  width: 50%;
  box-sizing: border-box;
  
  /* Shadow for subtle depth */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-banner.success {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-left-color: #4caf50;
}

.message-banner.error {
  background-color: #ffebee;
  color: #c62828;
  border-left-color: #f44336;
}

/* A header section that is included in more than one page
    deposit.php, transactions.php
     To be displayed the same across all pages 
*/
.dashboard-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
    width: 100%;
}

/* ----------------------------------------------------------------------- */
/* list-Specific Layout and Styling                                      */
/* ----------------------------------------------------------------------- */
.dashboard-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.transaction-list-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin: 0.1rem auto 2rem;
}

.budget-list-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin: 0.1rem auto 2rem;
}

/* ----------------------------------------------------------------------- */
/* Found in multiple pages.                                                */
/* deposit.php , transactions.phpform1AddBankAccount.php, 
/* ----------------------------------------------------------------------- */

.main-two-column {
    display: grid; /* This makes the deposit-page a grid container */
    grid-template-columns: 1fr 1.2fr; /* Defines the two columns */
    gap: 1rem; /* Adds a gap between the columns */
    align-items: start; /* Aligns items to the top */
    max-width: 1200px;
    margin: 0 auto 0.5rem; /*top, right, bottom, and left*/
    width: 100%;
    max-width: 100%;
    padding: 0;
    left: 0;
    position: relative;
}

.main-three-column {
    display: grid; /* This makes the deposit-page a grid container */
    grid-template-columns: 1fr 1.2fr 1fr; /* Defines the trhee columns */
    gap: 1rem; /* Adds a gap between the columns */
    align-items: start; /* Aligns items to the top */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    left: 0;
    position: relative;
}

.accounts-list-column {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 2rem;
    height: fit-content;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 2px solid #e9e9f9;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.accounts-list-column .card-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 2px solid #e9e9f9;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.account-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.75rem;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
    cursor: pointer;
}

.account-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.account-item.selected {
    background: #e6f3ff;
    border-left-color: var(--success);
}

.account-info {
    display: flex;
    gap: 0.25rem;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.account-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 1rem;
}

.account-type {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: capitalize;
}

.account-balance {
    font-weight: bold;
    color: var(--dark);
    font-size: 1.1rem;
}

.account-balance.positive {
    color: #27ae60;
}

.account-balance.negative {
    color: #e74c3c;
}

.total-funds-section {
    margin-top: 1rem;
    background-color: #ffe0b2; /* Pastel Orange */
    text-align: right; /* Align content to the right */
    padding: 0.5rem 1rem; /* Add some padding for spacing */
    border-radius: 0.5rem; /* Optional: Add rounded corners */
    display: flex; /* Use flexbox for alignment */
    justify-content: flex-end; /* Align content to the right */
    align-items: center; /* Vertically align items */
    gap: 0.5rem; /* Add some space between label and amount */
}

.total-funds-section .label {
    color: #333333; /* Darker grey */
    font-weight: bold; /* Make the label bold */
}

.total-funds-section .total-funds-amount {
    color: #333333; /* Darker grey */
    font-weight: bold; /* Make the amount bold */
}

/**********  NEW Dashboard css soley for Bank Account Summary section **********/


/********** Edite below. nothing in here should be defined as deposit **********/

/* Form Column */
.form-column {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 2rem;
}

.header-with-image {
    display: block;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

/* Enhanced Form Styles for Deposit Page */
.form-column .form-group {
    margin-bottom: 1rem;
}

.form-column label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.form-column .form-control {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.form-column .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Form Row Layout for side-by-side fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-content-area {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    margin: 0.1rem auto 1rem;
    
}

.form-column label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: block; /* Make labels take up the full width */
}

.form-control {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    width: 100%; /* Make form controls take up the full width */
    box-sizing: border-box; /* Ensure padding/border doesn't affect width */
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group {
    margin-bottom: 1rem;
}


/* ----------------------------------------------------------------------- */
/* Form-Specific Layout and Styling                                      */
/* ----------------------------------------------------------------------- */
.form-container {
    width: 100%;
    max-width: 900px;
    background-color: #ffffff;
    border-radius: 1.5rem;
    box-shadow: var(--card-shadow);
    padding: 2.5rem;
    margin: 0.1rem auto 2rem;
}

.submit-button-container {
    margin-top: 1.5rem;
}

.submit-button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; /* Add text color for better visibility */
    font-size: 1rem; /* Adjust as needed */
    padding: 0.75rem 1.5rem; /* Adjust as needed */
    margin-top: 0.5rem; /* Adjust as needed */
    border: none; /* Remove default button border */
    border-radius: 0.5rem; /* Add rounded corners */
    cursor: pointer; /* Change cursor to pointer on hover */
    transition: all 0.3s ease; /* Add transition for smooth hover effect */
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
}

/* Delete Section Styles */
.delete-section {
    border-top: 2px solid #e9e9f9;
    padding-top: 2rem;
    margin-top: 2rem;
}

.delete-button {
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.delete-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 68, 68, 0.3);
}

.delete-warning {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    color: #856404;
    font-weight: 600;
}

/* Account Type Badges */
.account-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.bank-badge {
    background: #e6f3ff;
    color: var(--primary);
}

.budget-badge {
    background: #e6f7ff;
    color: var(--success);
}

.text-content {
    text-align: right;
}

.page-title {
        text-align: center;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
.description {
    font-size: 1rem;
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    text-align: center; /* Align description text to the right */
}

.image-container {
    width: 30%;
    min-width: 100px;
    max-width: 150px;
    flex-shrink: 0;
    float: left;
    margin-right: 0.5rem;
}

.image-content {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    object-fit: cover;
}

/* ----------------------------------------------------------------------- */
/* Card Styles                                                           */
/* ----------------------------------------------------------------------- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.bank-summary-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
    border-bottom: 2px solid #e9e9f9;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}

.card-header h2 {
    font-size: 1.2rem;
    color: var(--dark);
    margin: 0;
}

.card-header .feasibility {
    font-weight: bold;
    color: #555;
}

.card-body {
    min-height: 200px;
}

.card-footer {
    text-align: center;
    margin-top: .5rem;
}

.toggle-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: .4rem .8rem;
    margin: 0 .3rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: #eee;
}

.toggle-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

/* ----------------------------------------------------------------------- */
/* Modal Styles                                                          */
/* ----------------------------------------------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.modal-content button {
    padding: 0.75rem 1.5rem;
    margin: 0 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

.modal-content button:first-of-type {
    background-color: #6c63ff;
    color: white;
}

.modal-content button:last-of-type {
    background-color: #e0e0e0;
    color: #555;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

/* ======================
   Mobile Responsive Fixes
====================== */
@media screen and (max-width: 768px) {
    /* Make the main container full width */
    .main-two-column {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        overflow-x: hidden;
    }
    
    /* Stack columns vertically on mobile */
    .main-two-column {
        display: flex !important;
        flex-direction: column;
    }
    
    /* Remove margins on columns */
    .accounts-list-column,
    .form-column {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix form column width */
    .statements-page .form-column,
    .form-column {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 1.5rem 0 !important;
        padding: 0 10px;
    }
    
    /* Make table horizontally scrollable instead of squishing */
    .statement-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -5px;
        padding: 0 5px;
    }
    
    .statement-table {
        min-width: 600px; /* Allow table to be wider than screen */
        table-layout: auto; /* Change from fixed to auto for better mobile flow */
    }
    
    /* Adjust header with image for mobile */
    .header-with-image {
        flex-direction: column;
        text-align: center;
    }
    
    .image-container {
        margin-bottom: 15px;
    }
    
    /* Fix the account details grid */
    #dateSelection_form .form-row {
        grid-template-columns: 1fr !important; /* Stack fields vertically */
        gap: 1rem;
    }
    
    /* Adjust cards padding */
    .card {
        padding: 15px !important;
    }
    
    /* Account items stack nicely */
    .account-item {
        flex-wrap: wrap;
    }
    
    .account-name {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .account-balance {
        width: 100%;
        text-align: left;
        padding-left: 0;
    }
}
