/**
 * Стили пользовательского кабинета WPGIS
 * 
 * @package MetallGIS\WPGIS
 * @since 1.3.0
 */

/* ================================
   ПЕРЕМЕННЫЕ
   ================================ */
:root {
    --wpgis-primary: #2563eb;
    --wpgis-success: #10b981;
    --wpgis-warning: #f59e0b;
    --wpgis-danger: #ef4444;
    
    --wpgis-bg: #ffffff;
    --wpgis-surface: #f8fafc;
    --wpgis-border: #e2e8f0;
    
    --wpgis-text: #1e293b;
    --wpgis-text-muted: #64748b;
    
    --wpgis-radius: 8px;
    --wpgis-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ================================
   ОСНОВНОЙ КОНТЕЙНЕР
   ================================ */
.wpgis-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ================================
   ПРИВЕТСТВИЕ
   ================================ */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--wpgis-primary) 0%, #1e40af 100%);
    color: white;
    padding: 30px;
    border-radius: var(--wpgis-radius);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: white;
}

.welcome-text p {
    margin: 0;
    opacity: 0.9;
}

.welcome-actions .button-primary {
    background: white;
    color: var(--wpgis-primary);
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.welcome-actions .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ================================
   ВКЛАДКИ
   ================================ */
.dashboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--wpgis-border);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--wpgis-text-muted);
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover {
    color: var(--wpgis-primary);
    background: var(--wpgis-surface);
}

.tab-btn.active {
    color: var(--wpgis-primary);
    border-bottom-color: var(--wpgis-primary);
}

/* ================================
   СТАТИСТИКА ПОЛЬЗОВАТЕЛЯ
   ================================ */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.user-stats-grid .stat-card {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--wpgis-shadow);
    transition: all 0.3s;
}

.user-stats-grid .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-stats-grid .stat-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.user-stats-grid .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--wpgis-primary);
    line-height: 1;
    margin-bottom: 5px;
}

.user-stats-grid .stat-label {
    font-size: 14px;
    color: var(--wpgis-text);
    font-weight: 500;
    margin-bottom: 3px;
}

.user-stats-grid .stat-period {
    font-size: 12px;
    color: var(--wpgis-text-muted);
}

/* ================================
   ПОСЛЕДНИЕ ДЕЙСТВИЯ
   ================================ */
.recent-activities {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    padding: 20px;
    margin-bottom: 30px;
}

.recent-activities h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: var(--wpgis-radius);
    transition: background 0.2s;
}

.activity-item:hover {
    background: var(--wpgis-surface);
}

.activity-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--wpgis-text);
    margin-bottom: 4px;
}

.activity-meta {
    font-size: 13px;
    color: var(--wpgis-text-muted);
}

.activity-actions {
    flex-shrink: 0;
}

.btn-view {
    padding: 6px 12px;
    font-size: 13px;
}

/* ================================
   ЗАПРОСЫ
   ================================ */
.requests-filters {
    background: var(--wpgis-surface);
    padding: 15px;
    border-radius: var(--wpgis-radius);
    margin-bottom: 20px;
}

.requests-filters form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.requests-filters select {
    padding: 8px 12px;
    border: 1px solid var(--wpgis-border);
    border-radius: 4px;
    background: var(--wpgis-bg);
}

.requests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.request-card {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    overflow: hidden;
    box-shadow: var(--wpgis-shadow);
    transition: all 0.3s;
}

.request-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.request-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--wpgis-surface);
    border-bottom: 1px solid var(--wpgis-border);
}

.request-type {
    font-weight: 600;
    font-size: 14px;
}

.request-date {
    font-size: 12px;
    color: var(--wpgis-text-muted);
}

.request-card .card-body {
    padding: 15px;
}

.request-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--wpgis-text);
}

.request-meta {
    font-size: 13px;
    color: var(--wpgis-text-muted);
}

.request-card .card-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--wpgis-border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.request-card .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

/* ================================
   ИЗБРАННОЕ
   ================================ */
.favorites-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--wpgis-border);
}

.favorites-tabs .tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
}

.favorites-tabs .tab-btn.active {
    border-bottom-color: var(--wpgis-primary);
    color: var(--wpgis-primary);
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.favorite-card {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    overflow: hidden;
    box-shadow: var(--wpgis-shadow);
    transition: all 0.3s;
}

.favorite-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.favorite-card .card-body {
    padding: 15px;
}

.favorite-card h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.favorite-notes input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--wpgis-border);
    border-radius: 4px;
    margin: 10px 0;
}

.favorite-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag {
    padding: 3px 10px;
    background: var(--wpgis-surface);
    border: 1px solid var(--wpgis-border);
    border-radius: 12px;
    font-size: 11px;
    color: var(--wpgis-text-muted);
}

/* ================================
   НАСТРОЙКИ
   ================================ */
.wpgis-settings-form {
    max-width: 800px;
}

.settings-section {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    padding: 25px;
    margin-bottom: 20px;
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--wpgis-border);
}

.setting-item {
    margin-bottom: 25px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--wpgis-text);
}

.setting-input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid var(--wpgis-border);
    border-radius: 4px;
    font-size: 14px;
}

.setting-description {
    font-size: 13px;
    color: var(--wpgis-text-muted);
    margin: 8px 0 0 0;
}

.theme-selector {
    display: flex;
    gap: 10px;
}

.theme-option {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.theme-option:hover {
    border-color: var(--wpgis-primary);
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-option input[type="radio"]:checked + span {
    color: var(--wpgis-primary);
    font-weight: 600;
}

.theme-option input[type="radio"]:checked ~ .theme-option {
    border-color: var(--wpgis-primary);
    background: rgba(37, 99, 235, 0.05);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.settings-actions {
    display: flex;
    gap: 10px;
    padding: 20px 0;
}

/* Опасная зона */
.danger-zone {
    border: 2px dashed var(--wpgis-danger);
    padding: 20px;
    border-radius: var(--wpgis-radius);
    background: #fef2f2;
}

.danger-zone h4 {
    color: var(--wpgis-danger);
    margin: 0 0 10px 0;
}

/* ================================
   AI-РЕКОМЕНДАЦИИ
   ================================ */
.user-ai-recommendations {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    padding: 20px;
    margin-top: 30px;
}

.user-ai-recommendations h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
}

.recommendation-card {
    background: var(--wpgis-surface);
    border-left: 4px solid var(--wpgis-primary);
    border-radius: var(--wpgis-radius);
    padding: 20px;
    margin-bottom: 15px;
}

.rec-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.rec-icon {
    font-size: 24px;
}

.rec-header h4 {
    margin: 0;
    font-size: 16px;
}

.rec-body p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: var(--wpgis-text);
}

.rec-body ul {
    margin: 10px 0;
    padding-left: 20px;
}

.rec-body li {
    margin: 5px 0;
    line-height: 1.5;
}

/* ================================
   ИСТОРИЯ
   ================================ */
.history-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid var(--wpgis-border);
    transition: background 0.2s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: var(--wpgis-surface);
}

.history-icon {
    font-size: 24px;
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.history-meta {
    font-size: 13px;
    color: var(--wpgis-text-muted);
}

/* ================================
   АДАПТИВНОСТЬ
   ================================ */
@media (max-width: 768px) {
    .dashboard-welcome {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .welcome-text h1 {
        font-size: 22px;
    }
    
    .dashboard-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .tab-btn {
        border-bottom: 1px solid var(--wpgis-border);
        border-left: 3px solid transparent;
    }
    
    .tab-btn.active {
        border-left-color: var(--wpgis-primary);
        border-bottom-color: var(--wpgis-border);
    }
    
    .user-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .requests-grid {
        grid-template-columns: 1fr;
    }
    
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-selector {
        flex-direction: column;
    }
}

/* ================================
   КОНТЕНТ
   ================================ */
.dashboard-content {
    background: var(--wpgis-bg);
    border: 1px solid var(--wpgis-border);
    border-radius: var(--wpgis-radius);
    padding: 25px;
    min-height: 300px;
}

.no-requests {
    text-align: center;
    color: var(--wpgis-text-muted);
    padding: 60px 20px;
}

/* ================================
   КНОПКИ
   ================================ */
.btn-primary {
    background: var(--wpgis-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: var(--wpgis-surface);
    color: var(--wpgis-text);
    border: 1px solid var(--wpgis-border);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--wpgis-danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ================================
   ВКЛАДКИ КОНТЕНТА
   ================================ */
.profile-tab,
.requests-tab,
.favorites-tab,
.history-tab,
.settings-tab {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

