* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.login-container {
    display: flex;
    height: 100vh;
}
  
.login-left, .login-right {
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
  
.login-left {
    background-color: #ffffff;
    width: 50vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f7f7f7;
}
  
.login-card {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    width: 80%;
    max-width: 400px;
    text-align: center;
}
  
.login-card h2 {
    margin-bottom: 20px;
}
  
.login-card input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
  
.login-card button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
  
.login-card button:hover {
    background-color: #218838;
}
  
.login-right {
    position: relative;
    background: url('/static/pattern.jpg') center center / cover no-repeat;
    color: white;
    text-align: center;
    padding: 30px;
    overflow: hidden; /* Ensures the overlay doesn't spill out */
}

.login-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.568); /* semi-transparent gray */
    z-index: 0;
}

/* Make sure the actual content stays above the overlay */
.branding {
    position: relative;
    z-index: 1;
    width: 700px;
}
  
.branding h1 {
    font-size: 5rem;
    margin-bottom: 15px;
}
  
.branding p {
    font-size: 1.75rem;
    max-width: 500px;
    margin: auto;
    font-weight: 50px;
}
  
.register-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #555;
    text-align: center;
}
  
.register-text a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}
  
.register-text a:hover {
    text-decoration: underline;
}
  
.register-left {
    height: 100vh;
    background-color: #f7f7f7;
    width: 50%;
    background: url('/static/pattern.jpg') center center / cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.register-card {
    background-color: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    width: 80%;
    max-width: 500px;
    text-align: center;
    max-height: 95%;
}

.register-card h2 {
  margin-bottom: 20px;
}

.register-card input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.register-card button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.register-card button:hover {
  background-color: #0056b3;
}

.register-card p {
    text-align: left;
    line-height: 0.25;
    font-size: 0.9rem;
}

.checkbox-container {
    margin-bottom: 0px;
    margin-top: 0px;
    margin-left: 0.25rem;
    display: flex;
    align-items: flex-start;
    gap: 5px;
    justify-content: flex-start;
    text-align: left;
}

.checkbox-container label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
}

.login-text {
    margin-top: 10px;
    font-size: 0.9rem !important;
    color: #555;
    text-align: center !important;
}

.login-text a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.login-text a:hover {
  text-decoration: underline;
}

/* For the left side background */
.register-card {
  position: relative;
  z-index: 1;
}
.register-container {
    display: flex;
    height: 100vh;
}

.register-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.568); /* Overlay */
    z-index: 0;
}
  
.branding-texts {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    padding: 20px;
}
  
.branding-texts h1 {
    font-size: 5rem;
    margin-bottom: 20px;
}
  
.branding-texts p {
    font-size: 1.75rem;
    max-width: 500px;
    margin: auto;
    font-weight: 50px;
}
  
.register-right {
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f7f7f7;
}  
  
/* General navbar style */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2f2f2f;
    padding: 1rem 2rem;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}
  
/* Logo */
.logo {
    font-size: 1.4rem;
    font-weight: bold;
}
  
.hamburger-menu {
    display: none;
}

/* Center nav links */
.nav-center {
    display: flex;
    gap: 2rem;
}
  
.nav-link {
    color: rgb(255, 255, 255);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

/* Active tab */
.nav-link.active {
    color: #28a745; /* Green */
}
  
/* Underline on hover */
.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: #28a745;
    transition: width 0.3s ease;
}
  
.nav-link:hover::after {
    width: 100%;
}
  
.nav-link:hover {
    color: #28a745;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
}
  
.dropbtn {
    background-color: #585858;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}
  
.dropbtn:hover {
    background-color: #4a4a4a;
}
  
  
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #444;
    min-width: 120px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 6px;
    overflow: hidden;
    z-index: 1;
}
  
.dropdown-content a {
    color: white;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    transition: background 0.2s ease;
}
  
.dropdown-content a:hover {
    background-color: #28a745;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.hamburger {
    display: none;
}
  
.chart-card {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    margin: 2rem auto;
    text-align: center;
    position: relative;
    padding-bottom: 0;
}

canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

.balance-info {
    margin-bottom: 1rem;
    text-align: center;
}

.current-balance {
    font-size: 1.65rem;
    font-weight: 600;
    color: #2e7d32; /* dark green or whatever fits your theme */
}

.month-summary {
    font-size: 1rem;
    color: #666;
    /* margin-top: 0.25rem; */
}

.chart-title {
    font-size: 1.4rem;
    /* margin-bottom: 1rem; */
    font-weight: 500;
    color: #333;
}

.card-footer-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #d1e9d4;
    color: rgb(73, 73, 73);
    padding: 1rem 1.25rem;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s;
    margin-top: 2rem;   /* Push footer below chart */
    margin-left: -2rem; /* Remove left padding from .chart-card */
    margin-right: -2rem;
}

.card-footer-link .arrow {
    font-size: 1.75rem; /* ← increase this for a bigger arrow */
    margin-left: 0.5rem;
    line-height: 1;
}  

.card-footer-link:hover {
    background-color: #8cb392; /* slightly darker on hover */
    cursor: pointer;
    color: white;
}

.analysis-tab {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}
  
.chart-section {
    position: relative;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    padding-top: 2.5rem; /* room for the tab switcher */
    margin: 2rem auto;
    overflow: visible;
    width: 90%;
}
  
.chart-header {
    text-align: center;
    font-size: 2rem; /* Adjust size as needed */
    font-weight: 600;
    margin-bottom: 1rem; /* Space below the heading */
}
  
.chart-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

.chart-tabs {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 1rem;
    background: white;
    padding: 0.2rem 0.75rem;
    border-radius: 1rem;
    box-shadow: 0 2px 5px rgb(0, 0, 0, 0.5);
    z-index: 2;
}

.tab-btn {
    border: none;
    background: #e0e0e0;
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
    font-size: 0.8rem;
}
  
.tab-btn.active {
    background: #54606d;
    color: white;
}
  
.chart-canvas {
    max-width: 80%;
    height: 300px;
    margin: auto;
    margin-bottom: 3rem;
}
  
.hidden {
    display: none !important;
}

.categories {
    max-width: 40%;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin: 2rem 0 0 0;
    color: green;
}  

.transactions-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    gap: 1rem;
}
  
.transaction-card {
    display: grid;
    grid-template-columns: 100px 100px 1fr 120px auto;
    align-items: center;
    background-color: white;
    width: 55%;
    min-width: 300px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    font-size: 0.95rem;
    gap: 1rem;
    text-align: center;
}

.transaction-card .restore-btn {
    color:red
}

.transaction-card.deleted {
    color: red;
    position: relative;
    opacity: 0.8;
}
  
.transaction-card.deleted::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 9rem;
    height: 2px;
    background: red;
    transform: translateY(-50%);
    z-index: 1;
}
  

.transaction-card .type {
    font-weight: 600;
    min-width: 70px;
    text-transform: capitalize;
}

.transaction-card .type.income {
    color: green;
}

.transaction-card .type.expense {
    color: crimson;
}
  
.transaction-card .amount {
    font-weight: bold;
    min-width: 80px;
}
  
.transaction-card .category,
.transaction-card .date {
    white-space: nowrap;
    color: #555;
}
  
.transaction-card .actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
  
.actions button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.mobile-actions, .actions-options {
    display: none;
}

  /* Popup Styles */
.popup {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}

.popup-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
  
.popup-buttons {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}
  
.popup-buttons .danger {
    background: crimson;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}
  
.popup-buttons button {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

.sort-menu-wrapper {
    display: none;
}
  
.add-transaction-container {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 100;
}
  
.add-transaction-btn {
    display: flex;
    align-items: center;
    background-color: #007bffbe;
    color: rgb(255, 255, 255);
    border: none;
    border-radius: 70px;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: width 0.3s ease, padding 0.3s ease;
    overflow: visible;
    width: 70px;
    height: 70px;
    justify-content: center;
    vertical-align: middle;
}

.plus-icon {
    /* line-height: 50%; */
    font-size: 1.7rem;
    transition: margin-right 0.3s ease;
    line-height: 1;
}
  
.btn-label {
    white-space: nowrap;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
    line-height: 1;
}
  
.add-transaction-btn:hover {
    width: 220px;
    justify-content: start;
    padding-left: 1.5rem;
}
  
.add-transaction-btn:hover .plus-icon {
    margin-right: 0.5rem;
}

.add-transaction-btn:hover .btn-label {
    opacity: 1;
    display: inline;
}

.add-transaction-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1rem;
}
  
.add-transaction-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    width: 100%;
    max-width: 600px;
}
  
/* HERE NOW */
.card-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}
  
.transaction-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
  
.transaction-form input,
.transaction-form select {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #ccc;
}
  
.add-btn {
    background-color: #007bff;
    color: white;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
  
.add-btn:hover {
    background-color: #0056b3;
}
  
.msg {
    padding: 3rem;
    text-align: center;
}

@media (max-width: 1000px) {
    .login-container {
        flex-direction: column;
        position: relative;
    }
    
    .login-left {
        width: 100%;
        background: url('/static/pattern.jpg') center center / cover no-repeat;
        position: absolute;
        z-index: 1;
    }
    
    .login-left::before {
        content: '';
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.568); /* semi-transparent gray */
        z-index: 0;
    }
    
    .login-right {
        width: 100%;
        height: 30%;
        position: absolute;
        background: none;
        overflow: visible;
        z-index: 2;
        align-items: center;
        justify-content: center;
    }

    .login-right::before {
        display: none;
    }
    
    /* Make sure the actual content stays above the overlay */
    .branding {
        position: relative;
        z-index: 2;
        width: 100%;
    }
    
    .branding p {
        display: none;
    }

    .login-card {
        z-index: 9999;
    }

    .register-container {
        flex-direction: column;
        position: relative;
    }

    .register-left {
        width: 100%;
        height: 30%;
        position: absolute;
        background: none;
        overflow: visible;
        z-index: 2;
    }
    
    .register-left::before {
        display: none;
    }

    .register-right {
        width: 100%;
        height: 100%;
        background: url('/static/pattern.jpg') center center / cover no-repeat;
        position: absolute;
        z-index: 1;
    }

    .register-right::before {
        content: '';
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.568); /* semi-transparent gray */
        z-index: 0;
    }
    
    .branding-texts {
        position: absolute;
        z-index: 1;
        text-align: center;
        color: white;
        padding: 20px;
    }
    
    .branding-texts p {
        display: none;
    }

    .register-card {
        width: 80%;
        max-width: 400px;
        height: 60%;
        margin-top: 10%;
        overflow-y: scroll;
    }

    .hamburger {
        display: block;
        font-size: 2rem;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
    }
    
    /* Logo */
    .logo {
        font-size: 1.4rem;
        font-weight: bold;
    }
    
    /* Center nav links */
    .nav-center, .nav-right {
        display: none;
    }
    
    .nav-link {
        color: rgb(255, 255, 255);
        text-decoration: none;
        font-weight: 500;
        position: relative;
        padding-bottom: 4px;
        transition: color 0.3s ease;
    }

    .hamburger-menu.show {
        display: flex;
        flex-direction: column;
        background-color: red;
        text-align: center;
        position: fixed;
        top: 0;
        left: 0;
        height: 60vh;
        width: 100vw;
        background: rgba(0, 0, 0, 0.9); /* semi-transparent */
        z-index: 999;
        justify-content: flex-start;
        align-items: center;
        /* gap: 10%; */
    }
    
    .mobile-menu {
        margin-top: 30%;
        display: flex;
        flex-direction: column;
        gap: 10%;
        justify-content: center;
        height: 50%;
    }

    .chart-card {
        border: none;
        padding: 0.5rem; 
        box-shadow: none;
        max-width: 150%;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .balance-info {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .month-summary {
        margin-bottom: 2rem;
    }

    .chart-title {
        margin-bottom: 1rem;
    }

    #balance_chart {
        margin-top: 1rem;
    }
    
    .card-footer-link {
        padding: 0.5rem 0.75rem;
        border-radius: 1rem;
        width: 90%;
        font-size: 0.77rem;
        margin: 2rem auto;
    }

    .card-footer-link .arrow {
        font-size: 1.4rem; /* ← increase this for a bigger arrow */
    } 

    .analysis-tab {
        padding: 2rem 0;
        align-items: center;
        justify-content: center;
        max-width: 100%;
    }
    
    .chart-section {
        border-radius: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        width: 100%;
        height: fit-content;
    }
    
    .chart-header h2 {
        font-size: 1.2rem;
    }

    .chart-tabs {
        box-shadow: 0 2px 10px rgb(0, 0, 0, 0.2);
    }

    .tab-btn {
        font-size: 0.7rem;
    }
    
    .chart-canvas {
        max-width: 93%;
        height: 100%;
    }

    .categories {
        max-width: 93%;
    }

    .page-title {
        font-size: 2rem;
    }  
    
    .transactions-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 0;
    }
    
    .transaction-card {
        display: grid;
        grid-template-columns: 20% 20% 40% 9% 10%;
        width: 88%;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border-color: rgba(85, 85, 85, 0.5);
        border-width: 1px 0;
        border-style: solid;
        border-bottom-width: 0;
        font-size: 0.7rem;
        gap: 0rem;
        text-align: center;
        height: 8vh;
    }

    .mobile-actions button {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .mobile-actions {
        display: flex;
        justify-content: center;
        margin-left: 15px;
    }

    .actions-options.active {
        position: absolute;
        background-color: rgb(201, 201, 201);
        display: grid;
        right: 10%;
        width: 100px;
        border-radius: 10px;
        padding-left: 1rem;
        padding-right: 1rem;
        z-index: 999;
    }
    
    .actions-options.on.active {
        grid-template-columns: 40% 1fr 40%;
    }

    .actions-options.active button {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .actions-options.active .line {
        margin-top: 10%;
        height: 80%;
        background-color: rgb(107, 107, 107);
        width: 1px;
        align-self: center;
        justify-self: center;
    }

    .actions-options.active .restore-btn {
        font-size: 0.9rem;
        color: red;
    }

    .transaction-card.deleted::before {
        width: 90%;
    }
    
    .transaction-card .type {
        min-width: 0;
    }

    .transaction-card .amount {
        font-weight: 500;
        min-width: 0;
    }
    
    .transaction-card .actions {
        display: none;
    }

    .add-transaction-container {
        position: absolute;
        top: 10rem;
        left: 1.5rem;
    }
    
    .add-transaction-btn {
        border-radius: 50px;
        padding: 0;
        font-size: 0.75rem;
        transition: none;
        width: 35vw;
        height: 1rem;
    }

    .plus-icon {
        font-size: 0.75rem;
        font-weight: bolder;
        transition: none;
        line-height: 0.5;
    }
    
    .btn-label {
        margin-left: 5px;
        opacity: 1;
        transition: none;
        display: inline;
    }
    
    .add-transaction-btn:hover {
        width: 35vw;
        justify-content: center;
        padding: 0;
    }
    
    .add-transaction-btn:hover .plus-icon {
        margin: 0;
        padding: 0;
    }
}