/* Основные стили панели управления WP */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #6c757d;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
    --light: #f8f9fa;
    --dark: #212529;
    --sidebar-width: 250px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box .logo h1 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.login-box .logo p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 25px 20px;
    background: #1a252f;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 18px;
    margin: 0 0 12px 0;
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.user-info {
    font-size: 13px;
    color: #95a5a6;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.sidebar-menu li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
    transform: scaleY(0);
    transition: transform 0.3s;
}

.sidebar-menu li.active a::before {
    transform: scaleY(1);
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    padding-left: 25px;
}

.sidebar-menu li.active a {
    background: rgba(102, 126, 234, 0.15);
    border-left: 3px solid #667eea;
}

.sidebar-menu .menu-icon {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    margin-right: 12px;
    opacity: 0.8;
    transition: all 0.3s;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.sidebar-menu li.active .menu-icon {
    opacity: 1;
    filter: drop-shadow(0 0 3px rgba(102, 126, 234, 0.6));
}

.sidebar-menu li a:hover .menu-icon {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-menu .menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: #2c3e50;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-header h3 {
    font-size: 20px;
    color: #2c3e50;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin-right: 20px;
    color: #667eea;
    flex-shrink: 0;
}

.stat-content h3 {
    font-size: 32px;
    margin-bottom: 5px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table tbody td .btn {
    margin-right: 8px !important;
    margin-bottom: 5px !important;
}

.table tbody td .btn:last-child {
    margin-right: 0 !important;
}

.table tbody td form {
    display: inline-block !important;
    margin: 0 !important;
}

.table tbody td {
    vertical-align: middle;
}

/* Адаптивность для таблиц */
@media (max-width: 1200px) {
    .table tbody td:nth-child(2) {
        /* Заголовок поста - с переносом */
        max-width: 250px;
        white-space: normal;
        word-wrap: break-word;
    }
    
    .table tbody td:last-child {
        /* Колонка действий - кнопки в столбик */
        white-space: normal;
    }
    
    .table tbody td:last-child .btn {
        display: block !important;
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 5px !important;
        text-align: center;
    }
    
    .table tbody td:last-child .btn:last-child {
        margin-bottom: 0 !important;
    }
    
    .table tbody td:last-child form {
        display: block !important;
        width: 100%;
    }
    
    .table tbody td:last-child form button {
        width: 100% !important;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-icon-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #667eea;
    opacity: 0.5;
}

.empty-state h2 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Grid layouts */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-md-6 {
    flex: 0 0 50%;
    padding: 0 10px;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
    }
}

/* Sites grid */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.site-card {
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.site-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Actions grid */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.action-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
    color: #667eea;
    transition: all 0.3s;
}

.action-btn:hover .action-icon {
    color: #5568d3;
    transform: scale(1.1);
}

/* Checkbox cards */
.checkbox-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.checkbox-card:hover {
    border-color: var(--primary);
}

.checkbox-card input[type="checkbox"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
}

/* Progress */
.bulk-progress {
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.result-item {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.result-item.success {
    background: #d4edda;
}

.result-item.error {
    background: #f8d7da;
}

/* Logs info bar */
.logs-info-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.info-item {
    text-align: center;
}

.info-item strong {
    display: block;
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 20px 0;
}

.pagination a {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
}

.pagination a:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination-arrow {
    padding: 8px 15px !important;
    font-weight: 500;
}

.pagination-arrow:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.pagination-dots {
    padding: 8px 5px;
    color: #999;
    font-weight: bold;
}

.pagination-info {
    margin-left: 15px;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

/* Footer */
.main-footer {
    margin-left: var(--sidebar-width);
    padding: 20px;
    text-align: center;
    color: #666;
    border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content,
    .main-footer {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* CKEditor 5 */
.ck-editor__editable {
    min-height: 400px;
}

.ck.ck-editor__main>.ck-editor__editable {
    border: 2px solid #e0e0e0;
    border-radius: 0 0 5px 5px;
}

.ck.ck-editor__top .ck-sticky-panel .ck-toolbar {
    border: 2px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 5px 5px 0 0;
    background: #f8f9fa;
}

.ck.ck-editor {
    margin-bottom: 10px;
}

.form-group .text-muted {
    display: block;
    margin-top: 5px;
    font-size: 13px;
}

/* Utilities */
.mt-4 { margin-top: 40px; }
.text-muted { color: #666; }
.text-center { text-align: center; }

