/*
Theme Name: Семейный Финансовый Помощник
Theme URI: https://your-site.com/sfp-theme
Author: Your Name
Author URI: https://your-site.com
Description: Специализированная тема для плагина "Семейный Финансовый Помощник" с современным дизайном, адаптивностью и поддержкой темной темы. Полностью интегрирована с плагином семейного бюджета.
Version: 1.0.0
License: GPL v2 or later
Text Domain: sfp-family-theme
Domain Path: /languages
Tags: family-finance, budget, two-columns, right-sidebar, responsive-layout, custom-background, custom-header, custom-menu, featured-images, flexible-header, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.1

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/*--------------------------------------------*/
/* 1. ПЕРЕМЕННЫЕ И БАЗОВЫЕ НАСТРОЙКИ
/*--------------------------------------------*/
:root {
    --primary-color: #0073aa;
    --primary-dark: #005a87;
    --primary-light: #e5f5ff;
    --secondary-color: #ff9800;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ffc107;
    --info-color: #2196f3;
    --text-color: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --bg-color: #f5f5f5;
    --bg-white: #ffffff;
    --bg-gray: #f9f9f9;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/*--------------------------------------------*/
/* 2. СБРОС СТИЛЕЙ И БАЗОВЫЕ ЭЛЕМЕНТЫ
/*--------------------------------------------*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    overflow-x: hidden;
}

/*--------------------------------------------*/
/* 3. КОНТЕЙНЕРЫ И СЕТКА
/*--------------------------------------------*/
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    padding: 40px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

.content-wrapper.no-sidebar {
    grid-template-columns: 1fr;
}

.content-wrapper.sidebar-left {
    grid-template-columns: 320px 1fr;
}

/*--------------------------------------------*/
/* 4. ШАПКА САЙТА
/*--------------------------------------------*/
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(0px);
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-lg);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    max-height: 50px;
    width: auto;
    transition: var(--transition);
}

.site-logo img:hover {
    opacity: 0.9;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.site-title a:hover {
    color: var(--primary-dark);
}

.site-description {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 5px;
    line-height: 1.4;
}

/*--------------------------------------------*/
/* 5. НАВИГАЦИЯ
/*--------------------------------------------*/
.main-navigation {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    color: var(--text-color);
    transition: var(--transition);
}

.menu-toggle:hover {
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 10px 0;
    transition: var(--transition);
    display: block;
    font-weight: 500;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-menu a:hover::after,
.nav-menu .current-menu-item a::after {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-menu .current-menu-item a,
.nav-menu .current-page-ancestor a {
    color: var(--primary-color);
    font-weight: 600;
}

/* Выпадающие меню */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    list-style: none;
    padding: 10px 0;
    z-index: 100;
    margin-top: 10px;
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    margin-top: 0;
}

.nav-menu .sub-menu li {
    margin: 0;
}

.nav-menu .sub-menu a {
    padding: 8px 20px;
    font-size: 14px;
}

.nav-menu .sub-menu a::after {
    display: none;
}

.nav-menu .sub-menu a:hover {
    background: var(--primary-light);
    padding-left: 25px;
}

/*--------------------------------------------*/
/* 6. ПОЛЬЗОВАТЕЛЬСКОЕ МЕНЮ
/*--------------------------------------------*/
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-dropdown {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-dropdown:hover {
    background: var(--bg-gray);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    min-width: 200px;
    z-index: 1000;
    margin-top: 10px;
    overflow: hidden;
}

.user-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--bg-white);
}

.user-dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.user-dropdown-menu a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    padding-left: 25px;
}

.user-dropdown-menu .logout-link {
    color: var(--danger-color);
    border-top: 1px solid var(--border-light);
}

.login-btn,
.register-btn {
    padding: 8px 20px;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 14px;
}

.login-btn {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: transparent;
}

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

.register-btn {
    background: var(--primary-color);
    color: white;
}

.register-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/*--------------------------------------------*/
/* 7. ОСНОВНОЙ КОНТЕНТ
/*--------------------------------------------*/
.content-area {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 35px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.content-area:hover {
    box-shadow: var(--shadow-hover);
}

.sidebar {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.entry-title {
    font-size: 32px;
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.3;
}

.entry-meta {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.entry-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.entry-meta .posted-on::before {
    content: '📅';
}

.entry-meta .byline::before {
    content: '👤';
}

.entry-meta .cat-links::before {
    content: '📁';
}

.entry-content {
    line-height: 1.8;
    font-size: 16px;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    margin: 30px 0 15px;
    font-weight: 600;
    line-height: 1.3;
}

.entry-content h1 { font-size: 32px; }
.entry-content h2 { font-size: 28px; }
.entry-content h3 { font-size: 24px; }
.entry-content h4 { font-size: 20px; }
.entry-content h5 { font-size: 18px; }
.entry-content h6 { font-size: 16px; }

.entry-content p {
    margin-bottom: 20px;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

.entry-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.entry-content a:hover {
    border-bottom-color: var(--primary-color);
}

.entry-content ul,
.entry-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.entry-content li {
    margin-bottom: 10px;
}

.entry-content blockquote {
    margin: 20px 0;
    padding: 20px 30px;
    background: var(--bg-gray);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
}

.entry-content code {
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-family: monospace;
    font-size: 14px;
}

.entry-content pre {
    background: var(--bg-gray);
    padding: 20px;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 20px 0;
}

.post-thumbnail {
    margin-bottom: 30px;
    text-align: center;
}

.post-thumbnail img {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.entry-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.tags-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tags-links a {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-gray);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition);
}

.tags-links a:hover {
    background: var(--primary-color);
    color: white;
}

/*--------------------------------------------*/
/* 8. ПАГИНАЦИЯ
/*--------------------------------------------*/
.pagination {
    margin-top: 40px;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    margin: 0 3px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-numbers:hover:not(.current) {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

/*--------------------------------------------*/
/* 9. ВИДЖЕТЫ
/*--------------------------------------------*/
.widget {
    margin-bottom: 35px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.widget ul {
    list-style: none;
}

.widget ul li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.widget ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.widget ul li a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/*--------------------------------------------*/
/* 10. ПОДВАЛ
/*--------------------------------------------*/
.site-footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widget .widget-title {
    color: var(--primary-color);
    border-bottom-color: var(--border-color);
}

.site-info {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 14px;
}

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

.site-info a:hover {
    text-decoration: underline;
}

/*--------------------------------------------*/
/* 11. ФОРМЫ
/*--------------------------------------------*/
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-white);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

button:active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active {
    transform: translateY(0);
}

/*--------------------------------------------*/
/* 12. ТАБЛИЦЫ
/*--------------------------------------------*/
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--primary-light);
    font-weight: 600;
}

tr:hover {
    background: var(--bg-gray);
}

/*--------------------------------------------*/
/* 13. КОММЕНТАРИИ
/*--------------------------------------------*/
.comments-area {
    margin-top: 50px;
}

.comments-title {
    font-size: 24px;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
    margin-bottom: 50px;
}

.comment {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-gray);
    border-radius: var(--border-radius);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-metadata {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.comment-content {
    line-height: 1.6;
}

.reply {
    margin-top: 15px;
}

.comment-reply-link {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
}

.comment-respond {
    margin-top: 40px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
}

.comment-form textarea {
    width: 100%;
    min-height: 150px;
}

.form-submit {
    margin-top: 20px;
}

/*--------------------------------------------*/
/* 14. 404 СТРАНИЦА
/*--------------------------------------------*/
.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 .page-title {
    font-size: 120px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.error-404 .page-content p {
    margin-bottom: 30px;
}

/*--------------------------------------------*/
/* 15. ПОИСК
/*--------------------------------------------*/
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
}

.search-results-title {
    margin-bottom: 30px;
    font-size: 24px;
}

/*--------------------------------------------*/
/* 16. ФИНАНСОВЫЕ ВИДЖЕТЫ И КОМПОНЕНТЫ
/*--------------------------------------------*/
.financial-highlight {
    background: linear-gradient(135deg, var(--primary-light), white);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.budget-warning {
    background: #fff3e0;
    border-left: 4px solid var(--warning-color);
}

.budget-danger {
    background: #ffebee;
    border-left: 4px solid var(--danger-color);
}

.sfp-quick-stats {
    display: flex;
    justify-content: space-around;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

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

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

.stat-value.balance {
    color: var(--primary-color);
}

/*--------------------------------------------*/
/* 17. АДАПТИВНОСТЬ
/*--------------------------------------------*/
@media (max-width: 992px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .content-wrapper.sidebar-left {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .site-content {
        padding: 30px 0;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: relative;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-lg);
        gap: 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
    }
    
    .nav-menu a {
        padding: 12px 0;
    }
    
    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        padding-left: 20px;
        margin-top: 0;
        display: none;
    }
    
    .nav-menu li:hover > .sub-menu {
        display: block;
    }
    
    .header-container {
        flex-wrap: wrap;
    }
    
    .site-branding {
        flex: 1;
    }
    
    .user-menu {
        margin-left: auto;
    }
    
    .content-area,
    .sidebar {
        padding: 20px;
    }
    
    .entry-title {
        font-size: 28px;
    }
    
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .sfp-quick-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 20px;
    }
    
    .site-description {
        font-size: 12px;
    }
    
    .content-area,
    .sidebar {
        padding: 15px;
    }
    
    .entry-title {
        font-size: 24px;
    }
    
    .entry-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    th,
    td {
        padding: 8px;
        font-size: 14px;
    }
    
    button,
    input[type="button"],
    input[type="submit"] {
        width: 100%;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .user-name {
        display: none;
    }
}

/*--------------------------------------------*/
/* 18. АНИМАЦИИ
/*--------------------------------------------*/
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.entry-content,
.widget,
.content-area {
    animation: fadeIn 0.5s ease-out;
}

.nav-menu a::after {
    animation: slideIn 0.3s ease-out;
}

/*--------------------------------------------*/
/* 19. ПЕЧАТЬ
/*--------------------------------------------*/
@media print {
    .site-header,
    .site-footer,
    .sidebar,
    .menu-toggle,
    .user-menu,
    .comments-area,
    .pagination {
        display: none;
    }
    
    .content-area {
        box-shadow: none;
        padding: 0;
    }
    
    body {
        background: white;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
}

/*--------------------------------------------*/
/* 20. УТИЛИТЫ
/*--------------------------------------------*/
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-0 { padding: 0; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.hidden { display: none; }
.visible { display: block; }