﻿/* User Dashboard Styles */
.pc-builder-wrap .user-dashboard-container {
    width: 100%;
    max-width: 100%;
}

/* Consent Management Styles */
.consent-management-container {
    max-width: 100%;
    padding: 0;
}

.consent-management-header {
    margin-bottom: 32px;
    text-align: center;
}

.consent-management-header h2 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
}

.consent-management-header p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 1.1rem;
}

.consent-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.consent-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    border-bottom: 2px solid var(--muted);
    padding-bottom: 12px;
}

/* Age Information Grid */
.age-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.age-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.info-value {
    color: #1f2937;
    font-size: 1rem;
}

.info-value.minor {
    color: #dc2626;
    font-weight: 600;
}

.info-value.adult {
    color: #059669;
    font-weight: 600;
}

/* Consent Status Grid */
.consent-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.consent-status-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    background: color-mix(in oklab, var(--card) 88%, var(--muted));
}

.consent-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.consent-status-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.consent-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.consent-badge.granted {
    background: color-mix(in oklab, var(--chart-2) 18%, var(--card));
    color: color-mix(in oklab, var(--chart-2) 75%, var(--foreground));
    border: 1px solid color-mix(in oklab, var(--chart-2) 35%, var(--border));
}

.consent-badge.withdrawn {
    background: color-mix(in oklab, var(--destructive) 14%, var(--card));
    color: var(--destructive);
    border: 1px solid color-mix(in oklab, var(--destructive) 35%, var(--border));
}

.consent-description {
    margin: 0 0 16px 0;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    line-height: 1.5;
}

.consent-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: color-mix(in oklab, var(--card) 90%, var(--muted));
    border-radius: 6px;
    font-size: 0.875rem;
    border: 1px solid var(--border);
}

.consent-date, .consent-method {
    color: var(--muted-foreground);
}

.consent-actions {
    margin-top: 16px;
}

.consent-note {
    margin-top: 16px;
    padding: 12px;
    background: color-mix(in oklab, var(--chart-1) 14%, var(--card));
    border: 1px solid color-mix(in oklab, var(--chart-1) 35%, var(--border));
    border-radius: 6px;
    color: color-mix(in oklab, var(--chart-1) 72%, var(--foreground));
}

/* Cookie Preferences */
.cookie-preferences {
    text-align: center;
}

.cookie-preferences p {
    margin: 0 0 20px 0;
    color: var(--muted-foreground);
}

.cookie-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cookie-note {
    margin: 0;
    padding: 16px;
    background: color-mix(in oklab, var(--chart-3) 12%, var(--card));
    border: 1px solid color-mix(in oklab, var(--chart-3) 35%, var(--border));
    border-radius: 8px;
    color: color-mix(in oklab, var(--chart-3) 68%, var(--foreground));
}

/* Data Rights Grid */
.data-rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.data-right-item {
    text-align: center;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in oklab, var(--card) 88%, var(--muted));
}

.data-right-item h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.data-right-item p {
    margin: 0 0 20px 0;
    color: var(--muted-foreground);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Request Status Display */
.request-status-info {
    margin: 15px 0;
    padding: 15px;
    background: color-mix(in oklab, var(--card) 90%, var(--muted));
    border: 1px solid var(--border);
    border-radius: 8px;
}

.request-status-info p {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--foreground);
}

.request-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--card);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.request-status-item:last-child {
    margin-bottom: 0;
}

.request-date {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.days-remaining {
    color: var(--chart-2);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Status badges (data export requests) */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.status-pending {
    background: color-mix(in oklab, var(--chart-1) 16%, var(--card));
    color: color-mix(in oklab, var(--chart-1) 75%, var(--foreground));
    border: 1px solid color-mix(in oklab, var(--chart-1) 35%, var(--border));
}

.status-processing {
    background: color-mix(in oklab, var(--chart-3) 16%, var(--card));
    color: color-mix(in oklab, var(--chart-3) 75%, var(--foreground));
    border: 1px solid color-mix(in oklab, var(--chart-3) 35%, var(--border));
}

.status-completed {
    background: color-mix(in oklab, var(--chart-2) 16%, var(--card));
    color: color-mix(in oklab, var(--chart-2) 75%, var(--foreground));
    border: 1px solid color-mix(in oklab, var(--chart-2) 35%, var(--border));
}

.status-failed {
    background: color-mix(in oklab, var(--destructive) 14%, var(--card));
    color: var(--destructive);
    border: 1px solid color-mix(in oklab, var(--destructive) 35%, var(--border));
}

/* Consent management action buttons */
.consent-management-container .pc-builder-btn {
    background: var(--primary);
    color: var(--primary-foreground);
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--default-transition-duration) var(--default-transition-timing-function);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.consent-management-container .pc-builder-btn:hover {
    background: color-mix(in oklab, var(--primary) 86%, var(--foreground));
    transform: translateY(-1px);
}

.consent-management-container .pc-builder-btn.secondary {
    background: transparent;
    color: var(--primary);
    border: 1px solid color-mix(in oklab, var(--primary) 40%, var(--border));
}

.consent-management-container .pc-builder-btn.secondary:hover {
    background: color-mix(in oklab, var(--primary) 10%, var(--card));
}

.consent-management-container .pc-builder-btn.danger {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

.consent-management-container .pc-builder-btn.danger:hover {
    background: color-mix(in oklab, var(--destructive) 82%, var(--foreground));
}

.consent-management-container .pc-builder-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Privacy Contact */
.privacy-contact {
    text-align: center;
}

.privacy-contact p {
    margin: 0 0 20px 0;
    color: var(--muted-foreground);
}

.contact-info {
    display: inline-block;
    text-align: left;
    padding: 20px;
    background: color-mix(in oklab, var(--card) 90%, var(--muted));
    border-radius: 8px;
    border: 1px solid var(--border);
}

.contact-info p {
    margin: 0 0 8px 0;
    color: var(--foreground);
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info a {
    color: var(--chart-1);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .age-info-grid {
        grid-template-columns: 1fr;
    }
    
    .consent-status-grid {
        grid-template-columns: 1fr;
    }
    
    .data-rights-grid {
        grid-template-columns: 1fr;
    }
    
    .cookie-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .consent-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Deleted User Styling */
.deleted-user-avatar {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.deleted-user-avatar:hover {
    opacity: 1;
}

.deleted-user-link {
    color: #6b7280;
    font-style: italic;
    text-decoration: none;
    cursor: default;
}

.deleted-user-link:hover {
    color: #6b7280;
    text-decoration: none;
}

.user-display.deleted-user {
    opacity: 0.8;
}

.user-display.deleted-user .deleted-user-avatar {
    filter: grayscale(30%);
}

/* Completed Builds Tab Styling */
.completed-builds-overview {
    max-width: 100%;
}

.completed-builds-header {
    margin-bottom: 32px;
    text-align: center;
}

.completed-builds-header h2 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.completed-builds-header p {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 1.1rem;
}

.no-completed-builds {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

.no-completed-builds-icon {
    margin-bottom: 24px;
    color: #9ca3af;
}

.no-completed-builds h3 {
    margin: 0 0 16px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
}

.no-completed-builds p {
    margin: 0 0 24px 0;
    color: #6b7280;
    font-size: 1.1rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.completed-builds-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.completed-build-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.completed-build-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.completed-build-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.completed-build-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.completed-build-title a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.completed-build-title a:hover {
    color: #3b82f6;
}

.build-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.completed-build-status-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-published {
    background: #dcfce7;
    color: #166534;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.status-rejected {
    background: #fee2e2;
    color: #b91c1c;
}

.completed-build-description {
    margin-bottom: 12px;
    color: #4b5563;
    line-height: 1.5;
    font-size: 0.9rem;
}

.completed-build-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.build-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.completed-build-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.completed-build-actions .pc-builder-btn {
    flex: none;
    min-width: 85px;
    max-width: 120px;
    text-align: center;
    font-size: 13px;
    padding: 7px 14px;
}

.completed-build-actions .pc-builder-btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.completed-build-actions .pc-builder-btn.secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .completed-build-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .build-status {
        align-self: flex-start;
    }
    
    .completed-build-meta {
        grid-template-columns: 1fr;
    }
    
    .completed-build-actions {
        flex-direction: column;
    }
    
    .completed-build-actions .pc-builder-btn {
        flex: none;
    }
}

.user-dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    background: #f8fafc;
}

/* Left Sidebar */
.user-dashboard-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.user-dashboard-header {
    padding: 32px 24px 24px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.user-dashboard-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.user-dashboard-header p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.user-dashboard-nav {
    padding: 24px 0;
}

.dashboard-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.dashboard-nav-item:hover {
    background: #f9fafb;
    color: #1f2937;
    border-left-color: #d1d5db;
}

.dashboard-nav-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.dashboard-nav-item svg {
    flex-shrink: 0;
}

/* Right Content Area */
.user-dashboard-content {
    flex: 1;
    padding: 0;
    background: #f8fafc;
    width: 100%;
    min-width: 0;
}

.dashboard-tab-content {
    width: 100%;
    max-width: none;
    padding: 20px;
    margin: 0;
}

.dashboard-tab-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-tab-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.dashboard-tab-header p {
    margin: 0;
    font-size: 0.95rem;
    color: #6b7280;
}

.dashboard-profile-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-info-card,
.profile-actions-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-info-card h3,
.profile-actions-card h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.profile-info-grid {
    display: grid;
    gap: 16px;
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f9fafb;
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-item label {
    font-weight: 500;
    color: #6b7280;
}

.profile-info-item span {
    color: #1f2937;
    font-weight: 400;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.profile-actions .pc-builder-btn {
    min-width: 120px;
    text-align: center;
}

.dashboard-saved-builds-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dashboard-builds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-build-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.dashboard-build-item:last-child {
    margin-bottom: 0;
}

.dashboard-build-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.dashboard-build-info {
    flex: 1;
}

.dashboard-build-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.dashboard-build-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.dashboard-build-hash {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: #6b7280;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.build-hash-link {
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.build-hash-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.copy-hash-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #6b7280;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-hash-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.copy-hash-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.dashboard-build-date {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

.dashboard-build-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.dashboard-build-actions .pc-builder-btn {
    min-width: 70px;
    font-size: 13px;
    padding: 7px 14px;
}

.dashboard-empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.dashboard-empty-state h3 {
    margin: 0 0 6px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
}

.dashboard-empty-state p {
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.dashboard-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dashboard-notification-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dashboard-notification-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.dashboard-notification-item.notification-read {
    opacity: 0.7;
}

.dashboard-notification-main {
    flex: 1;
    margin-right: 12px;
}

.dashboard-notification-title {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.dashboard-notification-message {
    margin: 0;
    font-size: 0.85rem;
    color: #4b5563;
}

.dashboard-notification-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

.notification-time {
    white-space: nowrap;
}

.profile-overview {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.profile-header .profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-info h2 {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
}

.profile-email {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #6b7280;
}

.profile-username {
    margin: 0;
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.profile-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f9fafb;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-field label {
    font-weight: 500;
    color: #6b7280;
    min-width: 120px;
}

.profile-field span {
    color: #1f2937;
    font-weight: 400;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .user-dashboard-container {
        flex-direction: column;
    }

    .user-dashboard-sidebar {
        width: 100%;
        height: auto;
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .user-dashboard-nav {
        display: flex;
        overflow-x: auto;
        padding: 12px 16px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
    }

    .dashboard-nav-item {
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .dashboard-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #3b82f6;
    }

    .dashboard-tab-content {
        padding: 24px 16px;
    }

    .dashboard-tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-profile-section {
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .user-dashboard-header {
        padding: 24px 20px 20px 20px;
    }

    .user-dashboard-header h2 {
        font-size: 1.25rem;
    }

    .dashboard-tab-header h1 {
        font-size: 1.75rem;
    }

    .dashboard-build-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .dashboard-build-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .dashboard-build-hash {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .dashboard-build-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .profile-overview {
        padding: 24px 20px;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .profile-details {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .profile-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-field label {
        min-width: auto;
    }

    .profile-field span {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .profile-overview {
        padding: 20px 16px;
    }

    .profile-header .profile-avatar img {
        width: 60px;
        height: 60px;
    }

    .profile-info h2 {
        font-size: 1.5rem;
    }
}

/* Small UX improvements for long text and mobile actions */
.dashboard-build-name,
.dashboard-build-hash { word-break: break-word; }

@media (max-width: 768px) {
  .dashboard-build-actions { flex-direction: column; width: 100%; }
  .dashboard-build-actions .pc-builder-btn { width: 100%; }
}

/* =============================================================================
   USER PROFILE STYLES (Custom Profile Page)
   ============================================================================= */

.custom-profile-container {
    width: 100%;
    padding: 32px 16px;
}

.custom-profile-header {
    text-align: center;
    margin-bottom: 24px;
}

.custom-profile-header h1 {
    margin: 0 0 6px 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.custom-profile-header p {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 0 16px;
}

.profile-tab {
    padding: 16px 24px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
    top: 2px;
}

.profile-tab:hover {
    color: #1f2937;
    background: #f9fafb;
}

.profile-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    font-weight: 600;
}

.profile-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.profile-message-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.profile-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.custom-profile-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 10px;
    border-bottom: 2px solid #f3f4f6;
}

/* Profile Avatar Section */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-avatar-upload {
    flex: 1;
}

.profile-avatar-upload label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.profile-avatar-upload .file-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.profile-avatar-upload .file-name-box {
    min-width: 160px;
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.95rem;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-avatar-upload .pcp-file-btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    height: 40px;
    line-height: 20px;
}

.profile-avatar-upload .pcp-file-btn:hover { background: #2563eb; }

.profile-avatar-upload #profile-picture-upload-btn { height: 40px; padding: 10px 16px; }
.profile-avatar-upload .pcp-file-btn, .profile-avatar-upload #profile-picture-upload-btn, .profile-avatar-upload .file-name-box { align-self: stretch; display: flex; align-items: center; }

.profile-avatar-upload input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    position: relative;
    cursor: pointer;
}

.profile-avatar-upload input[type="file"]::before {
    content: 'Choose File';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: #3b82f6;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.profile-avatar-upload input[type="file"]:hover::before {
    background: #2563eb;
}

.profile-avatar-upload input[type="file"]::-webkit-file-upload-button {
    visibility: hidden;
    width: 0;
}

/* Global help text styling so it is consistent across the app */
.field-help {
    display: block;
    font-size: 0.85rem;
    color: #374151;
    line-height: 1.5;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid #fb923c;
    border-radius: 6px;
    padding: 8px 12px;
}

/* Keep existing top margin for the avatar upload help text */
.profile-avatar-upload .field-help { margin: 8px 0 0 0; }

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.form-group input:disabled {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.form-actions .pc-builder-btn {
    min-width: 120px;
    font-size: 16px;
    padding: 12px 24px;
}

.form-actions .pc-builder-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Password Form Specific Styles */
.password-form .form-group {
    margin-bottom: 16px;
}

.password-form .form-row {
    margin-bottom: 0;
}

/* Form Validation States */
.form-group input.error,
.form-group textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.success {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Password Strength Indicators */
.form-group input.strength-weak {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.strength-medium {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-group input.strength-strong {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Profile Page Responsive Design */
@media (max-width: 768px) {
    .custom-profile-container {
        padding: 24px 16px;
    }
    
    .custom-profile-header h1 {
        font-size: 2rem;
    }
    
    .profile-section {
        padding: 24px 20px;
    }
    
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Stack the file upload controls on small screens */
    .profile-avatar-upload .file-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .profile-avatar-upload .pcp-file-btn,
    .profile-avatar-upload #profile-picture-upload-btn,
    .profile-avatar-upload .file-name-box {
        width: 100%;
        align-self: stretch;
    }
    .profile-avatar-upload .file-name-box { min-width: 0; }
}

@media (max-width: 480px) {
    .custom-profile-header h1 {
        font-size: 1.75rem;
    }
    
    .profile-section {
        padding: 20px 16px;
    }
    
    .profile-avatar img {
        width: 80px;
        height: 80px;
    }
}

/* Profile containers use full width */
.profile-overview,
.dashboard-saved-builds-section,
.profile-section {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Success/Error Message Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comments Tab Styles */
.comments-overview {
    width: 100%;
}

.comments-header {
    margin-bottom: 32px;
    text-align: center;
}

.comments-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.comments-header p {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0;
}

.no-comments {
    text-align: center;
    padding: 64px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.no-comments-icon {
    margin-bottom: 24px;
    color: #9ca3af;
}

.no-comments-icon svg {
    width: 48px;
    height: 48px;
}

.no-comments h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.no-comments p {
    font-size: 1rem;
    color: #6b7280;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.comment-item:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.comment-content {
    flex: 1;
}

.comment-text {
    margin-bottom: 12px;
    line-height: 1.5;
    color: #374151;
    font-size: 0.9rem;
}

.comment-text p {
    margin: 0 0 8px 0;
}

.comment-text p:last-child {
    margin-bottom: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: #6b7280;
    flex-wrap: wrap;
}



.comment-date {
    font-weight: 500;
}

.comment-post a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.comment-post a:hover {
    text-decoration: underline;
}

.comment-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.delete-comment-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-comment-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Responsive Design for Comments */
@media (max-width: 768px) {
    .comments-header h2 {
        font-size: 1.75rem;
    }
    
    .comment-item {
        padding: 20px 16px;
    }
    
    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .comment-actions {
        justify-content: flex-start;
        margin-top: 20px;
    }
}

/* ==== Dark mode token bridge (Phase 5) ==== */
html[data-theme="dark"] .consent-management-header h2,
html[data-theme="dark"] .consent-section h3,
html[data-theme="dark"] .consent-status-header h4,
html[data-theme="dark"] .info-label,
html[data-theme="dark"] .info-value,
html[data-theme="dark"] .contact-info p,
html[data-theme="dark"] .completed-builds-header h2,
html[data-theme="dark"] .comment-post a,
html[data-theme="dark"] .comments-header h2 {
    color: var(--foreground);
}
html[data-theme="dark"] .consent-management-header p,
html[data-theme="dark"] .privacy-contact p,
html[data-theme="dark"] .deleted-user-link,
html[data-theme="dark"] .completed-builds-header p,
html[data-theme="dark"] .comment-meta {
    color: var(--muted-foreground);
}
html[data-theme="dark"] .consent-section,
html[data-theme="dark"] .consent-status-item,
html[data-theme="dark"] .contact-info,
html[data-theme="dark"] .comment-item {
    background: var(--card);
    border-color: var(--border);
    box-shadow: 0 1px 3px color-mix(in oklab, var(--foreground) 10%, transparent);
}
html[data-theme="dark"] .consent-section h3,
html[data-theme="dark"] .favorites-category-title {
    border-bottom-color: var(--muted);
}
html[data-theme="dark"] .info-value.minor {
    color: var(--destructive);
}
html[data-theme="dark"] .info-value.adult {
    color: var(--chart-2);
}
html[data-theme="dark"] .contact-info a,
html[data-theme="dark"] .comment-post a {
    color: var(--chart-1);
}
html[data-theme="dark"] .delete-comment-btn {
    background: var(--destructive);
    color: var(--destructive-foreground);
}
html[data-theme="dark"] .delete-comment-btn:hover {
    background: color-mix(in oklab, var(--destructive) 82%, var(--foreground));
}
html[data-theme="dark"] .deleted-user-link:hover {
    color: var(--muted-foreground);
}

/* Dashboard-wide dark mode alignment */
html[data-theme="dark"] .user-dashboard-container,
html[data-theme="dark"] .user-dashboard-content {
    background: var(--background);
}

html[data-theme="dark"] .user-dashboard-sidebar {
    background: var(--card);
    border-right-color: var(--border);
}

html[data-theme="dark"] .user-dashboard-nav {
    background: var(--card);
    border-bottom-color: var(--border);
}

html[data-theme="dark"] .dashboard-nav-item {
    color: var(--muted-foreground);
}

html[data-theme="dark"] .dashboard-nav-item:hover {
    background: var(--muted);
    color: var(--foreground);
    border-left-color: var(--border);
}

html[data-theme="dark"] .dashboard-nav-item.active {
    background: color-mix(in oklab, var(--primary) 16%, var(--card));
    color: var(--foreground);
    border-left-color: var(--primary);
}

html[data-theme="dark"] .dashboard-tab-header h1,
html[data-theme="dark"] .profile-info h2,
html[data-theme="dark"] .profile-section h3,
html[data-theme="dark"] .profile-actions-card h3,
html[data-theme="dark"] .dashboard-build-name,
html[data-theme="dark"] .dashboard-notification-title,
html[data-theme="dark"] .custom-profile-header h1,
html[data-theme="dark"] .profile-section h2,
html[data-theme="dark"] .comments-header h2,
html[data-theme="dark"] .no-comments h3,
html[data-theme="dark"] .dashboard-empty-state h3,
html[data-theme="dark"] .no-completed-builds h3 {
    color: var(--foreground);
}

html[data-theme="dark"] .dashboard-tab-header p,
html[data-theme="dark"] .profile-email,
html[data-theme="dark"] .profile-username,
html[data-theme="dark"] .dashboard-build-date,
html[data-theme="dark"] .dashboard-notification-message,
html[data-theme="dark"] .notification-time,
html[data-theme="dark"] .comments-header p,
html[data-theme="dark"] .no-comments p,
html[data-theme="dark"] .custom-profile-header p,
html[data-theme="dark"] .empty-state-icon {
    color: var(--muted-foreground);
}

html[data-theme="dark"] .profile-overview,
html[data-theme="dark"] .profile-info-card,
html[data-theme="dark"] .profile-actions-card,
html[data-theme="dark"] .dashboard-saved-builds-section,
html[data-theme="dark"] .dashboard-build-item,
html[data-theme="dark"] .dashboard-notification-item,
html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .no-comments,
html[data-theme="dark"] .profile-tabs,
html[data-theme="dark"] .profile-section,
html[data-theme="dark"] .profile-avatar-section,
html[data-theme="dark"] .dashboard-empty-state,
html[data-theme="dark"] .no-completed-builds,
html[data-theme="dark"] .completed-build-item,
html[data-theme="dark"] .completed-build-meta,
html[data-theme="dark"] .consent-details,
html[data-theme="dark"] .request-status-info,
html[data-theme="dark"] .request-status-item {
    background: var(--card);
    border-color: var(--border);
    color: var(--foreground);
    box-shadow: 0 1px 3px color-mix(in oklab, var(--foreground) 10%, transparent);
}

html[data-theme="dark"] .dashboard-notification-item:hover,
html[data-theme="dark"] .dashboard-build-item:hover,
html[data-theme="dark"] .comment-item:hover,
html[data-theme="dark"] .completed-build-item:hover {
    background: color-mix(in oklab, var(--card) 88%, var(--muted));
    border-color: color-mix(in oklab, var(--border) 70%, var(--foreground));
}

html[data-theme="dark"] .dashboard-build-hash {
    background: var(--muted);
    border-color: var(--border);
    color: var(--muted-foreground);
}

html[data-theme="dark"] .copy-hash-btn {
    color: var(--muted-foreground);
}

html[data-theme="dark"] .copy-hash-btn:hover {
    background: color-mix(in oklab, var(--muted) 80%, var(--foreground));
    color: var(--foreground);
}

html[data-theme="dark"] .build-hash-link,
html[data-theme="dark"] .comment-post a,
html[data-theme="dark"] .contact-info a {
    color: var(--chart-1);
}

html[data-theme="dark"] .build-hash-link:hover,
html[data-theme="dark"] .comment-post a:hover,
html[data-theme="dark"] .contact-info a:hover {
    color: color-mix(in oklab, var(--chart-1) 75%, var(--foreground));
}

html[data-theme="dark"] .profile-field label,
html[data-theme="dark"] .profile-info-item label,
html[data-theme="dark"] .meta-label,
html[data-theme="dark"] .consent-description,
html[data-theme="dark"] .consent-date,
html[data-theme="dark"] .consent-method,
html[data-theme="dark"] .request-date,
html[data-theme="dark"] .dashboard-empty-state p,
html[data-theme="dark"] .no-completed-builds p,
html[data-theme="dark"] .completed-build-description,
html[data-theme="dark"] .dashboard-notification-message,
html[data-theme="dark"] .comment-text,
html[data-theme="dark"] .comment-text p,
html[data-theme="dark"] .profile-avatar-upload label,
html[data-theme="dark"] .profile-avatar-upload .field-help {
    color: var(--muted-foreground) !important;
}

html[data-theme="dark"] .profile-field span,
html[data-theme="dark"] .profile-info-item span,
html[data-theme="dark"] .meta-value,
html[data-theme="dark"] .completed-build-title a,
html[data-theme="dark"] .completed-build-title,
html[data-theme="dark"] .dashboard-build-name,
html[data-theme="dark"] .dashboard-notification-title,
html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .comment-text strong,
html[data-theme="dark"] .profile-message,
html[data-theme="dark"] .form-group label {
    color: var(--foreground) !important;
}

html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .profile-avatar-upload .file-name-box,
html[data-theme="dark"] .profile-avatar-upload input[type="file"],
html[data-theme="dark"] .profile-avatar-upload input[type="text"],
html[data-theme="dark"] .profile-avatar-upload input[type="email"],
html[data-theme="dark"] .profile-avatar-upload input[type="date"] {
    background: var(--input-background) !important;
    border-color: var(--border) !important;
    color: var(--foreground) !important;
}

html[data-theme="dark"] .form-group input::placeholder,
html[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--muted-foreground) !important;
}

html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group textarea:focus {
    border-color: var(--chart-1) !important;
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--chart-1) 20%, transparent) !important;
}

/* Privacy & Consent ÔÇö dark mode reinforcements */
html[data-theme="dark"] .data-right-item,
html[data-theme="dark"] .cookie-note,
html[data-theme="dark"] .consent-note,
html[data-theme="dark"] .consent-status-item {
    background: color-mix(in oklab, var(--card) 88%, var(--muted)) !important;
    border-color: var(--border) !important;
}

html[data-theme="dark"] .data-right-item h4,
html[data-theme="dark"] .cookie-note strong,
html[data-theme="dark"] .consent-note strong,
html[data-theme="dark"] .request-status-info p {
    color: var(--foreground) !important;
}

html[data-theme="dark"] .data-right-item p,
html[data-theme="dark"] .cookie-note,
html[data-theme="dark"] .cookie-preferences p {
    color: var(--muted-foreground) !important;
}

html[data-theme="dark"] .consent-management-container .pc-builder-btn.secondary {
    background: transparent !important;
    color: var(--primary) !important;
    border-color: color-mix(in oklab, var(--primary) 40%, var(--border)) !important;
}

html[data-theme="dark"] .consent-management-container .pc-builder-btn.secondary:hover {
    background: color-mix(in oklab, var(--primary) 12%, var(--card)) !important;
}

html[data-theme="dark"] .consent-management-container .pc-builder-btn.danger {
    background: var(--destructive) !important;
    color: var(--destructive-foreground) !important;
}

@media (max-width: 768px) {
    .consent-section {
        padding: 18px 16px;
    }

    .data-right-item {
        padding: 18px 16px;
    }

    .cookie-note {
        padding: 14px;
        text-align: left;
    }

    .consent-management-container .pc-builder-btn,
    .consent-management-container a.pc-builder-btn {
        width: 100%;
        max-width: 320px;
    }

    .cookie-actions .pc-builder-btn {
        width: 100%;
        max-width: 320px;
    }
}
