/* Анимации для модального окна */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #e7f0ff;
    margin: 0;
    padding: 0;
    color: #283046;
}
header {
    background: #23272f;
    color: #fff;
    padding: 18px 0;
    box-shadow: 0 2px 8px rgba(40,40,60,0.08);
}
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 18px;
}
.table-wrapper {
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-top: 24px;
}
.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .header-flex h1 {
        font-size: 1.5rem;
        margin: 0;
    }
    
    .header-flex div {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    #logout-btn {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
}
main {
    padding: 38px 0;
}

/* БЛОК КОНТРОЛЕЙ: КНОПКИ + ТАБЫ */
.dashboard-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
    margin-bottom: 32px;
    margin-top: 18px;
}
@media (min-width: 900px) {
    .dashboard-controls {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        margin-bottom: 28px;
        gap: 0;
    }
}

/* Кнопки всегда слева */
.actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 16px !important;
}
.actions button {
    background: #f6f7fb;
    color: #283046;
    border: 1px solid #d1d7e6;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(44,62,80,0.06);
    transition: background 0.2s, border 0.2s, color 0.18s;
    outline: none;
    min-width: 170px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.actions button:hover,
.actions button:focus {
    background: #e2e7f1;
    border-color: #b4bad2;
}
#delete-selected-btn {
    background: #e95353 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 500;
    opacity: 0.9;
    min-width: 170px;
    min-height: 48px;
    transition: opacity 0.18s;
}
#delete-selected-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#refresh-cache-btn {
    background: #6c757d !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 500;
    min-width: 140px;
    min-height: 48px;
    transition: background 0.18s;
}
#refresh-cache-btn:hover {
    background: #5a6268 !important;
}

/* --- ФИЛЬТРЫ-Табы --- */
.dashboard-filters {
    display: flex;
    gap: 4px;
    border-radius: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    margin: 16px 0;
    justify-content: center;
    align-items: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.filter-tab {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    min-width: auto;
    text-align: center;
    user-select: none;
    position: relative;
    white-space: nowrap;
    margin: 0 2px;
}
.filter-tab.active, .filter-tab:active {
    background: #2196f3;
    color: white;
    border: none;
    box-shadow: 0 3px 12px rgba(33, 150, 243, 0.4);
    font-weight: 700;
    transform: translateY(-1px);
    position: relative;
}

.filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}
.filter-tab:not(.active):hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(148, 163, 184, 0.1);
}

@media (max-width: 900px) {
    .dashboard-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .actions {gap: 8px;}
    .actions button {padding: 12px 10px; font-size: 15px; min-width: 100px;}
    .dashboard-filters {
        margin: 12px 0;
    }
    .filter-tab {
        padding: 8px 12px;
        font-size: 14px;
    }
}
@media (max-width: 600px) {
    .dashboard-controls {flex-direction: column; gap: 10px;}
    .actions {flex-wrap: wrap;}
    .dashboard-filters {
        margin: 10px 0;
        width: 100%;
        max-width: 320px;
    }
    .filter-tab {
        padding: 8px 10px;
        font-size: 13px;
        flex: 1;
    }
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: transparent;
}
thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 2;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
    text-align: left;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    font-size: 12px;
}
tbody tr {
    transition: all 0.2s ease;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}
tbody tr:hover {
    background: #ffffff;
}
td, th {
    border: none;
    padding: 20px;
    vertical-align: middle;
}
td {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}
td.actions-cell {
    min-width: 120px;
}
.actions-flex {
    display: flex;
    gap: 10px;
    align-items: center;
}
.icon-btn {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.icon-btn:hover:not([disabled]) {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.icon-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
/* Тултипы для кнопок */
.icon-btn[title]:hover:after { display: none !important; }
.icon-btn svg { width: 18px; height: 18px; display: block; }
/* Скругления для первой и последней ячейки убраны */
tbody tr td:first-child,
tbody tr td:last-child {
    border-radius: 0;
}

th:first-child,
td:first-child {
    width: 34px;
    text-align: center;
}
.select-row, #select-all {
    accent-color: #4267B2;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* --- Новый стиль блока поста в таблице (светлый фон, миниатюры) --- */
.post-content-flex {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    background: #fcfdff;
    border-radius: 13px;
    padding: 10px 16px;
    min-height: 48px;
    box-shadow: 0 2px 10px #357ae80a;
    margin: 4px 0;
}
@media (max-width: 900px) {
    .post-content-flex {
        flex-direction: column;
        gap: 8px;
        padding: 8px 6px;
    }
}
.post-images-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 32px;
}
.post-image-preview {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: 0 1px 4px #0001;
    border: 1px solid #e3eaf3;
    margin: 0;
}
.post-preview {
    flex: 1;
    font-size: 15px;
    line-height: 1.45;
    color: #23272f;
    word-break: break-word;
    padding-top: 2px;
}
/* --- END --- */

@media (min-width: 900px) {
    td.actions-cell {
        padding-right: 32px;
    }
    td.post-cell {
        padding-left: 0;
    }
}
@media (max-width: 1000px) {
    td.post-cell {
        max-width: 260px;
        padding-right: 6px;
        padding-left: 0;
    }
    td.actions-cell {
        width: 85px;
        max-width: 95px;
        padding-right: 10px;
    }
    .actions-flex {
        min-width: 100px;
        gap: 8px;
    }
    .icon-btn {
        width: 28px;
        height: 28px;
    }
    .icon-btn svg {
        width: 16px;
        height: 16px;
    }
}

.post-more {
    color: #4267B2;
    cursor: pointer;
    font-weight: 500;
}
.post-more:hover {
    text-decoration: underline;
}

td.status span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
td.status span[data-status="done"] {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: #10b981;
}
td.status span[data-status="waiting"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
}

input[type="number"], input[type="text"], textarea {
    border: 1px solid #dbe3ee;
    background: #f7f9fa;
    border-radius: 4px;
    font-size: 16px;
    color: #283046;
    outline: none;
    padding: 6px 10px;
    transition: border 0.2s;
}
input[type="number"]:focus, input[type="text"]:focus, textarea:focus {
    border-color: #4267B2;
}

/* Базовые стили модальных окон */
#edit-modal, #post-modal, #publish-modal, #add-themes-modal, #upload-modal, #confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    font-family: var(--font-primary);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

#edit-modal > div, 
#post-modal > div, 
#add-themes-modal > div, 
#upload-modal > div, 
#confirm-modal > div {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 100% !important;
    max-width: 400px !important;
    margin: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
}
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Заголовки модальных окон */
#edit-modal h3,
#post-modal h3,
#add-themes-modal h3,
#upload-modal h3,
#confirm-modal h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

#edit-modal h3:after,
#post-modal h3:after,
#add-themes-modal h3:after,
#upload-modal h3:after,
#confirm-modal h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
}

/* Кнопки модальных окон */
#edit-modal button, 
#post-modal button, 
#add-themes-modal button, 
#upload-modal button, 
#confirm-modal button {
    font-family: inherit;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Основная кнопка */
#edit-modal button[type="submit"],
#post-modal button[type="submit"],
#add-themes-modal button[type="submit"],
#upload-modal .btn-primary,
#confirm-modal .btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#edit-modal button[type="submit"]:hover,
#post-modal button[type="submit"]:hover,
#add-themes-modal button[type="submit"]:hover,
#upload-modal .btn-primary:hover,
#confirm-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Вторичная кнопка */
#edit-modal button[type="button"],
#post-modal button[type="button"],
#add-themes-modal button[type="button"],
#upload-modal .btn-secondary,
#confirm-modal .btn-secondary {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

#edit-modal button[type="button"]:hover,
#post-modal button[type="button"]:hover,
#add-themes-modal button[type="button"]:hover,
#upload-modal .btn-secondary:hover,
#confirm-modal .btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Контейнер кнопок */
.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* Поля ввода в модальных окнах */
#edit-modal input,
#post-modal input,
#add-themes-modal input,
#upload-modal input,
#confirm-modal input,
#edit-modal textarea,
#post-modal textarea,
#add-themes-modal textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--surface-color);
    box-sizing: border-box;
}

#edit-modal input:focus,
#post-modal input:focus,
#add-themes-modal input:focus,
#upload-modal input:focus,
#confirm-modal input:focus,
#edit-modal textarea:focus,
#post-modal textarea:focus,
#add-themes-modal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#edit-modal textarea,
#post-modal textarea,
#add-themes-modal textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Чекбоксы в модальных окнах */
#add-themes-modal input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--primary-color);
}

#add-themes-modal label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin: 12px 0;
    cursor: pointer;
}

/* Адаптивность для модальных окон */
@media (max-width: 768px) {
    #edit-modal > div,
    #post-modal > div,
    #publish-modal > div,
    #add-themes-modal > div,
    #upload-modal > div,
    #confirm-modal > div {
        max-width: 400px !important;
        width: 90vw !important;
        margin: 16px;
        padding: 20px;
    }
    
    #edit-modal h3,
    #post-modal h3,
    #add-themes-modal h3,
    #upload-modal h3,
    #confirm-modal h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    #edit-modal button,
    #post-modal button,
    #add-themes-modal button,
    #upload-modal button,
    #confirm-modal button {
        width: 100%;
        justify-content: center;
    }
    
    #publish-modal > div {
        max-width: 360px !important;
        width: 90vw !important;
        margin: 16px;
        padding: 20px;
    }
    
    #publish-modal .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    #publish-modal button {
        width: 100%;
        justify-content: center;
    }
    
    #regeneration-modal .modal-content {
        width: calc(100% - 32px);
        margin: 16px;
    }
    
    #regeneration-modal .modal-body {
        padding: 20px;
    }
}

#publish-modal > div {
    background: white;
    border-radius: 12px;
    padding: 20px;
    width: 100% !important;
    max-width: 360px !important;
    margin: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#publish-modal h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

#publish-modal h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
}

/* Тип контента */
#publish-modal .type-options {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#publish-modal .type-option {
    flex: 1;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
}

#publish-modal .type-option:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#publish-modal .type-option.selected {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Соцсети */
#publish-modal .network-options {
    margin-bottom: 16px;
}

#publish-modal label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#publish-modal label:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

#publish-modal label:has(input:checked) {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

#publish-modal input[type="radio"],
#publish-modal input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Стили для контейнера выбора количества слайдов Instagram */
.slides-container {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 10px !important;
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    width: fit-content !important;
}

.slides-container[style*="display: none"] {
    display: none !important;
}

.slides-container span:first-child {
    font-size: 12px !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
}

.slide-btn {
    background: white !important;
    border: 1px solid #ccc !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333 !important;
}

.slide-btn:hover {
    background: #e9ecef !important;
    border-color: #007bff !important;
}

.slide-count {
    min-width: 20px !important;
    text-align: center !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #333 !important;
    background: white !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    border: 1px solid #ccc !important;
}

/* Кнопки */
#publish-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

#publish-modal button {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#publish-modal button.cancel {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

#publish-modal button.cancel:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

#publish-modal button.confirm {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#publish-modal button.confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#publish-modal button.confirm:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#publish-modal img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    display: block;
}

/* Прогресс публикации */
.publish-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 20px 0;
    width: 100%;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -30px;
    top: 12px;
    width: 20px;
    height: 2px;
    background: #e9ecef;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon.active {
    background: #0095f6;
    border-color: #0095f6;
    color: white;
}

.step-icon.done {
    background: #40c057;
    border-color: #40c057;
    color: white;
}

.step-label {
    font-size: 14px;
    color: #6c757d;
}

.step-label.active {
    color: #0095f6;
    font-weight: 500;
}

.step-label.done {
    color: #40c057;
    font-weight: 500;
}

::-webkit-scrollbar {
    height: 10px;
    width: 8px;
    background: #f1f4fa;
}
::-webkit-scrollbar-thumb {
    background: #dde2ed;
    border-radius: 8px;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .container {
        padding: 0 12px;
    }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: 10px 6px;
        font-size: 14px;
    }
    
    .actions button {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 120px;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 0 8px;
    }
    
    .table-wrapper {
        padding: 0;
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Скрываем некоторые колонки на мобильных */
    table th:nth-child(2), /* ID */
    table td:nth-child(2) {
        display: none;
    }
    
    table th:nth-child(7), /* Дата публикации */
    table td:nth-child(7) {
        display: none;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 13px;
    }
    
    /* Тема - делаем уже */
    th:nth-child(3),
    td:nth-child(3) {
        max-width: 120px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Пост - основная колонка */
    td.post-cell {
        max-width: 180px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Действия - компактно */
    td.actions-cell {
        min-width: 80px;
        width: 80px;
    }
    
    .actions-flex {
        gap: 2px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .icon-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 4px;
    }
    
    .icon-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Статус */
    td:nth-child(6) {
        min-width: 60px;
        text-align: center;
    }
    
    .dashboard-controls {
        gap: 12px;
    }
    
    .actions {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .actions button {
        padding: 10px 12px;
        font-size: 13px;
        min-width: 100px;
        flex: 1;
        max-width: 150px;
    }

}

/* МОБИЛЬНАЯ ВЕРСИЯ - КАРТОЧКИ */
@media (max-width: 480px) {
    .container {
        padding: 0 8px !important;
    }
    
    .table-wrapper {
        padding: 8px !important;
        border-radius: 12px !important;
    }
    
    /* ПРИНУДИТЕЛЬНО скрываем заголовки таблицы */
    table thead {
        display: none !important;
    }
    
    /* ПРИНУДИТЕЛЬНО превращаем таблицу в блоки */
    table, thead, tbody, th, td, tr {
        display: block !important;
    }
    
    /* Карточки для строк - удобные */
    tbody tr {
        background: white !important;
        border: 1px solid #e0e6ed !important;
        border-radius: 12px !important;
        margin-bottom: 14px !important;
        padding: 14px !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08) !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    tbody tr:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
        transform: translateY(-1px) !important;
        transition: all 0.2s ease !important;
    }
    
    /* Все ячейки блочные */
    tbody td {
        display: block !important;
        border: none !important;
        padding: 6px 0 !important;
        text-align: left !important;
        width: 100% !important;
        position: relative !important;
    }
    
    /* Чекбокс в правом верхнем углу */
    tbody td:nth-child(1) {
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        width: auto !important;
        padding: 0 !important;
        z-index: 10 !important;
    }
    
    /* Скрываем ID */
    tbody td:nth-child(2) {
        display: none !important;
    }
    
    /* Тема - читаемо (3-я колонка) */
    tbody td:nth-child(3) {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #2e3b4e !important;
        margin-bottom: 10px !important;
        padding-top: 0 !important;
        padding-right: 35px !important; /* Место для чекбокса */
        padding-left: 0 !important;
        line-height: 1.3 !important;
        order: 1 !important; /* Показываем первой */
    }
    
    /* Действия под темой (4-я колонка) */
    tbody td:nth-child(4) {
        margin-bottom: 10px !important;
        padding: 0 !important;
        order: 2 !important; /* Показываем второй */
    }
    
    .actions-flex {
        justify-content: flex-start !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
    }
    
    .icon-btn {
        width: 34px !important;
        height: 34px !important;
        padding: 6px !important;
        border-radius: 7px !important;
        background: #f8f9fa !important;
        border: 1px solid #e9ecef !important;
    }
    
    .icon-btn:hover {
        background: #e9ecef !important;
        transform: none !important;
    }
    
    .icon-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    /* Пост - читаемо (5-я колонка) */
    tbody td.post-cell {
        margin-bottom: 10px !important;
        padding: 10px 0 !important;
        border-top: 1px solid #f0f2f5 !important;
        border-bottom: 1px solid #f0f2f5 !important;
        order: 3 !important; /* Показываем третьей */
    }
    
    .post-content-flex {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .post-images-row {
        margin-bottom: 6px !important;
        gap: 6px !important;
        display: flex !important;
        flex-wrap: wrap !important;
    }
    
    .post-image-preview {
        width: 45px !important;
        height: 45px !important;
        border-radius: 7px !important;
    }
    
    .post-preview {
        font-size: 14px !important;
        line-height: 1.4 !important;
        color: #495057 !important;
    }
    
    /* Статус - внизу карточки (6-я колонка) */
    tbody td:nth-child(6) {
        text-align: center !important;
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        padding: 4px 0 !important;
        order: 4 !important; /* Показываем четвёртой (внизу) */
    }
    
    tbody td:nth-child(6) span {
        padding: 4px 10px !important;
        border-radius: 15px !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        display: inline-block !important;
    }
    
    /* Скрываем дату */
    tbody td:nth-child(7) {
        display: none !important;
    }
    
    /* Панель управления - красивая мобильная версия v2.0 */
    .dashboard-controls {
        flex-direction: column !important;
        gap: 15px !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
    }
    
    /* Кнопки управления - в две колонки */
    .dashboard-controls .actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        order: 2 !important;
        padding: 0 4px !important;
    }
    
    .dashboard-controls .actions button {
        padding: 14px 12px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
        transition: all 0.2s ease !important;
    }
    
    /* Стандартные цвета кнопок как в десктопе */
    .dashboard-controls .actions button:not(.special-action):not(.utility-action):not(.primary-action) {
        background: #f8f9fa !important;
        color: #495057 !important;
        border: 1px solid #dee2e6 !important;
    }
    
    /* Удаляем общий hover стиль, так как у нас есть специфичные стили для каждого типа кнопки */
    /* .dashboard-controls .actions button:hover {
        background: #e9ecef !important;
        border-color: #adb5bd !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(0,0,0,0.12) !important;
    } */
    
    .dashboard-controls .actions button:active {
        transform: translateY(0) !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
    }
    
    /* Красная кнопка удаления */
    .dashboard-controls .actions button:nth-child(3) { /* Удалить выбранные */
        background: #dc3545 !important;
        color: white !important;
        border: 1px solid #dc3545 !important;
    }
    
    .dashboard-controls .actions button:nth-child(3):hover {
        background: #c82333 !important;
        border-color: #bd2130 !important;
        transform: translateY(-1px) !important;
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3) !important;
    }
    
    /* Фильтры - компактные табы */
    .dashboard-filters {
        order: 1 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 0 !important;
        background: #f8f9fa !important;
        padding: 8px !important;
        border-radius: 12px !important;
    }

}

/* --- IMAGE CLICK PREVIEW --- */
.image-hover-preview-wrapper {
    position: relative;
    display: inline-block;
}
.image-hover-preview {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2000;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 32px #0003, 0 1.5px 4px #0001;
    border: 1px solid #e8eaf0;
    min-width: 180px;
    min-height: 120px;
    max-width: 330px;
    max-height: 220px;
    opacity: 0;
    transition: opacity 0.18s;
    overflow: hidden;
}
.image-hover-preview.open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.image-hover-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    margin: 0;
    padding: 0;
    background: #fff;
    box-shadow: none;
    max-width: 330px;
    max-height: 220px;
}

/* --- БЛОКИРОВКА УДАЛЕНИЯ И ПОЛУПРОЗРАЧНОСТЬ ДЛЯ DONE --- */
tr.row-done {
    opacity: 0.55;
    pointer-events: none;
}
tr.row-done .icon-btn:not(.delete),
tr.row-done .post-preview,
tr.row-done .post-image-preview {
    pointer-events: auto;
}

/* --- Кастомный select для выбора проекта --- */
#project-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: #fff url('data:image/svg+xml;utf8,<svg fill="%23357ae8" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat right 0.7em center/1.2em 1.2em;
  border: 1.5px solid #357ae8;
  border-radius: 8px;
  padding: 6px 2.2em 6px 14px;
  font-size: 17px;
  color: #222;
  font-weight: 500;
  box-shadow: 0 2px 8px #357ae80a;
  transition: border 0.2s, box-shadow 0.2s;
  outline: none;
  min-width: 140px;
  cursor: pointer;
}
#project-select:focus, #project-select:hover {
  border-color: #285bb5;
  box-shadow: 0 4px 16px #357ae81a;
}
.header-flex label, .header-flex span {
  font-size: 17px;
  color: #357ae8;
  font-weight: 600;
  margin-right: 8px;
  letter-spacing: 0.5px;
}
@media (max-width: 600px) {
  #project-select { min-width: 90px; font-size: 15px; }
}

/* Убираем зебра-строки полностью */
tbody tr:nth-child(even),
tbody tr:nth-child(odd) {
  background: #fff !important;
}

.header-logo {
  height: 44px;
  vertical-align: middle;
  display: inline-block;
}

/* Стили для статусов публикации */
#publish-status-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
}

#publish-status-container > div {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

#publish-status-container > div:last-child {
    border-bottom: none;
}

/* Стили для иконок статуса */
.status-icon {
    font-size: 16px;
    line-height: 1;
}

/* Цвета для разных статусов */
.status-pending {
    color: #f0ad4e;
}

.status-success {
    color: #5cb85c;
}

.status-error {
    color: #d9534f;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#login-form {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

#login-form h1, #login-form h2 {
    margin-bottom: 1rem;
}

#login-form .header-logo {
    width: 250px;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 1rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.input-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

#login-form button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    background-color: #333;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

#login-form button:hover {
    background-color: #555;
}

.error-message {
    color: red;
    margin-bottom: 1rem;
    min-height: 1em;
}

/* --- ФИЛЬТР ПО ДАТАМ --- */
.date-filter-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    border: 1px solid #e3eaf3;
}

.date-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.date-filter-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2e3b4e;
}

.date-filter-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-filter-indicator {
    display: flex;
    align-items: center;
}

.date-filter-count {
    display: flex;
    align-items: center;
}

.filter-badge {
    background: #357ae8;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

.count-badge {
    background: #6b7280;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.date-filter-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2e3b4e;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    font-size: 14px;
    color: #2e3b4e;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.date-input:focus {
    outline: none;
    border-color: #357ae8;
    box-shadow: 0 0 0 3px #357ae80a;
}

.date-filter-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.date-filter-btn {
    padding: 8px 16px;
    border: 1px solid #d1d9e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    background: #fff;
    color: #2e3b4e;
}

.date-filter-btn:hover {
    background: #f5f7fa;
    border-color: #357ae8;
}

.date-filter-btn.secondary {
    background: #f5f7fa;
    color: #6b7280;
}

.date-filter-btn.secondary:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Адаптивность для фильтра по датам */
@media (max-width: 768px) {
    .date-filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .date-filter-group {
        justify-content: space-between;
    }
    
    .date-filter-buttons {
        margin-left: 0;
        justify-content: center;
    }
    
    .date-input {
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .date-filter-container {
        padding: 12px 16px;
        margin: 12px 0;
    }
    
    .date-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    
    .date-filter-group label {
        font-size: 13px;
    }
    
    .date-input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .date-filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Мобильные карточки */
.mobile-card {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    max-width: 100% !important;
}

.mobile-card * {
    box-sizing: border-box !important;
}

/* Убираем таблицу на мобильных устройствах */
@media (max-width: 480px) {
    .mobile-card {
        border: 2px solid #e0e6ed !important;
        border-radius: 12px !important;
        background: white !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
        margin-bottom: 20px !important;
        padding: 20px !important;
        position: relative !important;
    }
    
    .mobile-card.row-done {
        background: #f8f9fa !important;
        border-color: #d1d9e6 !important;
    }
}

/* Стили для модального окна регенерации */
#regeneration-modal.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: var(--font-primary);
    animation: modalFadeIn 0.3s ease-out;
}

#regeneration-modal .modal-content {
    position: relative;
    max-width: 420px;
    width: calc(100% - 40px);
    margin: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

#regeneration-modal .modal-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#regeneration-modal .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    padding-bottom: 8px;
}

#regeneration-modal .modal-header h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 1px;
}

#regeneration-modal .modal-body {
    padding: 20px;
}

#regeneration-modal .btn {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

#regeneration-modal .btn:last-child {
    margin-bottom: 0;
}

#regeneration-modal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#regeneration-modal .btn-primary {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

#regeneration-modal .btn-primary:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

#regeneration-modal .btn-secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

#regeneration-modal .btn-secondary:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary-color);
}

#regeneration-modal .btn-success {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

#regeneration-modal .btn-success:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#regeneration-modal textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
    background: var(--surface-color);
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

#regeneration-modal textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#regeneration-modal .close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

#regeneration-modal .close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

#regeneration-modal .beta-badge {
    background: rgba(25, 118, 210, 0.1);
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.mb-3 {
    margin-bottom: 15px !important;
}

/* Стили для контейнера кнопок соцсетей */
.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-buttons {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.social-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    color: #357ae8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-btn:hover {
    background: rgba(53, 122, 232, 0.1);
    transform: translateY(-1px);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

/* Специфичные цвета для каждой соцсети */
#instagram-btn {
    color: #E4405F;
}

#facebook-btn {
    color: #1877F2;
}

#linkedin-btn {
    color: #0A66C2;
}

#telegram-btn {
    color: #26A5E4;
}

#instagram-btn:hover {
    background: rgba(228, 64, 95, 0.1);
}

#facebook-btn:hover {
    background: rgba(24, 119, 242, 0.1);
}

#linkedin-btn:hover {
    background: rgba(10, 102, 194, 0.1);
}

#telegram-btn:hover {
    background: rgba(38, 165, 228, 0.1);
}

/* Стили для кнопок панели управления */
.dashboard-controls .actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
}

/* Базовый стиль кнопок */
.dashboard-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Ripple эффект */
.dashboard-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.dashboard-button:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

/* Иконки в кнопках */
.button-icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

/* Основные действия */
.dashboard-button.primary-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 500;
}

.dashboard-button.primary-action:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.dashboard-button.primary-action:hover .button-icon {
    transform: scale(1.1);
}

/* Утилиты */
.dashboard-button.utility-action {
    background: #ffffff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.dashboard-button.utility-action:hover {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Специальные действия */
.dashboard-button.special-action {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 500;
    transition: all 0.3s ease !important;
}

.dashboard-button.special-action:hover {
    background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%) !important;
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4) !important;
}

.dashboard-button.special-action .button-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

/* Состояния кнопок */
.dashboard-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.dashboard-button:active {
    transform: scale(0.98);
}

/* Анимация ripple-эффекта */
@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 1;
    }
    20% {
        transform: scale(25, 25);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard-controls .actions {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 8px;
    }

    .dashboard-button {
        width: 100%;
        padding: 8px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .button-text {
        font-size: 12px;
    }
    
    .dashboard-button {
        padding: 8px;
        justify-content: center;
    }
}

/* Анимация для загрузки */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Состояние загрузки */
.dashboard-button.loading {
    position: relative;
    color: transparent !important;
}

.dashboard-button.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Тултипы */
.dashboard-button {
    position: relative;
}

.dashboard-button::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.dashboard-button:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 480px) {
    .dashboard-controls .actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }

    /* Stories кнопка сверху на всю ширину */
    #publish-stories-btn {
        grid-column: 1 / -1;
        order: -1;
    }

    /* Кнопки "Добавить темы" и "Создать посты" в одну строку */
    #add-themes-btn,
    #create-posts-btn {
        order: 0;
    }

    /* Кнопка удаления на всю ширину */
    #delete-selected-btn {
        grid-column: 1 / -1;
        order: 1;
    }

    /* Кнопка обновления кеша на всю ширину */
    #refresh-cache-btn {
        grid-column: 1 / -1;
        order: 2;
    }
}

/* Мобильные классы */
.mobile-layout .dashboard-controls {
    padding: 12px 8px;
    margin: 12px 0;
}

.mobile-layout .dashboard-controls .actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Stories кнопка на всю ширину сверху */
.mobile-layout #publish-stories-btn {
    grid-column: 1 / -1 !important;
    order: -1 !important;
    background: #4a8eff !important;
    color: white !important;
    font-size: 15px !important;
    padding: 12px !important;
    min-height: 52px !important;
    width: 100% !important;
}

/* Кнопки "Добавить темы" и "Создать посты" в одну строку */
.mobile-layout #add-themes-btn,
.mobile-layout #create-posts-btn {
    order: 0 !important;
    font-size: 13px !important;
    padding: 8px !important;
    min-height: 44px !important;
}

/* Кнопка удаления на всю ширину */
.mobile-layout #delete-selected-btn {
    grid-column: 1 / -1 !important;
    order: 1 !important;
    background: #e95353 !important;
    color: white !important;
    font-size: 14px !important;
    min-height: 48px !important;
    width: 100% !important;
}

/* Кнопка обновления кеша на всю ширину */
.mobile-layout #refresh-cache-btn {
    grid-column: 1 / -1 !important;
    order: 2 !important;
    font-size: 14px !important;
    min-height: 48px !important;
    width: 100% !important;
}

/* Оптимизация иконок и текста */
.mobile-layout .button-icon {
    width: 16px !important;
    height: 16px !important;
    margin-right: 6px !important;
}

.mobile-layout .button-text {
    font-size: 13px !important;
}

.stories-btn {
    background: #f0f6ff;
    color: #0095f6;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease;
}

.stories-btn:hover {
    transform: scale(1.05);
}

.stories-btn svg {
    width: 16px;
    height: 16px;
}

/* PostRadar Styles */
.post-radar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Обновляем стили для карточек, чтобы они корректно отображались под фиксированной панелью */
.post-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-card-content {
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto; /* Прижимаем кнопки к низу карточки */
}

.post-card-actions button {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.approve-btn {
    background: #28a745;
    color: white;
}

.approve-btn:hover {
    background: #218838;
}

.reject-btn {
    background: #dc3545;
    color: white;
}

.reject-btn:hover {
    background: #c82333;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .post-radar-grid {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 12px;
    }

    .post-card-content {
        padding: 12px;
    }
    
    .source-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
}

@media (max-width: 768px) {
    .actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
        width: 100%;
    }

    .actions button {
        width: 100%;
        min-width: 0;
        padding: 10px;
        font-size: 14px;
    }

    .button-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 16px !important;
}

.dashboard-button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 12px 16px !important;
}

.empty-posts-message {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    margin: 0 0 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.empty-state p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.beta-label {
    font-size: 10px;
    background: rgba(255,255,255,0.15);
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Обновленные стили PostRadar */
.post-card-header {
    margin-bottom: 8px;
}

.post-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2e3b4e;
    line-height: 1.3;
}

.source-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #bbdefb;
    margin-bottom: 12px;
    text-align: center;
    box-sizing: border-box;
}

.post-preview-container {
    margin-bottom: 12px;
}

.post-preview-text {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
}

.read-more-btn {
    background: none;
    border: none;
    color: #007bff;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.read-more-btn:hover {
    color: #0056b3;
}

/* Модальное окно для полного текста поста */
.post-text-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.post-text-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.post-text-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.post-text-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.post-text-modal-source {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.source-name {
    font-weight: 600;
    font-size: 14px;
    color: #2e3b4e;
}

.published-date {
    font-size: 12px;
    color: #6c757d;
}

.close-modal-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.close-modal-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.post-text-modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.post-title {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2e3b4e;
    line-height: 1.3;
}

.post-full-text {
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 16px;
}

.original-link {
    display: inline-block;
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: background-color 0.2s;
}

.original-link:hover {
    background: #e9ecef;
    text-decoration: none;
}

.post-text-modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.post-text-modal-actions button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-text-modal-actions .approve-btn {
    background: #28a745;
    color: white;
}

.post-text-modal-actions .approve-btn:hover {
    background: #218838;
}

.post-text-modal-actions .reject-btn {
    background: #dc3545;
    color: white;
}

.post-text-modal-actions .reject-btn:hover {
    background: #c82333;
}

.copy-text-btn {
    background: #6c757d;
    color: white;
}

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

/* Предотвращение скролла body когда открыто модальное окно */
body.modal-open {
    overflow: hidden;
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .post-text-modal {
        padding: 12px;
    }
    
    .post-text-modal-content {
        max-height: 85vh;
    }
    
    .post-text-modal-header,
    .post-text-modal-body,
    .post-text-modal-actions {
        padding: 16px;
    }
    
    .post-text-modal-actions {
        flex-direction: column;
    }
    
    .post-title {
        font-size: 18px;
    }
    
    .post-full-text {
        font-size: 14px;
    }
}

/* Стили для Stories модального окна */
.content-type-selection {
    margin-bottom: 20px;
    text-align: center;
}

.content-type-selection h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 16px;
}

.content-type-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.content-type-option {
    cursor: pointer;
    flex: 1;
    max-width: 150px;
}

.content-type-option input[type="radio"] {
    display: none;
}

.option-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
}

.content-type-option:hover .option-card {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.15);
}

.content-type-option input[type="radio"]:checked + .option-card {
    border-color: var(--primary-color);
    background: rgba(0, 149, 246, 0.05);
    box-shadow: 0 4px 12px rgba(0, 149, 246, 0.15);
}

.option-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.option-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.option-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-preview {
    margin-top: 15px;
    text-align: center;
}

.file-preview img,
.file-preview video {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
