/* Daily Radar - Основные стили */

.dailyradar-body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
}

/* Toast уведомления */
.dailyradar-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
    font-size: 14px;
}

.dailyradar-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.dailyradar-toast.toast-success {
    background: #28a745;
}

.dailyradar-toast.toast-error {
    background: #dc3545;
}

.dailyradar-toast.toast-info {
    background: #17a2b8;
}

/* Пагинация */
.dailyradar-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.dailyradar-pagination a,
.dailyradar-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    min-width: 44px;
    text-align: center;
    transition: all 0.2s;
}

.dailyradar-pagination a:hover {
    background: #f0f0f0;
    border-color: #007bff;
}

.dailyradar-pagination a.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.dailyradar-pagination .pagination-dots {
    border: none;
    padding: 8px 4px;
}

/* Автосохранение статус */
.autosave-status {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
}

/* Редактирование комментариев */
.comment-edit-form {
    margin-top: 10px;
}

.comment-edit-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.comment-edit-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.comment-edit-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-save-comment {
    background: #007bff;
    color: #fff;
}

.btn-cancel-edit-comment {
    background: #6c757d;
    color: #fff;
}

/* Ответы на комментарии */
.comment-reply-form {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.comment-reply-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.comment-reply-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.comment-actions button {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #f0f0f0;
    color: #333;
    transition: background 0.2s;
}

.comment-actions button:hover {
    background: #e0e0e0;
}

.btn-reply-comment {
    background: #e7f3ff !important;
    color: #007bff !important;
}

.comment-image-preview {
    position: relative;
    display: inline-block;
    margin-top: 8px;
}

.comment-image-preview img {
    max-width: 200px;
    border-radius: 4px;
}

.comment-image-preview .btn-remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header */
.dailyradar-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.header-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.header-user:hover {
    background: #f0f0f0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-arrow {
    font-size: 12px;
    color: #666;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

.header-user.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.user-dropdown a:hover {
    background: #f5f5f5;
}

.btn-login {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
}

.btn-create-post {
    padding: 8px 16px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    margin-right: 12px;
}

.btn-create-post:hover {
    background: #218838;
}

/* Container */
.dailyradar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.dailyradar-main {
    min-width: 0;
}

/* Tabs */
.dailyradar-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.dailyradar-tabs .tab {
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.dailyradar-tabs .tab:hover {
    color: #007bff;
}

.dailyradar-tabs .tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* Post Card */
.dailyradar-post-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.dailyradar-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.post-author a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.post-author a:hover {
    color: #007bff;
}

.post-date {
    color: #999;
    font-size: 14px;
}

.post-category {
    padding: 4px 12px;
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.dailyradar-post-card h2 {
    margin: 12px 0;
    font-size: 24px;
}

.dailyradar-post-card h2 a {
    color: #333;
    text-decoration: none;
}

.dailyradar-post-card h2 a:hover {
    color: #007bff;
}

.post-thumbnail {
    margin: 16px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.post-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-reactions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.btn-like,
.btn-dislike {
    background: #f5f5f5;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-like:hover,
.btn-dislike:hover {
    background: #e0e0e0;
}

.btn-like.active {
    background: #4caf50;
    color: #fff;
}

.btn-dislike.active {
    background: #f44336;
    color: #fff;
}

.emoji-reactions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-emoji {
    background: #f5f5f5;
    border: none;
    padding: 4px 8px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-emoji:hover {
    background: #e0e0e0;
}

.btn-add-emoji {
    background: #e0e0e0;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.post-stats {
    margin-left: auto;
    display: flex;
    gap: 16px;
    color: #999;
    font-size: 14px;
}

/* Sidebar */
.dailyradar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-block {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sidebar-block h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin-bottom: 8px;
}

.categories-list a {
    text-decoration: none;
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.categories-list a:hover {
    background: #f5f5f5;
}

.authors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.authors-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.authors-list li:last-child {
    border-bottom: none;
}

.author-rank {
    font-weight: bold;
    color: #999;
    min-width: 24px;
}

.authors-list img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.authors-list a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.authors-list a:hover {
    color: #007bff;
}

.author-rating {
    color: #999;
    font-size: 12px;
}

/* Author Page */
.dailyradar-author-header {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.author-info h1 {
    margin: 0 0 12px 0;
}

.author-stats {
    display: flex;
    gap: 20px;
    color: #666;
    margin-bottom: 16px;
}

.btn-follow {
    padding: 8px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-follow:hover {
    background: #0056b3;
}

/* Post Full */
.dailyradar-post-full {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
}

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

.post-content {
    line-height: 1.8;
    color: #333;
    margin: 24px 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Comments */
.post-comments {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.comment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.btn-upload-image {
    background: #f5f5f5;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
}

.btn-submit-comment {
    padding: 8px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

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

.comment-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.comment-date {
    color: #999;
    font-size: 12px;
}

.comment-content {
    color: #333;
    line-height: 1.6;
}

.comment-image {
    max-width: 300px;
    border-radius: 8px;
    margin-top: 12px;
}

.comment-replies {
    margin-left: 40px;
    margin-top: 16px;
}

.btn-delete-comment {
    margin-left: auto;
    background: #f44336;
    color: #fff;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

/* Editor */
.dailyradar-editor {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn-save-draft,
.btn-publish {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-save-draft {
    background: #f5f5f5;
    color: #333;
}

.btn-publish {
    background: #007bff;
    color: #fff;
}

/* Profile */
.dailyradar-profile {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
}

.profile-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.profile-tabs .tab {
    padding: 12px 20px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.profile-tabs .tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.profile-header {
    text-align: center;
    padding: 30px 0;
}

.profile-avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-avatar-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 6px;
    border: 3px solid #eef3ff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.btn-change-avatar {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-change-avatar:hover:not([disabled]) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-change-avatar[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-avatar-tip {
    font-size: 12px;
    color: #777;
    max-width: 260px;
    line-height: 1.4;
    text-align: center;
    margin-top: -4px;
}

.author-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.btn-message {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #1f4fd8;
    background: #fff;
    color: #1f4fd8;
    text-decoration: none;
    font-weight: 500;
}

.profile-basics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.profile-recent {
    margin-top: 30px;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
}

.profile-recent ul {
    margin: 0;
    padding-left: 18px;
}

.profile-recent li {
    margin-bottom: 6px;
    color: #333;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.profile-recent li span {
    color: #888;
    font-size: 13px;
}

.favorites-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.favorites-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.favorites-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.favorites-filters label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: #555;
}

.favorites-filters select {
    min-width: 160px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #d7d7d7;
}

.btn-filter {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #007bff;
    color: #fff;
    cursor: pointer;
}

.favorites-reset {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.favorite-card {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 18px;
    background: #fff;
}

.favorite-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.favorite-card-title {
    font-size: 20px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
}

.favorite-card-saved {
    display: block;
    font-size: 13px;
    color: #777;
    margin-top: 4px;
}

.favorite-card-actions {
    display: flex;
    gap: 8px;
}

.btn-go-post,
.btn-remove-favorite {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

.btn-go-post {
    background: #f0f4ff;
    color: #1f4fd8;
    text-decoration: none;
}

.btn-remove-favorite {
    background: #ffecec;
    color: #c62828;
}

.favorite-card-excerpt {
    margin: 12px 0;
    color: #444;
}

.favorite-card-meta,
.favorite-card-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #555;
}

.favorite-card-stats span {
    font-weight: 600;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.achievement-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 1px dashed #d6e0ff;
    border-radius: 12px;
    background: #fff;
    opacity: 0.6;
}

.achievement-card.unlocked {
    border-style: solid;
    background: #f2f9ff;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(31,79,216,0.08);
}

.achievement-icon {
    font-size: 28px;
}

.achievement-body strong {
    display: block;
    margin-bottom: 4px;
}

.settings-content {
    max-width: 540px;
}

.settings-notice {
    padding: 10px 14px;
    border-radius: 6px;
    background: #e8f5e9;
    color: #256029;
    margin-bottom: 15px;
}

.settings-form .form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-form input,
.settings-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d7d7d7;
    font-size: 15px;
}

.settings-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.stat {
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 24px;
    color: #007bff;
}

.stat span {
    color: #666;
    font-size: 14px;
}

/* Login Page */
.dailyradar-login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-box h1 {
    margin: 0 0 30px 0;
    text-align: center;
    color: #333;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.login-box .input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-box .checkbox {
    display: flex;
    align-items: center;
}

.login-box .checkbox label {
    margin: 0;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
}

.btn-submit:hover {
    background: #0056b3;
}

.login-links {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: space-between;
}

.login-links a {
    color: #007bff;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-otp-box {
    margin-top: 25px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #fafafa;
}

.login-otp-box h2 {
    margin-bottom: 12px;
    font-size: 20px;
}

.login-otp-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 12px;
}

.login-otp-form .btn-submit {
    width: 100%;
}

.login-otp-box p {
    color: #555;
    margin-bottom: 16px;
    line-height: 1.5;
}

.btn-telegram-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #29a9ed;
    color: #fff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-telegram-login:hover {
    background: #1990d1;
}

.login-telegram-box small {
    display: block;
    margin-top: 10px;
    color: #777;
}

.login-telegram-note {
    background: #fff7e6;
    border: 1px solid #ffe0a3;
    color: #8a6d3b;
    padding: 12px 14px;
    border-radius: 8px;
    line-height: 1.4;
}

.login-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* Responsive */
@media (max-width: 968px) {
    .dailyradar-container {
        grid-template-columns: 1fr;
    }
    
    .dailyradar-sidebar {
        order: -1;
    }
}

@media (max-width: 600px) {
    .dailyradar-tabs {
        overflow-x: auto;
    }
    
    .post-reactions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-stats {
        margin-left: 0;
    }
    
    /* Улучшения для touch-устройств */
    .btn-like, .btn-dislike, .btn-emoji, .btn-follow,
    .comment-actions button, .btn-reply-comment {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }
    
    .dailyradar-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .dailyradar-pagination {
        gap: 4px;
    }
    
    .dailyradar-pagination a {
        min-width: 40px;
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .comment-reply-form {
        padding: 8px;
    }
    
    .comment-edit-actions,
    .comment-reply-actions {
        flex-wrap: wrap;
    }
    
    .comment-actions {
        flex-direction: column;
        gap: 4px;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .header-container {
        padding: 8px 12px;
    }
    
    .logo {
        font-size: 20px;
    }
}

/* Поиск в шапке */
.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.search-form button {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.theme-toggle {
    border: none;
    background: #eff1ff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 12px;
}

.theme-toggle[aria-pressed="true"] {
    background: #1f253f;
    color: #fff8c4;
}

/* Уведомления */
.notifications-dropdown {
    position: relative;
    margin-right: 12px;
}

.notifications-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messages-indicator {
    position: relative;
    margin-right: 12px;
}

.messages-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #1f4fd8;
    text-decoration: none;
    font-size: 16px;
}

.messages-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff3b30;
    color: #fff;
    border-radius: 999px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
}

.messages-indicator.has-unread .messages-btn {
    box-shadow: 0 0 0 4px rgba(255,59,48,0.18);
}

/* Темный режим */
body.theme-dark {
    background: radial-gradient(circle at top, #1e2a48 0%, #0b111f 55%, #060913 100%);
    color: #dde3ff;
}

body.theme-dark .dailyradar-header {
    background: rgba(9, 14, 26, 0.85);
    border-bottom-color: rgba(255,255,255,0.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

body.theme-dark .search-form input {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

body.theme-dark .search-form button,
body.theme-dark .btn-primary,
body.theme-dark .btn-create-post {
    background: linear-gradient(135deg, #6a7bff, #a26bff);
    border: none;
    color: #fff;
}

body.theme-dark .theme-toggle {
    background: rgba(255,255,255,0.08);
    color: #f7f7ff;
}

body.theme-dark .dailyradar-container,
body.theme-dark .dailyradar-profile,
body.theme-dark .dailyradar-editor,
body.theme-dark .profile-content,
body.theme-dark .favorites-content {
    background: transparent;
    color: inherit;
}

body.theme-dark .dailyradar-post-card,
body.theme-dark .favorite-card,
body.theme-dark .dailyradar-profile,
body.theme-dark .profile-content,
body.theme-dark .dailyradar-sidebar .sidebar-block {
    background: rgba(14, 20, 37, 0.85);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

body.theme-dark .post-excerpt,
body.theme-dark .favorite-card-excerpt,
body.theme-dark .notifications-content,
body.theme-dark .notifications-header h3 {
    color: #cad4ff;
}

body.theme-dark .post-category,
body.theme-dark .btn-go-post,
body.theme-dark .btn-follow,
body.theme-dark .btn-message {
    background: rgba(255,255,255,0.08);
    color: #e8ecff;
    border-color: rgba(255,255,255,0.15);
}

body.theme-dark a,
body.theme-dark .profile-recent a,
body.theme-dark .notifications-link,
body.theme-dark .favorite-card-title {
    color: #8ab4ff;
}

body.theme-dark .notifications-dropdown,
body.theme-dark .messages-indicator {
    filter: drop-shadow(0 8px 18px rgba(0,0,0,0.65));
}

body.theme-dark .notifications-list,
body.theme-dark .notifications-btn,
body.theme-dark .messages-btn {
    background: rgba(22, 28, 50, 0.95);
    color: #f1f4ff;
}

body.theme-dark .dailyradar-tabs {
    border-bottom-color: rgba(255,255,255,0.08);
}

body.theme-dark .dailyradar-tabs .tab {
    color: rgba(255,255,255,0.7);
}

body.theme-dark .dailyradar-tabs .tab.active {
    color: #fdfcff;
    border-bottom-color: #8ab4ff;
}

body.theme-dark .chat-wrapper,
body.theme-dark .messages-sidebar,
body.theme-dark .messages-chat {
    background: rgba(12,18,33,0.9);
    border-color: rgba(255,255,255,0.08);
}

body.theme-dark .chat-input,
body.theme-dark .messages-search {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}

body.theme-dark .chat-message {
    background: rgba(255,255,255,0.05);
    color: #f1f4ff;
}

body.theme-dark .chat-message.owner {
    background: rgba(138,180,255,0.15);
}

body.theme-dark .profile-tabs .tab {
    color: rgba(255,255,255,0.7);
}

body.theme-dark .profile-tabs .tab.active {
    color: #ffffff;
    border-bottom-color: #8ab4ff;
}

.notifications-list {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 350px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 8px;
}

.notifications-header {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 16px;
}

.mark-all-read {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
}

.notifications-content {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: #f0f7ff;
}

.notification-content p {
    margin: 0 0 4px 0;
    font-size: 14px;
}

.notification-date {
    font-size: 12px;
    color: #666;
}

.notification-link {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
}

.notification-empty {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* Избранное */
.btn-favorite {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-favorite.active {
    background: #fff3cd;
    border-color: #ffc107;
}

.btn-favorite:hover {
    background: #e0e0e0;
}

.btn-favorite.active:hover {
    background: #ffe69c;
}

/* Адаптивное меню */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-search {
        display: none;
    }
    
    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        display: none;
    }
    
    .header-nav.mobile-open {
        display: flex;
    }
    
    .notifications-list {
        right: auto;
        left: 0;
        width: calc(100vw - 24px);
    }
}

/* Lazy loading изображений */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[data-src].loaded {
    opacity: 1;
}

/* Предпросмотр кнопка */
.btn-preview {
    background: #6c757d;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 8px;
}

.btn-preview:hover {
    background: #5a6268;
}

/* Загрузка комментариев */
.load-more-comments-wrapper {
    text-align: center;
    margin: 20px 0;
}

.btn-load-more-comments {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-load-more-comments:hover {
    background: #0056b3;
}

.btn-load-more-comments:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.dailyradar-messages {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    min-height: 60vh;
}

.messages-sidebar {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.messages-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.messages-sidebar-header h3 {
    margin: 0 0 12px;
}

.messages-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 14px;
}

.conversations-list {
    overflow-y: auto;
    flex: 1;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f7f7f7;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover,
.conversation-item.active {
    background: #f5f9ff;
}

.conversation-avatar {
    position: relative;
}

.conversation-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.conversation-info {
    flex: 1;
}

.conversation-info strong {
    display: block;
    font-size: 14px;
}

.conversation-last {
    font-size: 13px;
    color: #777;
    margin-top: 2px;
}

.conversation-unread {
    background: #ff5f5f;
    color: #fff;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
}

.messages-chat {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.chat-placeholder {
    margin: auto;
    text-align: center;
    color: #777;
}

.chat-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f5f5f5;
    align-self: flex-start;
}

.chat-message.owner {
    background: #e1f5ff;
    align-self: flex-end;
}

.chat-message img {
    max-width: 240px;
    border-radius: 10px;
    display: block;
    margin-top: 8px;
}

.chat-message time {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 6px;
}

.btn-load-older-messages {
    border: none;
    background: none;
    color: #007bff;
    padding: 12px;
    cursor: pointer;
}

.chat-form {
    border-top: 1px solid #f0f0f0;
    padding: 16px;
    background: #fafafa;
}

.chat-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 10px 12px;
    resize: none;
    font-size: 14px;
}

.chat-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-upload-message-image {
    border: none;
    background: #e9ecef;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 18px;
}

.btn-send-message {
    border: none;
    background: #007bff;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
}

.chat-image-preview {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px;
}

.chat-image-preview img {
    height: 48px;
    width: auto;
    border-radius: 6px;
}

.btn-remove-chat-image {
    position: absolute;
    top: -6px;
    right: -6px;
    border: none;
    background: #ff5f5f;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 12px;
    line-height: 18px;
}

@media (max-width: 900px) {
    .dailyradar-messages {
        grid-template-columns: 1fr;
    }
    
    .messages-sidebar {
        max-height: 220px;
    }
}

