/* =========================================
   DESIGN 2: GROCERIES APP UI (Светлый/Салатовый)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --primary: #4ADE80; /* Мягкий, свежий зеленый */
    --primary-hover: #22C55E;
    --bg-gradient: #F0FDF4; /* Очень легкий салатовый фон */
    --card-bg: #FFFFFF;
    --card-dark: #FFFFFF;
    --text-main: #334155; /* Мягкий сине-серый */
    --text-muted: #94A3B8;
    --border-color: transparent; /* Убираем жесткие границы */
    --header-bg: #FFFFFF;
    --header-text: #0F172A;
    --radius: 24px; /* Огромные скругления для App-стиля */
    --shadow-sm: 0 4px 15px rgba(74, 222, 128, 0.08);
    --shadow-md: 0 10px 25px rgba(74, 222, 128, 0.15);
    --accent-green: #F59E0B; /* Теплый оранжевый для акцентов/бейджей */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Nunito', sans-serif; 
    background: var(--bg-gradient);
    color: var(--text-main); 
    line-height: 1.6; 
    display: flex; flex-direction: column; min-height: 100vh; 
}

h1, h2, h3, h4 { font-weight: 800; line-height: 1.3; color: var(--header-text); }
a { text-decoration: none; color: var(--primary-hover); transition: 0.3s; }
a:hover { opacity: 0.7; }
ul { list-style: none; }
.icon { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.125em; fill: currentColor; }

/* Header */
.site-header { 
    background: var(--header-bg); border-bottom: none;
    box-shadow: 0 2px 20px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 1000;
}
.header-container { max-width: 1200px; margin: 0 auto; padding: 15px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--primary-hover); display: flex; align-items: center; gap: 8px; }

/* Search */
.search-wrapper { flex-grow: 1; max-width: 500px; position: relative; display: none; }
@media(min-width: 768px) { .search-wrapper { display: block; } }
.search-input { 
    width: 100%; padding: 12px 40px 12px 25px; border-radius: 50px; 
    border: none; background: #F1F5F9; outline: none; 
    font-size: 1rem; color: var(--header-text); transition: all 0.3s;
    font-weight: 600;
}
.search-input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3); }
.search-btn { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: #ffffff; border: none; border-radius: var(--radius); margin-top: 15px; box-shadow: var(--shadow-md); max-height: 350px; overflow-y: auto; display: none; padding: 10px; }
.search-results.active { display: block; }
.search-item { display: block; padding: 12px 16px; border-radius: 16px; margin-bottom: 5px; color: var(--text-main); }
.search-item:hover { background-color: #F0FDF4; }
.search-item-title { font-weight: 800; font-size: 1rem; margin-bottom: 4px; color: var(--header-text); }
.search-item-desc { font-size: 0.85rem; color: var(--text-muted); }

/* Nav Buttons */
.header-nav { display: flex; align-items: center; gap: 15px; }
.nav-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 1rem; }
.nav-btn:hover { color: var(--primary-hover); }
.btn-primary { 
    background-color: var(--primary); color: #fff; padding: 10px 24px; 
    border-radius: 50px; font-weight: 800; border: none; cursor: pointer; 
    display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(74,222,128,0.3); transition: 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); background-color: var(--primary-hover); box-shadow: 0 6px 15px rgba(34,197,94,0.4); }

/* Layout */
.layout-container { max-width: 1200px; margin: 30px auto 40px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 30px; flex-grow: 1; width: 100%; }
@media(min-width: 860px) { .layout-container { flex-direction: row; } }
.main-content { flex-grow: 1; width: 100%; }
@media(min-width: 860px) { .main-content { width: 70%; } }
.sidebar { width: 100%; display: flex; flex-direction: column; gap: 20px; }
@media(min-width: 860px) { .sidebar { width: 30%; } }

/* Sidebar Cards */
.card { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow-sm); }
.widget-title { font-size: 1.25rem; font-weight: 800; border-bottom: none; margin-bottom: 20px; color: var(--header-text); }
.stat-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-weight: 600; border-bottom: 1px dashed #E2E8F0; font-size: 1rem;}
.stat-list li:last-child { border-bottom: none; }
.stat-list li span:first-child { color: var(--text-muted); }
.stat-list li span:last-child { color: var(--header-text); background: #F1F5F9; padding: 2px 10px; border-radius: 20px; font-size: 0.9rem;}
.random-links li { margin-bottom: 12px; font-weight: 600; font-size: 1rem; }
.random-links li a { display: block; padding: 8px 12px; border-radius: 12px; transition: 0.2s;}
.random-links li a:hover { background: #F0FDF4; color: var(--primary-hover); padding-left: 16px;}

/* Index Post List */
.page-title { font-size: 2rem; margin-bottom: 25px; color: var(--header-text); padding-left: 10px;}
.post-list { display: grid; grid-template-columns: 1fr; gap: 20px; }
.post-item { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 25px; display: flex; flex-direction: column; transition: all 0.3s ease; box-shadow: var(--shadow-sm); }
.post-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.post-item-top { display: flex; gap: 18px; margin-bottom: 15px; align-items: center;}
.post-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.post-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.post-title a { color: var(--header-text); }
.post-title a:hover { color: var(--primary-hover); }
.post-desc { font-size: 1rem; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6;}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.tag { background-color: #F0FDF4; color: var(--primary-hover); font-size: 0.8rem; font-weight: 700; padding: 6px 14px; border-radius: 50px; border: none; }
.post-meta { display: flex; flex-wrap: wrap; gap: 15px; font-size: 0.9rem; color: var(--text-muted); font-weight: 700; border-top: 1px dashed #E2E8F0; padding-top: 15px; }

/* Single Post View & Messages */
.breadcrumb { font-size: 1rem; margin-bottom: 20px; font-weight: 700; padding-left: 10px;}
.breadcrumb a { background: #fff; padding: 4px 12px; border-radius: 20px; box-shadow: var(--shadow-sm); margin-right: 5px;}
.post-main-title { font-size: 2.2rem; margin-bottom: 25px; color: var(--header-text); padding-left: 10px;}
.message-block { background: var(--card-bg); border: none; border-radius: var(--radius); margin-bottom: 25px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); overflow: hidden;}
@media(min-width: 640px) { .message-block { flex-direction: row; } }
.user-panel { background: #F8FAFC; padding: 25px 20px; display: flex; flex-direction: row; align-items: center; gap: 15px; }
@media(min-width: 640px) { .user-panel { width: 170px; flex-direction: column; text-align: center; flex-shrink: 0; } }
.user-panel img { width: 75px; height: 75px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-bottom: 10px; border: 3px solid #fff;}
.user-name-side { font-weight: 800; font-size: 1.1rem; color: var(--header-text); margin-bottom: 4px; }
.user-stats { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); background: #fff; padding: 2px 10px; border-radius: 20px;}
.message-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 20px; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px dashed #E2E8F0; padding-bottom: 15px;}
.message-date { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
.message-text { font-size: 1.05rem; line-height: 1.8; color: var(--text-main); font-weight: 600;}
.badge { background: var(--accent-green); color: #fff; font-size: 0.75rem; padding: 4px 12px; border-radius: 50px; font-weight: 800; }
.reply-badge { font-size: 0.85rem; background: #FEF3C7; color: #D97706; padding: 6px 14px; border-radius: 50px; margin-bottom: 15px; display: inline-flex; font-weight: 800; }
.message-block.op-post { box-shadow: 0 10px 30px rgba(74, 222, 128, 0.2); border: 2px solid #DCFCE7;}

.comments-header { font-size: 1.6rem; font-weight: 800; margin: 40px 0 20px 10px; color: var(--header-text); }
.cta-box { background: linear-gradient(135deg, #4ADE80 0%, #22C55E 100%); border: none; border-radius: 30px; padding: 40px 30px; text-align: center; margin-top: 40px; box-shadow: var(--shadow-md); color: #fff;}
.cta-title { font-size: 1.6rem; margin-bottom: 10px; color: #fff; font-weight: 800;}
.cta-text { font-size: 1.1rem; color: rgba(255,255,255,0.9); margin-bottom: 20px; font-weight: 600;}

/* Pagination & Footer */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 50px; }
.page-link { padding: 10px 18px; border: none; background: #fff; color: var(--text-main); border-radius: 50px; font-weight: 800; box-shadow: var(--shadow-sm); transition: 0.3s; }
.page-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--primary-hover); }
.page-link.active { background: var(--primary); color: #fff; }
.site-footer { background: #ffffff; border-top: none; box-shadow: 0 -5px 20px rgba(0,0,0,0.02); padding: 60px 20px; margin-top: auto; border-radius: 40px 40px 0 0;}
.footer-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 40px; }
@media(min-width: 768px) { .footer-container { grid-template-columns: repeat(3, 1fr); } }
.footer-title { color: var(--header-text); font-size: 1.3rem; margin-bottom: 20px; font-weight: 800; }
.footer-text { line-height: 1.8; font-weight: 600;}