/**
 * Learning Dashboard Styles
 * Phase 3A: Advanced Learning AI
 * Beautiful, responsive dashboard for AI learning insights
 */

/* Learning Button Navigation Integration */
.c1-learning {
    display: flex;
    flex-direction: row;
    width: 77px;
    align-items: center;
}

.c1-learning .theme-btn {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.c1-learning .theme-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.c1-learning .theme-btn:active {
    transform: translateY(0);
    background: rgba(102, 126, 234, 0.2);
}

.c1-learning .theme-btn svg {
    color: var(--icon-color, #6c757d);
    transition: color 0.3s ease;
}

.c1-learning .theme-btn:hover svg {
    color: #667eea;
}

/* Dashboard Modal & Container */
.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    padding: 20px;
    overflow-y: auto;
}

.learning-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--background-color, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Header */
.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.dashboard-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dashboard-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.dashboard-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.privacy-note {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 140px;
    padding: 16px 20px;
    border: none;
    background: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-button.active {
    background: #667eea;
    color: white;
    border-bottom: 3px solid #5a67d8;
}

/* Tab Content */
.tab-content {
    min-height: 500px;
}

.tab-panel {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease-in;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Insights Tab */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.insight-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.insight-card h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.metric-description {
    margin: 0;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recommendation-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Learning Charts */
.learning-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.chart-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.chart-container canvas {
    max-height: 250px;
}

/* Privacy Tab */
.privacy-controls {
    max-width: 600px;
}

.privacy-setting {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.privacy-setting:hover {
    background: #f1f3f4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.setting-info {
    flex: 1;
}

.setting-info strong {
    display: block;
    margin-bottom: 4px;
    color: #2d3748;
    font-weight: 600;
}

.setting-info p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
}

/* Privacy Actions */
.privacy-actions {
    display: flex;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.privacy-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
}

.privacy-info h4 {
    margin: 0 0 12px 0;
    color: #1565c0;
    font-weight: 600;
}

.privacy-info ul {
    margin: 0 0 16px 0;
    padding-left: 20px;
}

.privacy-info li {
    margin-bottom: 4px;
    color: #424242;
    font-size: 14px;
}

.privacy-info p {
    margin: 0;
    font-weight: 600;
    color: #1565c0;
    font-size: 14px;
}

/* Personalization Tab */
.personalization-controls {
    max-width: 600px;
}

.preference-group {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    padding: 24px;
}

.preference-group h4 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-weight: 600;
}

.style-options,
.response-length-options,
.emotional-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preference-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.preference-group label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.preference-group input[type="radio"] {
    margin: 0;
}

/* Analytics Tab */
.analytics-overview {
    max-width: 800px;
}

.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.metric-card h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.big-number {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.learning-progress {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.learning-progress h4 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-weight: 600;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    transition: width 0.6s ease;
    border-radius: 10px;
}

#learning-progress-text {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

.learning-insights {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
}

.learning-insights h4 {
    margin: 0 0 16px 0;
    color: #2d3748;
    font-weight: 600;
}

.insights-list {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-modal {
        padding: 10px;
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .dashboard-header h2 {
        font-size: 24px;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .learning-charts {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .analytics-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .big-number {
        font-size: 24px;
    }
    
    .privacy-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dashboard-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: auto;
        text-align: left;
    }
    
    .analytics-metrics {
        grid-template-columns: 1fr;
    }
    
    .privacy-setting {
        flex-direction: column;
        gap: 12px;
    }
    
    .toggle-switch {
        align-self: flex-start;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .learning-dashboard {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .insight-card,
    .chart-container,
    .learning-insights {
        background: #2d2d2d;
        border-color: #404040;
        color: #ffffff;
    }
    
    .insight-card h3,
    .chart-container h3,
    .learning-insights h4,
    .preference-group h4,
    .setting-info strong {
        color: #ffffff;
    }
    
    .privacy-setting,
    .preference-group,
    .learning-progress {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .privacy-info {
        background: #1e3a5f;
        border-color: #2d5a8a;
    }
    
    .privacy-info h4,
    .privacy-info p {
        color: #64b5f6;
    }
    
    .privacy-info li {
        color: #cccccc;
    }
    
    .tab-button {
        color: #aaaaaa;
    }
    
    .tab-button:hover {
        background: rgba(102, 126, 234, 0.2);
        color: #ffffff;
    }
}