/* ==========================================================================
   DOKAN ИНТЕГРАЦИЯ - Стили для кабинета продавца и покупателя
   ========================================================================== */

/* ОТОБРАЖЕНИЕ АВТОРА В КАРТОЧКЕ ТОВАРА */
.product-author {
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--commonwealth-border);
    border-radius: 6px;
    font-size: 0.9em;
}

.product-author .author-label {
    color: var(--commonwealth-text-muted);
    font-weight: 600;
}

.product-author .author-link {
    color: var(--commonwealth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--commonwealth-transition);
}

.product-author .author-link:hover {
    color: var(--commonwealth-secondary);
    text-decoration: underline;
}

/* ==========================================================================
   КАСТОМНЫЙ КАБИНЕТ АВТОРА В СТИЛЕ ТЕМЫ
   ========================================================================== */

/* Контент dashboard занимает всю доступную ширину в grid layout темы */
.dashboard-content-area {
    width: 100% !important;
    max-width: 100% !important;
}

/* Убираем стандартные отступы у обертки dashboard */
.cwl-dashboard-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================================
   КАСТОМНЫЙ ДАШБОРД АВТОРА В СТИЛЕ ТЕМЫ
   ========================================================================== */

/* Кастомный дашборд автора - не конфликтует с layout темы */
.cw-author-dashboard {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Grid layout кастомного дашборда - это внутренняя структура */
.cw-dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: start;
}

/* Левая панель навигации */
.cw-dashboard-sidebar {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--commonwealth-border);
    border-radius: var(--commonwealth-radius-lg);
    padding: 30px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cw-dashboard-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--commonwealth-border);
}

.cw-dashboard-title {
    color: var(--commonwealth-primary);
    font-family: var(--commonwealth-font-display);
    font-size: 1.2rem;
    margin: 0 0 15px 0;
}

.cw-dashboard-earnings {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cw-earnings-label {
    color: var(--commonwealth-text-muted);
    font-size: 0.9rem;
}

.cw-earnings-amount {
    color: var(--commonwealth-primary);
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--commonwealth-font-display);
}

.cw-dashboard-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cw-dashboard-menu li {
    margin-bottom: 8px;
}

.cw-nav-link {
    display: block;
    padding: 12px 15px;
    color: var(--commonwealth-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--commonwealth-transition);
    border: 1px solid transparent;
}

.cw-nav-link:hover {
    background: rgba(147, 51, 234, 0.2);
    border-color: var(--commonwealth-primary);
    color: var(--commonwealth-text-primary);
}

/* Центральная область с произведениями */
.cw-dashboard-content {
    min-height: 500px;
}

.cw-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.cw-work-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--commonwealth-border);
    border-radius: var(--commonwealth-radius-lg);
    padding: 20px;
    transition: var(--commonwealth-transition);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cw-work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(147, 51, 234, 0.2);
    border-color: var(--commonwealth-primary);
}

.cw-work-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.cw-work-author-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--commonwealth-primary), var(--commonwealth-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.cw-work-author-name {
    color: var(--commonwealth-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.cw-work-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
}

.cw-work-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cw-work-info {
    margin-bottom: 15px;
}

.cw-work-title {
    color: var(--commonwealth-text-primary);
    font-family: var(--commonwealth-font-display);
    font-size: 1.1rem;
    margin: 0 0 8px 0;
}

.cw-work-year {
    color: var(--commonwealth-text-muted);
    font-size: 0.9rem;
}

.cw-work-actions {
    padding-top: 15px;
    border-top: 1px solid var(--commonwealth-border);
}

.cw-work-edit {
    color: var(--commonwealth-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--commonwealth-transition);
}

.cw-work-edit:hover {
    color: var(--commonwealth-secondary);
    text-decoration: underline;
}

.cw-empty-works {
    text-align: center;
    padding: 60px 20px;
    color: var(--commonwealth-text-muted);
}

.cw-dashboard-actions {
    text-align: center;
    margin-top: 30px;
}

.cw-btn-add {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, var(--commonwealth-primary), var(--commonwealth-secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--commonwealth-transition);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
}

.cw-btn-add:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(147, 51, 234, 0.4);
}

@media (max-width: 992px) {
    .cw-dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .cw-works-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Основной контейнер Dokan - на всю ширину */
.dokan-dashboard-wrap,
.dokan-dashboard {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Сетка Dokan - боковое меню + контент */
.dokan-dashboard-wrap {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    gap: 30px !important;
    align-items: start !important;
    width: 100% !important;
}

@media (max-width: 992px) {
    .dokan-dashboard-wrap {
        grid-template-columns: 1fr !important;
    }
}

/* Навигация дашборда Dokan - красивое оформление в стиле темы */
.dokan-dashboard-menu {
    background: rgba(26, 26, 46, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: var(--commonwealth-radius-lg) !important;
    padding: 25px 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

.dokan-dashboard-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.dokan-dashboard-menu ul li {
    margin-bottom: 10px !important;
    list-style: none !important;
}

.dokan-dashboard-menu ul li a {
    display: block !important;
    padding: 12px 15px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: 8px !important;
    color: var(--commonwealth-text-secondary) !important;
    text-decoration: none !important;
    transition: var(--commonwealth-transition) !important;
}

.dokan-dashboard-menu ul li a:hover,
.dokan-dashboard-menu ul li.active a {
    background: rgba(147, 51, 234, 0.2) !important;
    border-color: var(--commonwealth-primary) !important;
    color: var(--commonwealth-text-primary) !important;
}

/* Контент дашборда Dokan - красивое оформление в стиле темы */
.dokan-dashboard-content {
    background: rgba(26, 26, 46, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: var(--commonwealth-radius-lg) !important;
    padding: 40px !important;
    color: var(--commonwealth-text-primary) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 500px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

/* Заголовки в Dokan */
.dokan-dashboard-content h1,
.dokan-dashboard-content h2,
.dokan-dashboard-content h3,
.dokan-dashboard-content h4 {
    color: var(--commonwealth-primary) !important;
    font-family: var(--commonwealth-font-display) !important;
}

/* Таблицы Dokan */
.dokan-table,
.dokan-dashboard-content table {
    width: 100% !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.dokan-table thead th,
.dokan-dashboard-content table thead th {
    background: rgba(147, 51, 234, 0.2) !important;
    color: var(--commonwealth-primary) !important;
    padding: 12px 15px !important;
    border-bottom: 1px solid var(--commonwealth-border) !important;
}

.dokan-table tbody td,
.dokan-dashboard-content table tbody td {
    padding: 12px 15px !important;
    border-bottom: 1px solid var(--commonwealth-border) !important;
    color: var(--commonwealth-text-secondary) !important;
}

.dokan-table tbody tr:hover,
.dokan-dashboard-content table tbody tr:hover {
    background: rgba(147, 51, 234, 0.1) !important;
}

/* Кнопки Dokan */
.dokan-btn,
.dokan-btn-default,
.dokan-btn-success,
.dokan-btn-danger,
.dokan-dashboard-content .button,
.dokan-dashboard-content button {
    background: linear-gradient(135deg, var(--commonwealth-primary), var(--commonwealth-secondary)) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    transition: var(--commonwealth-transition) !important;
}

.dokan-btn:hover,
.dokan-btn-default:hover,
.dokan-dashboard-content .button:hover,
.dokan-dashboard-content button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3) !important;
}

/* Формы Dokan */
.dokan-form-group,
.dokan-dashboard-content .form-group {
    margin-bottom: 20px !important;
}

.dokan-form-control,
.dokan-dashboard-content input[type="text"],
.dokan-dashboard-content input[type="email"],
.dokan-dashboard-content input[type="password"],
.dokan-dashboard-content input[type="number"],
.dokan-dashboard-content textarea,
.dokan-dashboard-content select {
    width: 100% !important;
    padding: 10px 15px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: 8px !important;
    color: var(--commonwealth-text-primary) !important;
    transition: var(--commonwealth-transition) !important;
}

.dokan-form-control:focus,
.dokan-dashboard-content input:focus,
.dokan-dashboard-content textarea:focus,
.dokan-dashboard-content select:focus {
    border-color: var(--commonwealth-primary) !important;
    background: rgba(147, 51, 234, 0.1) !important;
    outline: none !important;
}

/* Алерты и уведомления */
.dokan-alert,
.dokan-dashboard-content .notice {
    padding: 15px 20px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    border: 1px solid !important;
}

.dokan-alert-success,
.dokan-dashboard-content .notice-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--commonwealth-accent) !important;
    color: var(--commonwealth-accent) !important;
}

.dokan-alert-danger,
.dokan-dashboard-content .notice-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--commonwealth-danger) !important;
    color: var(--commonwealth-danger) !important;
}

.dokan-alert-info,
.dokan-dashboard-content .notice-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: var(--commonwealth-secondary) !important;
    color: var(--commonwealth-secondary) !important;
}

/* Виджеты продавца */
.dokan-widget,
.dokan-dashboard-content .widget {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: var(--commonwealth-radius) !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

.dokan-widget h3,
.dokan-dashboard-content .widget h3 {
    color: var(--commonwealth-primary) !important;
    margin-top: 0 !important;
    border-bottom: 1px solid var(--commonwealth-border) !important;
    padding-bottom: 10px !important;
}

/* Статистика продавца */
.dokan-stats-box {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: 8px !important;
    padding: 20px !important;
    text-align: center !important;
}

.dokan-stats-box .title {
    color: var(--commonwealth-text-secondary) !important;
    font-size: 14px !important;
    margin-bottom: 10px !important;
}

.dokan-stats-box .value {
    color: var(--commonwealth-primary) !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    font-family: var(--commonwealth-font-display) !important;
}

/* Продукты продавца */
.dokan-product-listing {
    background: transparent !important;
}

.dokan-product-listing .product-listing-area {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--commonwealth-border) !important;
    border-radius: var(--commonwealth-radius) !important;
    padding: 20px !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .dokan-dashboard-menu {
        margin-bottom: 20px !important;
    }
    
    .dokan-dashboard-content {
        padding: 15px !important;
    }
    
    .dokan-table,
    .dokan-dashboard-content table {
        font-size: 14px !important;
    }
}

/* Переопределение цветов WooCommerce для темы */
.woocommerce-message,
.woocommerce-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-top-color: var(--commonwealth-secondary) !important;
    color: var(--commonwealth-text-primary) !important;
}

.woocommerce-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-top-color: var(--commonwealth-danger) !important;
    color: var(--commonwealth-text-primary) !important;
}

/* WooCommerce кнопки */
.woocommerce .button,
.woocommerce button.button {
    background: linear-gradient(135deg, var(--commonwealth-primary), var(--commonwealth-secondary)) !important;
    color: #fff !important;
    border: none !important;
}

.woocommerce .button:hover,
.woocommerce button.button:hover {
    background: linear-gradient(135deg, var(--commonwealth-secondary), var(--commonwealth-primary)) !important;
}

/* ==========================================================================
   КАБИНЕТ ЧИТАТЕЛЯ - Таблица покупок
   ========================================================================== */

.cw-account-shortcode {
    padding: 20px;
}

.cw-account-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--commonwealth-border);
    border-radius: var(--commonwealth-radius);
    margin-bottom: 30px;
}

.cw-account-header-avatar img {
    border-radius: 50%;
    border: 3px solid var(--commonwealth-primary);
}

.cw-account-header-info h2 {
    color: var(--commonwealth-primary);
    font-family: var(--commonwealth-font-display);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cw-section {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--commonwealth-border);
    border-radius: var(--commonwealth-radius);
    padding: 30px;
    margin-bottom: 20px;
}

.cw-section h3 {
    color: var(--commonwealth-primary);
    font-family: var(--commonwealth-font-display);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--commonwealth-border);
    padding-bottom: 10px;
}

/* Таблица покупок читателя */
.cw-purchases-table {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--commonwealth-border);
    border-radius: 8px;
    overflow: hidden;
    border-collapse: collapse;
}

.cw-purchases-table thead th {
    background: rgba(147, 51, 234, 0.2);
    color: var(--commonwealth-primary);
    padding: 15px;
    border-bottom: 2px solid var(--commonwealth-border);
    font-weight: 600;
    text-align: left;
    font-family: var(--commonwealth-font-display);
}

.cw-purchases-table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--commonwealth-border);
    color: var(--commonwealth-text-secondary);
}

.cw-purchases-table tbody tr:last-child td {
    border-bottom: none;
}

.cw-purchases-table tbody tr:hover {
    background: rgba(147, 51, 234, 0.1);
}

.cw-purchases-table .button {
    background: linear-gradient(135deg, var(--commonwealth-primary), var(--commonwealth-secondary));
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: var(--commonwealth-transition);
}

.cw-purchases-table .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.cw-purchases-table .button-small {
    padding: 6px 12px;
    font-size: 0.9em;
}

/* Адаптивность таблицы покупок */
@media (max-width: 768px) {
    .cw-account-header {
        flex-direction: column;
        text-align: center;
    }
    
    .cw-purchases-table {
        font-size: 14px;
    }
    
    .cw-purchases-table thead {
        display: none;
    }
    
    .cw-purchases-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--commonwealth-border);
        border-radius: 8px;
    }
    
    .cw-purchases-table tbody td {
        display: block;
        text-align: right;
        padding: 10px;
        border-bottom: 1px solid rgba(147, 51, 234, 0.1);
    }
    
    .cw-purchases-table tbody td:before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--commonwealth-primary);
    }
}

/* Стили для страницы админа в dashboard */
.cwl-admin-text {
    text-align: center;
    margin-bottom: 20px;
}

.cwl-admin-action {
    text-align: center;
}

/* Статусы заказов */
.order-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--commonwealth-accent);
    border: 1px solid var(--commonwealth-accent);
}

.order-status.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: var(--commonwealth-secondary);
    border: 1px solid var(--commonwealth-secondary);
}

.order-status.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--commonwealth-warning);
    border: 1px solid var(--commonwealth-warning);
}

.order-status.status-cancelled,
.order-status.status-failed,
.order-status.status-refunded {
    background: rgba(239, 68, 68, 0.2);
    color: var(--commonwealth-danger);
    border: 1px solid var(--commonwealth-danger);
}

.order-status.status-on-hold {
    background: rgba(147, 51, 234, 0.2);
    color: var(--commonwealth-primary);
    border: 1px solid var(--commonwealth-primary);
}
