@import url('theme.css');


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
}

html{
    scroll-behavior: smooth;
}
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #2f4f4f;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1c3b3a;
}

::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}


header {
    background: var(--color-primary);
    color: var(--color-text);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid #7cb394;
}

header .logo {
    width: 50px;
}

header .container{
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 1rem;
}

header .header-left{
    display: flex;
    align-items: center;
    gap: 10px; 
}



form{
    display: flex;
    flex-direction: column;
    max-width: 250px;
    justify-content: space-around;
    align-items: center;
    padding: 20px;
    margin: 0 auto;
    border: 1px solid var(--color-accent);
    text-align: center;
}

h2{
    text-align: center;
    margin: 30px;
}

.logo {
    font-size: 1rem; 
    margin-right: 10px; 
    color: var(--color-text);
}

.header-left h1 {
    margin-left: 10px;
    font-size: 1.5rem;
}

.header-right .btn {    
    color: var(--color-text);
    padding: 6px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
}


.header-right .btn:hover {
    background: var(--color-secondary);
}


.main-container {
    display: flex;
    width: 100vw;
    height: auto;
    position: absolute;
    top: 3rem;
}

.sidebar {
    width: 200px;
    background: var(--color-element-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.sidebar .nav-link {
    display: block;
    color: var(--color-text);
    text-decoration: none;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.sidebar .nav-link:hover {
    background: var(--color-accent);
    color: var(--color-text);
}


.content {
    padding: 20px;
    width: 100%;
    height: calc(100% - 7rem);
    position: relative;
    box-sizing: border-box;
    bottom: 0rem;
    top: 0rem;
    display: grid;
    flex-direction: column;
}

#seccion-ingresos {
    gap: 2%;
    width: 100%;
    display: flex;
}


.amount {
    display: block;
    font-size: 1.25rem; 
    font-weight: bold;
    color: var(--color-primary); 
    margin-bottom: 5px;    
}


.description {
    display: block;
    font-size: 1rem; 
    color: var(--color-text); 
    margin-bottom: 5px;
}


.date {
    display: block;
    font-size: 0.875rem; 
    color: #888; 
}

#seccion-gastos{
    gap: 20px;
    width: 100%;
    display: flex;
}

.section {
    margin-bottom: 30px;
    padding: 15px;
    background: var(--color-element-bg);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);    
    position: relative;
}

.section h2 {
    margin-bottom: 15px;
    color: var(--color-primary);
}

.section ul {
    list-style: none;
}


.section ul li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-around;
}
.section ul li span {
    width: 80%;
}

.section ul li a {
    margin-left: 10px;
    text-decoration: none;
    font-size: 14px;
}


.section ul li a:hover {
    text-decoration: underline;
}

.btn {
    background: var(--color-primary);
    color: var(--color-text);
    padding: 8px 12px;
    border-radius: 5px;
    font-weight: bold;
}

.btn:hover {
    background: var(--color-secondary);
}

.edit-btn {
    background: none;
}

.delete-btn {
    color: var(--color-delete);
    background: none;
}

.add-btn {
    background: var(--color-primary);
    color: whitesmoke;
    font-size: 12px;
}

#income{
    width: 75%;
}
#totals{
    width: 20%;
}
#expenses{
    width: 70%;
}
#categories{
    width: 25%;
}

footer {
    background: var(--color-primary);
    color: var(--color-text);
    padding: 10px;
    text-align: center;
    position: fixed;
    width: 100%;
    bottom: 0;
    height: 2rem;
    font-size: 0.8rem;
    line-height: 1rem;
    border-top: 1px solid #7cb394;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--color-accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.view-selector{
    gap: 20px;
    display: flex;
    flex-direction: column;
}

.title_action{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding:0 5% 10px;
}
.title_action .add-btn{
    border-radius:20px;
    box-sizing: border-box;
    text-decoration: none;
    font-weight: lighter;
}



@media only screen and (max-width: 768px) {

    body {
        background-color: #121212;
        color: #e0e0e0;
        font-size: 0.875rem;
    }

    header {
        font-size: 0.875rem;
    }

    header .header-right .btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        border-radius: 15px;
        background-color: #bb86fc;
        color: #121212;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .main-container {
        flex-direction: column;
        padding-top: 0; /* Asegura que el contenido no quede oculto detrás del header */
        margin: 0;
    }

    .sidebar {
        width: 100%;
        padding: 6px;
        background-color: #1f1f1f;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .sidebar .nav-link {
        width: 90%;
        padding: 10px 0;
        margin-bottom: 10px;
        border-radius: 8px;
        text-align: center;
        background-color: #333333;
        color: #bb86fc;
        font-size: 0.875rem;
    }
    .view-selector{
        gap: 5px;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .content {
        display: flex;
        flex-direction: column;
        padding: 10px;
        background-color: #1f1f1f;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        min-height: calc(100vh - 10rem); /* Asegura que el contenido ocupe el espacio disponible */
    }

    #seccion-ingresos, #seccion-gastos {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 15px;
        background-color: #161b18;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    #seccion-ingresos {
        .description{
            display: none;
        }
        .date{
            display: none;
        }
    }

    #totals, #expenses, #categories, #income {
        width: 100%;
        margin-bottom: 15px;
        background-color: #333333;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    #totals {
        padding: 15px;
        background-color: #333333;
        border-radius: 8px;
        margin-bottom: 15px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }

    .totals-container {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: space-between;
    }

    .total-box {
        flex: 1 1 calc(50% - 15px); /* Ocupa el 50% del ancho disponible menos el espacio de gap */
        background-color: #444444;
        padding: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        text-align: center;
    }

    .total-box h3 {
        font-size: 1.25rem; /* Tamaño de fuente mayor para los encabezados */
        margin-bottom: 10px;
    }

    .total-box p {
        font-size: 1.5rem; /* Tamaño de fuente mayor para los valores */
        font-weight: bold;
    }

    footer {
        margin-top: auto;
        background-color: #bb86fc;
        color: #121212;
        padding: 15px 0;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.5);
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
    }
}

.chart-container {
    padding: 5px 50px;
    box-shadow: 0 0 1px 0px white;
    margin: 5px;
}