/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    line-height: 1.6;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Экраны */
.screen {
    min-height: 100vh;
}

.screen.hidden {
    display: none;
}

/* Карточка авторизации */
.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    margin-top: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.subtitle {
    color: #aaa;
    margin-bottom: 30px;
}

/* Поля ввода */
.input-field {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.input-field::placeholder {
    color: #888;
}

select.input-field option {
    background: #1a1a2e;
    color: #fff;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s ease;
}

.btn-icon:hover {
    transform: rotate(90deg);
}

/* Карточки контента */
.card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #fff;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #ddd;
}

/* Баланс */
.balance-section {
    text-align: center;
}

.balance-main {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.balance-details {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.income {
    color: #4CAF50;
}

.expense {
    color: #f44336;
}

/* Задолженности */
.debts-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debts-stats span {
    font-size: 0.95rem;
}

/* Заголовок секции с кнопкой */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Фильтр дат */
.date-filter {
    margin-bottom: 20px;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.filter-controls .input-field {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}

.filter-controls .btn-primary,
.filter-controls .btn-secondary {
    width: auto;
    padding: 10px 15px;
}

/* График */
.chart-container {
    margin-top: 20px;
    text-align: center;
}

#expense-chart {
    max-width: 300px;
    margin: 0 auto;
}

#chart-placeholder {
    color: #888;
    font-style: italic;
    padding: 20px;
}

/* Форма */
.form {
    display: flex;
    flex-direction: column;
}

/* Списки */
.list-container {
    max-height: 350px;
    overflow-y: auto;
    margin-top: 15px;
    padding-right: 5px;
}

.list-container::-webkit-scrollbar {
    width: 6px;
}

.list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.list-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.list-item-left {
    flex: 1;
}

.list-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.list-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.list-item-date {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.list-item-comment {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 4px;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.list-item-amount {
    font-weight: bold;
    font-size: 1rem;
}

.list-item-actions {
    display: flex;
    gap: 5px;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.action-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.empty-message {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Статус */
.status {
    text-align: center;
    padding: 10px;
    font-style: italic;
    font-size: 0.9rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
}

header h1 {
    font-size: 1.5rem;
}

/* Адаптивность */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .balance-main {
        font-size: 2rem;
    }

    .filter-controls {
        flex-direction: column;
    }

    .filter-controls .input-field,
    .filter-controls .btn-primary,
    .filter-controls .btn-secondary {
        width: 100%;
    }
}

/* Скрытие элемента */
.hidden {
    display: none !important;
}

/* Модальное окно подтверждения */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal h3 {
    margin-bottom: 15px;
}

.modal p {
    margin-bottom: 25px;
    color: #aaa;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    flex: 1;
    max-width: 120px;
}

/* Прогресс-бар для целей */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.goal-amounts {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 5px;
}
