/* --- 1. Alapelrendezés és Konténer --- */
.container {
    width: 99%;
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding: 0.3rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-teal);
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--primary-blue);
    cursor: pointer;
}

/* --- 2. Hónap Lapozó --- */
.month-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: rgba(255,255,255,0.6);
    border-radius: 50px;
    margin-bottom: 0.6rem;
}

.month-nav h2 {
    font-size: 1.1rem;
    color: var(--primary-blue);
    text-align: center;
    margin: 0;
    min-width: 150px;
}

.nav-btn {
    background: var(--white);
    border: 1px solid var(--primary-teal);
    color: var(--primary-teal);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--primary-teal);
    color: var(--white);
}

.controls-container{
    /*background: linear-gradient(120deg, var(--primary-blue), var(--primary-teal));*/
    background: linear-gradient(var(--primary-teal));
    padding:5px 10px;
    padding-bottom:10px;
    border-radius: 15px;
}
/* --- 3. Háromszintű Egyenleg Kártya --- */
.balance-card {
    background: linear-gradient(170deg, var(--primary-blue), var(--primary-teal));
    color: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 20px rgba(2, 136, 209, 0.3);
    margin-bottom: 0.3rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.balance-label { font-size: 0.85rem; opacity: 0.9; margin-bottom: 2px; }
.balance-amount { font-size: 2.2rem; font-weight: 700; }

.balance-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 12px;
    margin-top: 5px;
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.stat-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.5px;
}

.stat-item .value {
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-item.highlight {
    border-left: 1px solid rgba(255,255,255,0.2);
}

/* --- 4. Nézetváltó (Switcher) --- */
.view-switcher {
    display: flex;
    /*background: rgba(0,0,0,0.05);*/
    background: rgba(0,0,0,0.10);
    margin: 15px 0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.view-btn {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    background: transparent;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: var(--primary-blue);
}

/* --- 5. Vezérlő Sáv (Gombok) --- */
.controls-bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 50;
}

.wallet-selector-btn {
    flex: 1;
    background: var(--white);
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-color);
}

.wallet-icon-group { display: flex; align-items: center; gap: 10px; }

.filter-toggle-btn {
    background: var(--white);
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: var(--border-radius);
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    position: relative;
}

.filter-toggle-btn.active-state { color: var(--primary-teal); background: #e0f2f1; }
.filter-dot {
    position: absolute; top: 10px; right: 10px; width: 8px; height: 8px;
    background: var(--expense-red); border-radius: 50%; display: none;
}
.filter-toggle-btn.has-filters .filter-dot { display: block; }

/* --- 6. LENYÍLÓ PANELEK (A hiányzó stílusok) --- */
.dropdown-panel {
    display: none;
    background: var(--white);
    margin-top: 10px;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}
.dropdown-panel.open { display: block; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tárca lista elemek */
.wallet-list-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}
.wallet-list-item:last-child { border-bottom: none; }
.wallet-list-item:hover { background-color: var(--input-bg); }
.wallet-list-item.selected { background-color: #e0f7fa; color: var(--primary-teal); font-weight: 600; }
.wallet-list-item .check-icon { display: none; color: var(--primary-teal); }
.wallet-list-item.selected .check-icon { display: block; }

/* Szűrő panel elemek */
.filter-content { padding: 15px; }
.filter-section { margin-bottom: 15px; }
.filter-section h4 { font-size: 0.8rem; text-transform: uppercase; color: var(--text-light); margin-bottom: 8px; }

.chip-container { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: 0.2s;
}
.filter-chip.active { background-color: var(--primary-teal); color: white; }
.filter-chip[data-type="expense"].active { background-color: var(--expense-red); }

/* --- 7. Tranzakció és Terv Kártyák --- */
.transaction-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.transaction-card {
    background: var(--white);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.transaction-card:hover { transform: translateY(-2px); }

.t-left { display: flex; align-items: center; gap: 12px; }
.t-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background-color: var(--input-bg);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-blue);
}

.t-details h4 { font-size: 0.95rem; margin-bottom: 2px; display: flex; align-items: center; gap: 5px; }
.t-details p { font-size: 0.75rem; color: var(--text-light); }

.plan-badge {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.t-amount { font-size: 1rem; font-weight: 700; }
.amount-pos { color: var(--primary-teal); }
.amount-neg { color: var(--expense-red); }

/* --- 8. Modal Stílus --- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
    box-sizing: border-box;
    -webkit-appearance: none; /* Reseteli az iOS egyedi megjelenését */
    appearance: none;
    max-width:100%;
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
}

#isDefaultWallet {
    -webkit-appearance: checkbox !important;
    appearance: checkbox !important;
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}


.checkbox-row {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 1.2rem;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.modal-right-btns {
    display: flex;
    gap: 10px; /* Távolság a Mégse és Mentés gombok között */
    justify-content: flex-end;
    flex: 1; /* Hogy kitöltse a maradék helyet és jobbra rendezzen */
}

/* Extra igazítás: ha nincs törlés gomb (pl. read-only vagy új tétel),
   akkor is maradjanak a gombok a jobb szélen */
#addForm:not(:has(.btn-delete[style*="display: block"])) .modal-right-btns {
    justify-content: flex-end;
}


.btn-save { background: var(--primary-teal); color: white; border: none; padding: 12px 20px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.btn-cancel { background: #eee; border: none; padding: 12px 15px; border-radius: 10px; cursor: pointer; }
.btn-delete { background: var(--expense-red); color: white; border: none; padding: 12px; border-radius: 10px; cursor: pointer; display: none; }

/* --- 9. FAB (Új gomb) --- */
.fab {
    position: fixed;
    bottom: 2rem; right: 2rem;
    width: 60px; height: 60px;
    background: var(--primary-blue);
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(2, 136, 209, 0.4);
    cursor: pointer; border: none; font-size: 2rem;
    z-index: 100;
    transition: transform 0.2s;
}
.fab:hover { transform: scale(1.1); }

.summary-section { margin-bottom: 25px; }
.summary-section h3 { font-size: 1.1rem; color: var(--primary-blue); margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.summary-card {
    background: white; padding: 15px; border-radius: 12px; display: flex;
    justify-content: space-between; margin-bottom: 10px; box-shadow: var(--card-shadow);
}
.category-stat-row { margin-bottom: 12px; }
.stat-info { display: flex; justify-content: space-between; margin-bottom: 4px; }
.stat-bar-bg { background: #eee; height: 8px; border-radius: 4px; overflow: hidden; }
.stat-bar-fill { background: var(--primary-teal); height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.nincs_analitika{
    text-align: center;
}

.nincs_analitika img{
    width:100%;
    border-radius:20px;
}

.summary-card.highlight {
    border: 2px solid var(--primary-teal);
    background: linear-gradient(to right, #ffffff, #f0fdfa);
    display: flex;
    flex-direction: column;
}
.insight-details {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.just-mobile-showing{
    display: none;
}

.filter-chip.master-chip {
    border: 1.5px solid var(--primary-teal);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.filter-chip.master-chip.active {
    background: var(--primary-teal);
    color: white;
}

.transfer-selector {
    display: flex;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.t-btn {
    flex: 1;
    border: none;
    padding: 8px;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s;
}
.t-btn.active {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    color: var(--primary-teal);
    font-weight: bold;
}

@media screen and (max-width:600px){
    .mobile-hiding{
        display: none;
    }

    .just-mobile-showing{
        display:inline-block;
    }
}