/* Variables y estilos generales */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    padding-bottom: 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

header h1 {
    margin-bottom: 10px;
}

.back-button {
    margin-bottom: 10px;
}

.back-button a {
    color: white;
    display: inline-block;
    padding: 5px;
}

section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin: 20px;
    box-shadow: var(--shadow);
}

h2 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--secondary-color);
}

.danger {
    background-color: var(--danger-color);
}

.danger:hover {
    background-color: #c0392b;
}

/* Estilos de la acción */
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Estilos para las cuentas */
.account-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.account-card:hover {
    transform: translateY(-3px);
}

.account-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 15px;
}

.account-info {
    flex-grow: 1;
}

.account-name {
    font-weight: bold;
    font-size: 18px;
}

.account-balance {
    font-size: 16px;
    color: #555;
}

/* Estilos para las transacciones */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.transaction-info {
    flex-grow: 1;
}

.transaction-amount {
    font-weight: bold;
}

.income {
    color: var(--success-color);
}

.expense {
    color: var(--danger-color);
}

.transaction-description {
    color: #777;
    font-size: 14px;
}

.transaction-date {
    font-size: 12px;
    color: #999;
}

.delete-btn {
    background-color: transparent;
    color: var(--danger-color);
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0 10px;
}

/* Estilos del formulario */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.transaction-buttons {
    display: flex;
    gap: 10px;
}

.income-btn {
    background-color: var(--success-color);
    flex-grow: 1;
}

.income-btn:hover {
    background-color: #27ae60;
}

.expense-btn {
    background-color: var(--danger-color);
    flex-grow: 1;
}

.expense-btn:hover {
    background-color: #c0392b;
}

/* Estilos para el selector de color */
.color-selector {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-block;
    border: 2px solid transparent;
}

input[type="radio"] {
    display: none;
}

input[type="radio"]:checked + .color-option {
    border: 2px solid #333;
}

/* Estilos para el modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
}

/* Estilos para el resumen de saldos */
.currency-balance {
    background-color: var(--light-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.currency-code {
    font-weight: bold;
    font-size: 18px;
}

.total-balance {
    font-size: 18px;
}

/* Estilos para textarea de importación */
textarea {
    width: 100%;
    font-family: monospace;
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 600px) {
    section {
        margin: 10px;
        padding: 15px;
    }
    
    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
}
