/*
Theme Name: Budget Tracker
Theme URI: https://budgettracker.local
Author: Budget Team
Author URI: https://budgettracker.local
Description: WordPress тема для учета персональных расходов и доходов с поддержкой нескольких валют, аналитикой и экспортом данных.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: budget-tracker
Tags: budget, finance, expenses, income, analytics
*/

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.main-navigation a:hover {
    color: #3498db;
}

/* Main Content */
.site-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.2rem;
}

/* Forms */
.budget-form {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Tables */
.budget-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.budget-table table {
    width: 100%;
    border-collapse: collapse;
}

.budget-table th {
    background: #2c3e50;
    color: #fff;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.budget-table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

.budget-table tr:hover {
    background: #f8f9fa;
}

/* Currency Badge */
.currency-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.currency-usd {
    background: #3498db;
    color: #fff;
}

.currency-eur {
    background: #9b59b6;
    color: #fff;
}

.currency-pln {
    background: #e74c3c;
    color: #fff;
}

.currency-uah {
    background: #f39c12;
    color: #fff;
}

/* Charts */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: #fff;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Expense Calendar Styles */
.expense-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin: 20px 0;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: #34495e;
    color: white;
    border-radius: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    position: relative;
    padding: 0.5rem;
}

.calendar-day:hover {
    background: #ecf0f1;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.calendar-day.has-expenses {
    background: #e8f5e9;
    border-color: #27ae60;
    border-width: 2px;
}

.calendar-day.has-expenses:hover {
    background: #c8e6c9;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #95a5a6;
    cursor: default;
}

.calendar-day.other-month:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day .day-number {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.calendar-day .expense-count {
    font-size: 0.8rem;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calendar-controls button {
    min-width: 50px;
}

.calendar-controls h3 {
    min-width: 200px;
    text-align: center;
    margin: 0;
    cursor: pointer;
    user-select: none;
}

.calendar-controls h3:hover {
    color: #3498db;
}

/* Edit Modal Styles */
#edit-expense-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#edit-expense-modal > div {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .calendar-day .day-number {
        font-size: 1rem;
    }
    
    .calendar-day .expense-count {
        font-size: 0.7rem;
        padding: 1px 5px;
    }
    
    .calendar-controls {
        flex-wrap: wrap;
    }
    
    .calendar-controls h3 {
        min-width: 150px;
        font-size: 1rem;
    }
}
