/* Калькулятор одноразовых трат */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Заголовок */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.header-content h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.header-content p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.back-btn, .register-btn {
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.back-btn:hover, .register-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Основной контент */
.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.section h2 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

/* Секция участников */
.participants-section {
    grid-column: 1 / -1;
}

.participants-input {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.participants-input input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

.participants-input input:focus {
    border-color: #667eea;
    outline: none;
}

#add-participant-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#add-participant-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.participant-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.participant-remove {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.2s ease;
}

.participant-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Секция добавления трат */
.expense-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Calculator-specific form layout */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.9rem;
}

.expense-type-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.9rem;
}

.expense-type-tabs {
    display: flex;
    gap: 10px;
}

.tab-button {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tab-button:not(.active):hover {
    border-color: #667eea;
    color: #667eea;
}

.individual-amounts {
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.individual-amounts p {
    margin: 0 0 15px 0;
    font-weight: 600;
    color: #4a5568;
}

.individual-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.individual-item label {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.individual-item input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

#add-expense-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#add-expense-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

/* Список трат */
.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.expense-item {
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    position: relative;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.expense-description {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.expense-amount {
    font-weight: 700;
    color: #48bb78;
    font-size: 1.2rem;
}

.expense-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #718096;
}

.expense-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fed7d7;
    color: #e53e3e;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.expense-remove:hover {
    background: #feb2b2;
}

/* Секция расчетов */
.calculations-section {
    grid-column: 1 / -1;
}

.calculation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    text-align: center;
}

.summary-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.total-amount,
.participants-count,
.expenses-count {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.balances-section,
.transfers-section {
    margin-bottom: 30px;
}

.balances-section h3,
.transfers-section h3 {
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.3rem;
}

.balances-list,
.transfers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.balance-name {
    font-weight: 600;
    color: #2d3748;
}

.balance-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.balance-amount.positive {
    color: #48bb78;
}

.balance-amount.negative {
    color: #e53e3e;
}

.transfer-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fff5f5;
    border-radius: 10px;
    border-left: 4px solid #48bb78;
}

.transfer-text {
    flex: 1;
    font-weight: 500;
    color: #2d3748;
}

.transfer-amount {
    font-weight: 700;
    color: #48bb78;
    font-size: 1.1rem;
}

/* Призыв к регистрации */
.registration-cta {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    text-align: center;
}

.cta-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
}

.cta-card p {
    margin: 0 0 25px 0;
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.cta-btn {
    padding: 15px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.cta-btn.primary {
    background: white;
    color: #f5576c;
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Общие состояния */
.no-participants,
.no-expenses,
.no-data {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.notification-content {
    background: #48bb78;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease;
}

.notification.error .notification-content {
    background: #e53e3e;
    box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3);
}

.notification-message {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
    
    .calculator-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .calculation-summary {
        grid-template-columns: 1fr;
    }
    
    .participants-input {
        flex-direction: column;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .expense-type-tabs {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 20px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .individual-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .individual-item input {
        width: 100%;
    }
}