/**
 * Email Domain Control - Admin Styles
 * 
 * Стили для административной панели плагина
 * 
 * @package Email_Domain_Control
 * @since 1.0.0
 */

/* ==========================================================================
   Общие стили
   ========================================================================== */

.edc-admin-wrap {
    margin-top: 20px;
}

.edc-admin-wrap h1 {
    margin-bottom: 20px;
}

/* ==========================================================================
   Вкладки
   ========================================================================== */

.nav-tab-wrapper {
    margin-bottom: 20px;
    border-bottom: 1px solid #ccd0d4;
}

.nav-tab {
    position: relative;
    display: inline-block;
    padding: 8px 15px;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #50575e;
    font-size: 14px;
    line-height: 1.71428571;
    margin-left: 0.5em;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    background-color: #f6f7f7;
    color: #135e96;
}

.nav-tab-active,
.nav-tab-active:hover {
    margin-bottom: -1px;
    color: #1d2327;
    background: #fff;
    border: 1px solid #ccd0d4;
    border-bottom-color: #fff;
}

.edc-count-badge {
    display: inline-block;
    min-width: 20px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    background-color: #d63638;
    border-radius: 10px;
    margin-left: 5px;
}

/* ==========================================================================
   Контент вкладок
   ========================================================================== */

.edc-tab-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-top: none;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* ==========================================================================
   Дисклеймер
   ========================================================================== */

.edc-disclaimer {
    margin-top: 30px;
    padding: 15px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.edc-disclaimer h3 {
    margin-top: 0;
    color: #856404;
    font-size: 16px;
}

.edc-disclaimer p {
    margin-bottom: 10px;
    color: #856404;
    line-height: 1.6;
}

.edc-disclaimer p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Секция с пользователями
   ========================================================================== */

.edc-users-section {
    position: relative;
}

.edc-users-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Панель действий */
.edc-actions-bar {
    margin: 20px 0;
    padding: 15px;
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edc-actions-bar .button {
    margin: 0;
}

.edc-actions-bar .spinner {
    float: none;
    margin: 0;
}

.edc-actions-bar .spinner.is-active {
    display: inline-block;
}

/* Таблица пользователей */
.edc-users-section table {
    margin-top: 20px;
}

.edc-users-section table th {
    font-weight: 600;
}

.edc-users-section table td {
    vertical-align: middle;
}

/* Бейджи доменов */
.edc-domain-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    font-size: 12px;
    font-family: monospace;
    color: #2271b1;
    font-weight: 500;
}

/* Статусы доменов */
.edc-status-allowed {
    display: inline-block;
    padding: 4px 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
}

.edc-status-blocked {
    display: inline-block;
    padding: 4px 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
}

/* Статистика по доменам */
.edc-domain-stats {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #dcdcde;
}

.edc-domain-stats h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.edc-domain-stats table {
    max-width: 600px;
}

/* ==========================================================================
   Секция с логами
   ========================================================================== */

.edc-logs-section {
    position: relative;
}

.edc-logs-section h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Карточки статистики */
.edc-stats-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.edc-stat-card {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    color: #fff;
    text-align: center;
}

.edc-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.edc-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.edc-stat-number {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.edc-stat-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Бейджи действий в логах */
.edc-action-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.edc-action-blocked_registration,
.edc-action-blocked_woocommerce_registration,
.edc-action-blocked_woocommerce_checkout {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.edc-action-notification_sent {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.edc-action-notification_failed {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

/* ==========================================================================
   Настройки форм
   ========================================================================== */

.form-table th {
    width: 220px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.form-table td {
    padding: 15px 10px;
    vertical-align: top;
}

.form-table fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.form-table fieldset label {
    display: block;
    margin-bottom: 10px;
    font-weight: normal;
}

.form-table fieldset label input[type="radio"],
.form-table fieldset label input[type="checkbox"] {
    margin-right: 8px;
}

.form-table .description {
    display: inline-block;
    margin-left: 5px;
    color: #646970;
    font-style: italic;
    font-size: 13px;
}

.form-table textarea.code {
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* ==========================================================================
   Уведомления
   ========================================================================== */

.notice {
    margin: 0 0 20px 0;
    padding: 12px;
}

.notice p {
    margin: 0.5em 0;
    padding: 2px;
}

.notice-success {
    border-left-color: #00a32a;
}

.notice-warning {
    border-left-color: #dba617;
}

.notice-info {
    border-left-color: #72aee6;
}

/* ==========================================================================
   Пагинация
   ========================================================================== */

.tablenav {
    margin-top: 20px;
}

.tablenav-pages {
    float: right;
}

.tablenav-pages .pagination-links {
    display: inline-block;
}

.tablenav-pages a,
.tablenav-pages span.current {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #c3c4c7;
    background: #fff;
    color: #2271b1;
}

.tablenav-pages a:hover {
    background: #f6f7f7;
    border-color: #2271b1;
}

.tablenav-pages span.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ==========================================================================
   Загрузка (Spinner)
   ========================================================================== */

.spinner {
    background: url(../../../wp-admin/images/spinner.gif) no-repeat;
    background-size: 20px 20px;
    display: none;
    float: right;
    opacity: .7;
    width: 20px;
    height: 20px;
    margin: 0;
}

@media (min-resolution: 192dpi) {
    .spinner {
        background-image: url(../../../wp-admin/images/spinner-2x.gif);
    }
}

.spinner.is-active {
    display: block;
}

/* ==========================================================================
   Адаптивность
   ========================================================================== */

@media screen and (max-width: 782px) {
    .edc-stats-cards {
        flex-direction: column;
    }
    
    .edc-stat-card {
        min-width: 100%;
    }
    
    .edc-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .edc-actions-bar .button {
        width: 100%;
        text-align: center;
    }
    
    .nav-tab {
        margin-bottom: 5px;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table th {
        border-bottom: none;
    }
}

@media screen and (max-width: 600px) {
    .wp-list-table {
        font-size: 12px;
    }
    
    .wp-list-table th,
    .wp-list-table td {
        padding: 8px 5px;
    }
    
    .edc-domain-badge,
    .edc-action-badge,
    .edc-status-allowed,
    .edc-status-blocked {
        font-size: 11px;
        padding: 3px 7px;
    }
}

/* ==========================================================================
   Анимации
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notice {
    animation: fadeIn 0.3s ease;
}

.edc-stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* ==========================================================================
   Кастомные скроллбары для textarea
   ========================================================================== */

textarea.code::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

textarea.code::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

textarea.code::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

textarea.code::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ==========================================================================
   Tooltip (опционально для будущего использования)
   ========================================================================== */

.edc-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.edc-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1d2327;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 5px;
    z-index: 1000;
}

/* ==========================================================================
   Кнопки
   ========================================================================== */

.button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.button-primary:hover,
.button-primary:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.button-primary:active {
    background: #0a4b78;
    border-color: #0a4b78;
}

/* Кнопка с иконкой */
.button .dashicons {
    margin-top: 3px;
    margin-right: 5px;
}

/* ==========================================================================
   Пустое состояние (Empty state)
   ========================================================================== */

.edc-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.edc-empty-state-icon {
    font-size: 64px;
    color: #c3c4c7;
    margin-bottom: 20px;
}

.edc-empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #1d2327;
}

.edc-empty-state p {
    color: #646970;
    font-size: 14px;
}

/* ==========================================================================
   Прогресс бар (для будущего использования)
   ========================================================================== */

.edc-progress-bar {
    width: 100%;
    height: 20px;
    background: #f0f0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.edc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}