/**
 * Dashboard CSS - Styles for User and Admin dashboards
 */

/* Dashboard Container */
.user-dashboard,
.admin-dashboard {
    position: fixed;
    top: 0;
    right: 0;
    width: 600px;
    max-width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #2A2A2A 0%, #222222 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Dashboard Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: var(--ct-radius, 2px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Dashboard Tabs */
.dashboard-tabs {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}

.dashboard-tabs .tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 16px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dashboard-tabs .tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

.dashboard-tabs .tab.active {
    color: var(--ct-accent, #5B4FC4);
    border-bottom-color: var(--ct-accent, #5B4FC4);
}

/* Dashboard Content */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* Upgrade Prompt */
.upgrade-prompt {
    text-align: center;
    padding: 60px 24px;
}

.upgrade-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.upgrade-prompt h3 {
    font-size: 1.25rem;
    color: #fff;
    margin: 0 0 12px 0;
}

.upgrade-prompt p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 20px 0;
}

.upgrade-prompt ul {
    text-align: left;
    display: inline-block;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
}

.upgrade-prompt li {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 0;
}

.upgrade-btn {
    background: var(--ct-accent, #5B4FC4);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: var(--ct-radius, 2px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 16px rgba(91, 79, 196, 0.35);
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    color: #fff;
    font-size: 0.9rem;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    outline: none;
    border-color: var(--ct-accent, #5B4FC4);
}

.filter-select,
.sort-select {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--ct-accent, #5B4FC4);
}

.filter-select option,
.sort-select option {
    background: #2A2A2A;
    color: #fff;
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    padding: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ct-accent, #5B4FC4);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Loading */
.loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px;
}

.loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(91, 79, 196, 0.2);
    border-top-color: var(--ct-accent, #5B4FC4);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--ct-radius, 2px);
    padding: 16px;
    color: #f87171;
    text-align: center;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #fff;
    margin: 0 0 8px 0;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Results List */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(91, 79, 196, 0.25);
}

.result-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    color: #fff;
}

.result-speaker,
.result-topic {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.result-actions .action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: var(--ct-radius, 2px);
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-actions .action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.result-actions .action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* Evolution Tab */
.evolution-tab {
    /* Placeholder - tab content uses .evolution-intro, .evolution-card styles below */
}

.evolution-intro {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 20px 0;
}

.evolution-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    padding: 20px;
    margin-bottom: 16px;
}

.evolution-card h4 {
    margin: 0 0 12px 0;
    color: #fff;
}

.evolution-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.evolution-chart-placeholder {
    background: rgba(91, 79, 196, 0.08);
    border: 1px dashed rgba(91, 79, 196, 0.25);
    border-radius: var(--ct-radius, 2px);
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Settings Tab */
.settings-tab {
    /* Placeholder - tab content uses .settings-section styles below */
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-section.danger {
    padding-top: 24px;
    border-top: 1px solid rgba(248, 113, 113, 0.2);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--ct-radius, 2px);
    margin-bottom: 12px;
}

.setting-info {
    flex: 1;
}

.setting-label {
    display: block;
    color: #fff;
    font-weight: 500;
    margin-bottom: 4px;
}

.setting-desc {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.toggle-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ct-radius, 2px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.toggle-btn.active {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

.action-btn-text {
    padding: 8px 16px;
    background: rgba(91, 79, 196, 0.15);
    border: none;
    border-radius: var(--ct-radius, 2px);
    color: var(--ct-accent, #5B4FC4);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-text:hover {
    background: rgba(91, 79, 196, 0.25);
}

.danger-btn {
    padding: 8px 16px;
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-radius: var(--ct-radius, 2px);
    color: #f87171;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.danger-btn:hover {
    background: rgba(248, 113, 113, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10003;
}

.result-detail-modal {
    background: linear-gradient(180deg, #2A2A2A 0%, #222222 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    margin: 0;
    color: #fff;
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.8);
}

.modal-body p {
    margin: 0 0 12px 0;
}

.topic-summary {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--ct-radius, 2px);
    padding: 16px;
    margin-top: 16px;
}

.result-data-placeholder {
    background: rgba(91, 79, 196, 0.08);
    border: 1px dashed rgba(91, 79, 196, 0.25);
    border-radius: var(--ct-radius, 2px);
    padding: 40px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

.export-btn {
    padding: 10px 20px;
    background: rgba(91, 79, 196, 0.15);
    border: 1px solid rgba(91, 79, 196, 0.25);
    border-radius: var(--ct-radius, 2px);
    color: var(--ct-accent, #5B4FC4);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover {
    background: rgba(91, 79, 196, 0.25);
}

.close-btn-text {
    margin-left: auto;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: var(--ct-radius, 2px);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
}

.close-btn-text:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive */
@media (max-width: 640px) {
    .user-dashboard,
    .admin-dashboard {
        width: 100%;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .search-input {
        min-width: 100%;
    }

    .result-card {
        flex-wrap: wrap;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* =========================================================================
   ENHANCED CONSENT STATUS STYLES
   ========================================================================= */

/* Consent Status Section */
.consent-status {
    border-radius: var(--ct-radius, 2px);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.4s ease;
}

.consent-status.enabled {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.consent-status.disabled {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.consent-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.consent-icon-large {
    font-size: 32px;
    line-height: 1;
}

.consent-title-block h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    color: #fff;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--ct-radius, 2px);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-badge.enabled {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.15));
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.disabled {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.status-badge.enabled .status-dot {
    background: #10B981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-badge.disabled .status-dot {
    background: #EF4444;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

.consent-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 20px 0;
}

/* Feature Status Grid */
.feature-status-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.feature-status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--ct-radius, 2px);
    transition: all 0.3s ease;
}

.feature-status-item.locked {
    opacity: 0.6;
}

.feature-status-item.unlocked {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.feature-status-item .feature-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.feature-status-item .feature-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-status-item .feature-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.feature-status-item .feature-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.feature-status-item .feature-lock {
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.feature-status-item.unlocked .feature-lock {
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    font-weight: bold;
}

.feature-status-item.locked .feature-lock {
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
}

/* Animate unlock */
.feature-status-grid.animate-unlock .feature-status-item {
    animation: featureUnlock 0.5s ease backwards;
}

@keyframes featureUnlock {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Consent Toggle Button */
.consent-toggle-btn {
    width: 100%;
    padding: 16px 24px;
    border-radius: var(--ct-radius, 2px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.consent-toggle-btn.disabled {
    background: var(--ct-accent, #5B4FC4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(91, 79, 196, 0.35);
}

.consent-toggle-btn.disabled:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 24px rgba(91, 79, 196, 0.45);
}

.consent-toggle-btn.enabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.consent-toggle-btn.enabled:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Action Button Primary */
.action-btn-text.primary {
    background: rgba(91, 79, 196, 0.15);
    border: 1px solid rgba(91, 79, 196, 0.3);
    color: var(--ct-accent, #5B4FC4);
}

.action-btn-text.primary:hover {
    background: rgba(91, 79, 196, 0.25);
}
