/**
 * MemberSphere Frontend Styles
 *
 * @package MemberSphere
 */

/* ==========================================================================
   WordPress Error-Page Style Reset
   Override WP's inline wp_die() body styles that restrict max-width to 700px.
   These apply when WordPress injects its error-page CSS (e.g. via auth_redirect).
   ========================================================================== */
body.ms-plugin-active,
body.ms-user-logged-in,
body.ms-logged-in {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    background: var(--wp--preset--color--background, #f0f0f1) !important;
}

body.ms-plugin-active #error-page,
body.ms-user-logged-in #error-page,
body.ms-logged-in #error-page {
    margin-top: 0 !important;
    max-width: none !important;
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    /* Primary Color Palette - These can be overridden by design settings */
    --ms-primary: #2563eb;
    --ms-primary-hover: #1d4ed8;
    --ms-primary-light: #dbeafe;
    --ms-primary-50: #eff6ff;
    --ms-primary-100: #dbeafe;
    --ms-primary-200: #bfdbfe;
    --ms-primary-300: #93c5fd;
    --ms-primary-400: #60a5fa;
    --ms-primary-500: #2563eb;
    --ms-primary-600: #1d4ed8;
    --ms-primary-700: #1e40af;
    --ms-primary-800: #1e3a8a;
    --ms-primary-900: #1e3a5f;
    --ms-primary-rgb: 37, 99, 235;
    
    /* Status Colors */
    --ms-success: #059669;
    --ms-success-light: #d1fae5;
    --ms-warning: #d97706;
    --ms-warning-light: #fef3c7;
    --ms-error: #dc2626;
    --ms-error-light: #fee2e2;
    --ms-gray-50: #f9fafb;
    --ms-gray-100: #f3f4f6;
    --ms-gray-200: #e5e7eb;
    --ms-gray-300: #d1d5db;
    --ms-gray-400: #9ca3af;
    --ms-gray-500: #6b7280;
    --ms-gray-600: #4b5563;
    --ms-gray-700: #374151;
    --ms-gray-800: #1f2937;
    --ms-gray-900: #111827;
    --ms-border-radius: 8px;
    --ms-border-radius-sm: 4px;
    --ms-border-radius-lg: 12px;
    --ms-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --ms-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ms-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --ms-transition: all 0.2s ease;
}

/* ==========================================================================
   Form Container
   ========================================================================== */
.ms-form-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow-lg);
}

.ms-form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ms-form-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ms-gray-900);
}

.ms-form-header p {
    margin: 0;
    color: var(--ms-gray-500);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */
.ms-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ms-form-group {
    display: flex;
    flex-direction: column;
}

.ms-form-row {
    display: grid;
    gap: 1rem;
}

.ms-form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.ms-form-row-inline {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 480px) {
    .ms-form-row-2 {
        grid-template-columns: 1fr;
    }
}

.ms-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ms-gray-700);
}

.ms-required {
    color: var(--ms-error);
}

.ms-input,
.ms-textarea,
.ms-select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 1.25rem !important;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ms-gray-900);
    background-color: #fff;
    border: 1px solid var(--ms-gray-300);
    border-radius: var(--ms-border-radius);
    transition: var(--ms-transition);
    box-sizing: border-box;
    height: 44px;
}

.ms-input:focus,
.ms-textarea:focus,
.ms-select:focus {
    outline: none;
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px var(--ms-primary-light);
}

.ms-input::placeholder,
.ms-textarea::placeholder {
    color: var(--ms-gray-400);
}

.ms-textarea {
    resize: vertical;
    min-height: 100px;
    height: auto !important;
}

.ms-has-error .ms-input,
.ms-has-error .ms-textarea {
    border-color: var(--ms-error);
}

.ms-has-error .ms-input:focus,
.ms-has-error .ms-textarea:focus {
    box-shadow: 0 0 0 3px var(--ms-error-light);
}

.ms-error-message {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: var(--ms-error);
}

.ms-help-text {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--ms-gray-500);
}

/* ==========================================================================
   Checkbox
   ========================================================================== */
.ms-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--ms-gray-600);
}

.ms-checkbox input {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    accent-color: var(--ms-primary);
}

.ms-forgot-link {
    font-size: 0.875rem;
    color: var(--ms-primary);
    text-decoration: none;
}

.ms-forgot-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-btn-primary {
    color: #fff;
    background-color: var(--ms-primary);
    border-color: var(--ms-primary);
}

.ms-btn-primary:hover {
    background-color: var(--ms-primary-hover);
    border-color: var(--ms-primary-hover);
}

.ms-btn-outline {
    color: var(--ms-gray-700);
    background-color: transparent;
    border-color: var(--ms-gray-300);
}

.ms-btn-outline:hover {
    background-color: var(--ms-gray-100);
    border-color: var(--ms-gray-400);
}

.ms-btn-block {
    width: 100%;
}

.ms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.ms-notice {
    padding: 1rem;
    border-radius: var(--ms-border-radius);
    margin-bottom: 1rem;
}

.ms-notice h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.ms-notice p {
    margin: 0 0 0.5rem;
}

.ms-notice p:last-child {
    margin-bottom: 0;
}

.ms-notice-success {
    background-color: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-notice-error {
    background-color: var(--ms-error-light);
    color: var(--ms-error);
}

.ms-notice-warning {
    background-color: var(--ms-warning-light);
    color: var(--ms-warning);
}

/* ==========================================================================
   Form Footer
   ========================================================================== */
.ms-form-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--ms-gray-200);
}

.ms-form-footer p {
    margin: 0;
    color: var(--ms-gray-600);
    font-size: 0.875rem;
}

.ms-form-footer a {
    color: var(--ms-primary);
    text-decoration: none;
}

.ms-form-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.ms-dashboard {
    max-width: 100%;
    margin: 0;
    padding: 1.5rem 0;
}

.ms-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--ms-content-bg, #fff);
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow);
    margin-bottom: 1.5rem;
}

.ms-dashboard-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ms-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.ms-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-welcome-text h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ms-gray-900);
}

.ms-member-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.ms-status-badge,
.ms-role-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--ms-border-radius-sm);
}

.ms-status-badge {
    background-color: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-status-active {
    background-color: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-status-pending {
    background-color: var(--ms-warning-light);
    color: var(--ms-warning);
}

.ms-status-suspended {
    background-color: var(--ms-error-light);
    color: var(--ms-error);
}

.ms-role-badge {
    background: linear-gradient(135deg, var(--ms-primary-400, #60a5fa), var(--ms-primary-600, #1d4ed8));
    color: #fff;
}

@media (max-width: 600px) {
    .ms-dashboard-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ms-dashboard-welcome {
        flex-direction: column;
    }
}

/* ==========================================================================
   Dashboard Navigation
   ========================================================================== */
.ms-dashboard-nav {
    background: var(--ms-content-bg, #fff);
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ms-nav-tabs {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ms-gray-600);
    cursor: pointer;
    transition: var(--ms-transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ms-nav-item:hover {
    color: var(--ms-gray-900);
    background-color: var(--ms-gray-50);
}

.ms-nav-item.active {
    color: var(--ms-primary);
    border-bottom-color: var(--ms-primary);
}

.ms-nav-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

@media (max-width: 600px) {
    .ms-nav-tabs {
        flex-wrap: wrap;
    }

    .ms-nav-item {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

/* ==========================================================================
   Dashboard Content
   ========================================================================== */
.ms-dashboard-content {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ms-tab-content {
    display: none;
}

.ms-tab-content.active {
    display: block;
}

/* ==========================================================================
   Dashboard Module System
   ========================================================================== */
.ms-dashboard-module {
    position: relative;
}

.ms-dashboard-module.ms-module-hidden {
    display: none !important;
}

.ms-dashboard-module.ms-module-dragging {
    opacity: 0.5;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.ms-dashboard-module.ms-module-drag-over {
    border: 2px dashed var(--ms-primary);
}

/* Module Controls */
.ms-module-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    background: #fff;
    border-radius: var(--ms-border-radius);
    padding: 0.25rem;
    box-shadow: var(--ms-shadow-md);
}

.ms-dashboard-module:hover .ms-module-controls,
.ms-module-controls:focus-within {
    opacity: 1;
    visibility: visible;
}

.ms-module-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--ms-gray-500);
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-module-control:hover {
    background: var(--ms-primary-50);
    color: var(--ms-primary);
}

.ms-module-control:active {
    transform: scale(0.95);
}

.ms-module-control .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-module-control.ms-module-drag {
    cursor: grab;
}

.ms-module-control.ms-module-drag:active {
    cursor: grabbing;
}

.ms-module-control.ms-module-hide:hover {
    background: var(--ms-error-light);
    color: var(--ms-error);
}

/* Restore Hidden Modules Button */
.ms-restore-modules-container {
    margin-top: 1.5rem;
    text-align: center;
}

.ms-restore-modules-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--ms-primary-50);
    border: 2px dashed var(--ms-primary-300);
    border-radius: var(--ms-border-radius);
    color: var(--ms-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-restore-modules-btn:hover {
    background: var(--ms-primary-100);
    border-color: var(--ms-primary);
}

.ms-restore-modules-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Hidden Modules Dropdown */
.ms-hidden-modules-dropdown {
    position: relative;
    display: inline-block;
}

.ms-hidden-modules-list {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ms-content-bg, #fff);
    border-radius: var(--ms-border-radius);
    box-shadow: var(--ms-shadow-lg);
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    min-width: 200px;
    display: none;
    z-index: 200;
}

.ms-hidden-modules-dropdown.active .ms-hidden-modules-list {
    display: block;
}

.ms-hidden-module-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-hidden-module-item:hover {
    background: var(--ms-primary-50);
}

.ms-hidden-module-item span {
    font-size: 0.875rem;
    color: var(--ms-gray-700);
}

.ms-hidden-module-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-primary);
}

/* ==========================================================================
   Dashboard Stats Box (separate box for overview stats)
   ========================================================================== */
.ms-dashboard-stats-box {
    background: var(--ms-content-bg, #fff);
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.ms-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.ms-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    border: 1px solid var(--ms-gray-200);
}

.ms-stat-card.ms-stat-card-link {
    padding: 0;
}

.ms-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--ms-primary-400, #60a5fa), var(--ms-primary-600, #1d4ed8));
    border-radius: var(--ms-border-radius);
    position: relative;
}

.ms-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #fff;
}

.ms-stat-info {
    display: flex;
    flex-direction: column;
}

.ms-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-gray-900);
    line-height: 1;
}

.ms-stat-label {
    font-size: 0.75rem;
    color: var(--ms-gray-500);
    margin-top: 0.25rem;
}

/* Forum/Chat Link Cards */
.ms-stat-card-link:hover {
    border-color: var(--ms-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ms-stat-card-link .ms-stat-card-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.ms-stat-card-link .ms-stat-icon {
    background: linear-gradient(135deg, var(--ms-primary-400, #60a5fa), var(--ms-primary-600, #1d4ed8));
}

.ms-stat-card-link .ms-stat-icon .dashicons {
    color: #fff;
}

.ms-stat-card-link .ms-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ms-gray-900);
    margin: 0;
}

.ms-stat-card-link .ms-stat-action {
    font-size: 0.75rem;
    color: var(--ms-primary);
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .ms-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Dashboard Sections
   ========================================================================== */
.ms-dashboard-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ms-gray-200);
}

.ms-dashboard-section h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-gray-900);
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.ms-empty-state {
    text-align: center;
    padding: 2rem;
}

.ms-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--ms-gray-300);
}

.ms-empty-state h3 {
    margin: 1rem 0 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ms-gray-900);
}

.ms-empty-state p {
    margin: 0 0 1rem;
    color: var(--ms-gray-500);
}

/* ==========================================================================
   Activity List (Frontend Dashboard)
   ========================================================================== */
.ms-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ms-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ms-gray-100);
}

.ms-activity-item:last-child {
    border-bottom: none;
}

.ms-activity-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-primary-light);
    border-radius: 50%;
}

.ms-activity-icon .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-primary);
}

.ms-activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ms-activity-message {
    font-size: 0.875rem;
    color: var(--ms-gray-700);
}

.ms-activity-time {
    font-size: 0.75rem;
    color: var(--ms-gray-400);
}

/* ==========================================================================
   Dashboard Row Layout (Learning + Activity)
   ========================================================================== */
.ms-dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

.ms-dashboard-content > .ms-dashboard-row {
    margin: 0;
}

.ms-dashboard-box {
    background: #ffffff;
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow);
    display: flex;
    flex-direction: column;
}

.ms-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-box-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ms-gray-900);
}

.ms-box-header h3 .dashicons {
    color: var(--ms-primary);
}

.ms-box-content {
    padding: 1.5rem;
    flex: 1;
}

.ms-box-learning {
    min-height: 250px;
    background-color: #ffffff;
}

.ms-box-activity .ms-box-content {
    padding: 1rem 1.5rem;
}

@media (max-width: 768px) {
    .ms-dashboard-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Dashboard Two-Column Layout (legacy)
   ========================================================================== */
.ms-dashboard-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.ms-col-main {
    min-height: 200px;
}

.ms-col-sidebar {
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    padding: 1rem;
}

.ms-col-sidebar h3 {
    margin-top: 0;
    font-size: 1rem;
}

.ms-col-sidebar .ms-activity-item {
    padding: 0.5rem 0;
}

.ms-col-sidebar .ms-activity-icon {
    width: 28px;
    height: 28px;
}

.ms-col-sidebar .ms-activity-icon .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ms-col-sidebar .ms-activity-message {
    font-size: 0.8125rem;
}

.ms-col-sidebar .ms-empty-state {
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .ms-dashboard-columns {
        grid-template-columns: 1fr;
    }
    
    .ms-col-main {
        order: 2;
    }
    
    .ms-col-sidebar {
        order: 1;
    }
}

.ms-activity-load-more {
    text-align: center;
    padding: 1rem 0 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--ms-gray-100);
}

.ms-btn-link {
    background: none;
    border: none;
    color: var(--ms-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: var(--ms-transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-btn-link::after {
    content: '\f140';
    font-family: dashicons;
    font-size: 1rem;
    line-height: 1;
}

.ms-btn-link:hover {
    color: var(--ms-primary-hover);
}

.ms-btn-link:disabled {
    color: var(--ms-gray-400);
    cursor: not-allowed;
}

.ms-btn-link:disabled::after {
    content: '\f463';
}

/* ==========================================================================
   Messages Widget (Dashboard)
   ========================================================================== */
.ms-messages-widget {
    background: #ffffff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    padding: 0;
    overflow: hidden;
}

.ms-messages-widget .ms-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ms-gray-200);
    background: #ffffff;
}

.ms-messages-widget .ms-widget-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-messages-widget .ms-widget-header h3 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-primary);
}

/* Friends and Stream Widget Header Icons */
.ms-friends-widget .ms-widget-header h3 .dashicons,
.ms-stream-widget .ms-widget-header h3 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-primary);
}

.ms-messages-widget .ms-widget-badge {
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.ms-messages-widget .ms-widget-actions .ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ms-messages-widget .ms-widget-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-messages-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ms-message-item {
    border-bottom: 1px solid var(--ms-gray-100);
}

.ms-message-item:last-child {
    border-bottom: none;
}

.ms-message-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

.ms-message-link:hover {
    background: var(--ms-gray-50);
}

.ms-message-avatar {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.ms-message-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.ms-group-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--ms-primary-light);
    border-radius: 50%;
}

.ms-group-avatar .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--ms-primary);
}

.ms-unread-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--ms-error);
    border: 2px solid var(--ms-white);
    border-radius: 50%;
}

.ms-message-content {
    flex: 1;
    min-width: 0;
}

.ms-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.ms-message-sender {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ms-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-message-time {
    font-size: 0.75rem;
    color: var(--ms-gray-400);
    flex-shrink: 0;
}

.ms-message-preview {
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-message-badge {
    flex-shrink: 0;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
}

.ms-widget-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--ms-gray-200);
    background: var(--ms-gray-50);
    text-align: center;
}

.ms-widget-footer .ms-btn-link {
    padding: 0;
}

.ms-widget-footer .ms-btn-link::after {
    content: none;
}

/* Messages Badge */
.ms-messages-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    color: var(--ms-white);
    background: var(--ms-error);
    border-radius: 10px;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Empty (no unread) badge - gray */
.ms-messages-badge--empty {
    background: var(--ms-gray-400, #9ca3af);
}

/* Stat card with highlight for unread messages */
.ms-stat-card-highlight {
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 1px var(--ms-primary-light);
}

.ms-stat-action-highlight {
    color: var(--ms-error) !important;
    font-weight: 500;
}

/* Empty state small variant */
.ms-empty-state-small {
    padding: 1.5rem 1rem;
}

.ms-empty-state-small .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--ms-gray-300);
}

.ms-empty-state-small p {
    margin: 0.5rem 0 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Profile Form
   ========================================================================== */
.ms-profile-form .ms-form-section {
    margin-bottom: 2rem;
}

.ms-profile-form .ms-form-section h3 {
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-gray-900);
    border-bottom: 1px solid var(--ms-gray-200);
}

/* ==========================================================================
   Avatar Upload
   ========================================================================== */
.ms-avatar-section {
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    padding: 1.5rem;
}

.ms-avatar-upload {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.ms-avatar-preview {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: var(--ms-shadow-md);
}

.ms-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ms-avatar-controls .ms-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.ms-avatar-controls .ms-btn-sm .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.ms-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ms-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--ms-gray-600);
    cursor: pointer;
}

.ms-checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

@media (max-width: 480px) {
    .ms-avatar-upload {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .ms-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ==========================================================================
   Course Catalog (Archive)
   ========================================================================== */
.ms-course-archive {
    padding: 0 0 200px;
    border-bottom: none;
}

.ms-archive-header {
    background: linear-gradient(135deg, var(--ms-primary), var(--ms-primary-hover));
    padding: 3rem 0;
    margin-bottom: 4rem;
    color: #fff;
    text-align: center;
}

.ms-archive-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.ms-archive-description {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0;
}

.ms-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Course Catalog Shortcode
   ========================================================================== */
.ms-course-catalog-shortcode {
    max-width: 1000px !important;
    margin: 2rem auto !important;
    padding: 2rem !important;
    background: #fff !important;
    border-radius: var(--ms-border-radius-lg) !important;
    box-shadow: var(--ms-shadow) !important;
}

div.ms-course-catalog-shortcode {
    background-color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* Course Filters */
.ms-course-filters {
    margin-bottom: 4rem;
}

.ms-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.ms-filter-group {
    flex: 1;
    min-width: 150px;
}

.ms-filter-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 1.25rem !important;
    border: 1px solid var(--ms-gray-300);
    border-radius: var(--ms-border-radius);
    font-size: 0.9375rem;
    transition: var(--ms-transition);
    height: 44px;
    box-sizing: border-box;
}

.ms-filter-search:focus {
    outline: none;
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px var(--ms-primary-light);
}

.ms-filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ms-gray-300);
    border-radius: var(--ms-border-radius);
    background: #fff;
    font-size: 0.9375rem;
    height: 44px;
    box-sizing: border-box;
    cursor: pointer;
}

.ms-filter-reset {
    color: var(--ms-gray-500);
    text-decoration: none;
    font-size: 0.875rem;
}

.ms-filter-reset:hover {
    color: var(--ms-error);
}

/* Course Grid */
.ms-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Course Card */
.ms-course-card {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    overflow: hidden;
    box-shadow: var(--ms-shadow);
    transition: var(--ms-transition);
}

.ms-course-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ms-shadow-lg);
}

.ms-course-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ms-course-card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.ms-course-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ms-course-card:hover .ms-course-card-image img {
    transform: scale(1.05);
}

.ms-course-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ms-badge-featured {
    background: var(--ms-warning);
    color: #fff;
}

.ms-badge-enrolled {
    background: var(--ms-success);
    color: #fff;
}

.ms-course-card-content {
    padding: 1.25rem;
}

.ms-course-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.ms-course-level {
    padding: 0.25rem 0.5rem;
    border-radius: var(--ms-border-radius-sm);
    font-weight: 500;
    text-transform: capitalize;
}

.ms-level-beginner {
    background: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-level-intermediate {
    background: var(--ms-warning-light);
    color: var(--ms-warning);
}

.ms-level-advanced {
    background: var(--ms-error-light);
    color: var(--ms-error);
}

.ms-course-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--ms-gray-500);
}

.ms-course-duration .dashicons {
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
}

.ms-course-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--ms-gray-900);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-course-card-excerpt {
    font-size: 0.875rem;
    color: var(--ms-gray-500);
    margin: 0 0 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-course-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--ms-gray-100);
}

.ms-course-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-price-free {
    font-weight: 600;
    color: var(--ms-success);
}

.ms-price-current {
    font-weight: 600;
    color: var(--ms-gray-900);
}

.ms-price-original {
    font-size: 0.875rem;
    color: var(--ms-gray-400);
    text-decoration: line-through;
}

.ms-course-students {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--ms-gray-500);
    font-size: 0.875rem;
}

.ms-course-students .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

/* Pagination */
.ms-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.ms-pagination a,
.ms-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: var(--ms-border-radius);
    text-decoration: none;
    font-size: 0.875rem;
}

.ms-pagination a {
    background: #fff;
    border: 1px solid var(--ms-gray-300);
    color: var(--ms-gray-600);
}

.ms-pagination a:hover {
    border-color: var(--ms-primary);
    color: var(--ms-primary);
}

.ms-pagination .current {
    background: var(--ms-primary);
    color: #fff;
    border: 1px solid var(--ms-primary);
}

/* No Courses */
.ms-no-courses {
    padding: 4rem 0;
}

.ms-no-courses .ms-empty-state {
    text-align: center;
}

.ms-no-courses .ms-empty-state .dashicons {
    font-size: 4rem;
    width: 4rem;
    height: 4rem;
    color: var(--ms-gray-300);
    margin-bottom: 1rem;
}

.ms-no-courses .ms-empty-state h3 {
    margin: 0 0 0.5rem;
    color: var(--ms-gray-700);
}

.ms-no-courses .ms-empty-state p {
    color: var(--ms-gray-500);
    margin: 0 0 1.5rem;
}

/* ==========================================================================
   Single Course Page
   ========================================================================== */
.ms-course-single {
    background: var(--ms-gray-50);
}

.ms-course-header {
    position: relative;
    background-color: var(--ms-gray-900);
    background-size: cover;
    background-position: center;
    padding: 4rem 0;
    color: #fff;
}

.ms-course-header-content {
    max-width: 800px;
}

.ms-course-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ms-course-excerpt {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0 0 1.5rem;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.ms-course-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.ms-course-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    opacity: 0.9;
}

.ms-course-meta-item .dashicons {
    font-size: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
}

/* Course Content Layout */
.ms-course-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    padding: 2rem 0 4rem;
}

.ms-course-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ms-course-section {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--ms-shadow);
}

.ms-course-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--ms-gray-900);
}

.ms-course-description {
    color: var(--ms-gray-600);
    line-height: 1.7;
}

.ms-course-description p {
    margin: 0 0 1rem;
}

.ms-course-description p:last-child {
    margin-bottom: 0;
}

/* Video Preview */
.ms-video-preview {
    position: relative;
    padding-top: 56.25%;
    border-radius: var(--ms-border-radius);
    overflow: hidden;
    background: var(--ms-gray-900);
}

.ms-video-preview iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Instructor Card */
.ms-instructor-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.ms-instructor-avatar img {
    border-radius: 50%;
}

.ms-instructor-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--ms-gray-900);
}

.ms-instructor-bio {
    font-size: 0.9375rem;
    color: var(--ms-gray-500);
    margin: 0;
    line-height: 1.6;
}

/* Course Sidebar */
.ms-course-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.ms-course-card {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    overflow: hidden;
    box-shadow: var(--ms-shadow-md);
}

.ms-course-card-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.ms-course-price-box {
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--ms-gray-100);
}

.ms-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-gray-900);
}

.ms-price-free {
    color: var(--ms-success);
}

.ms-price-included {
    color: #8b5cf6;
}

.ms-price-sale {
    color: var(--ms-error);
}

.ms-price-original {
    display: block;
    font-size: 1rem;
    color: var(--ms-gray-400);
    text-decoration: line-through;
    margin-bottom: 0.25rem;
}

.ms-course-action {
    padding: 1.25rem;
    border-bottom: 1px solid var(--ms-gray-100);
}

.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--ms-border-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-btn-primary {
    background: var(--ms-primary);
    color: #fff;
}

.ms-btn-primary:hover {
    background: #fff !important;
    color: var(--ms-primary, #8b5cf6) !important;
    border: 2px solid var(--ms-primary, #8b5cf6) !important;
    text-decoration: none !important;
    animation: ms-pulse 1.5s ease-in-out infinite;
}

@keyframes ms-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--ms-primary-rgb), 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(var(--ms-primary-rgb), 0);
    }
}

.ms-btn-secondary {
    background: var(--ms-gray-100);
    color: var(--ms-gray-700);
}

.ms-btn-secondary:hover {
    background: var(--ms-gray-200);
}

.ms-btn-success {
    background: var(--ms-success);
    color: #fff;
}

.ms-btn-block {
    display: flex;
    width: 100%;
}

.ms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ms-login-hint {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--ms-gray-500);
}

.ms-login-hint a {
    color: var(--ms-primary);
    text-decoration: none;
}

.ms-login-hint a:hover {
    text-decoration: underline;
}

/* Enrollment Progress */
.ms-enrollment-progress {
    margin-top: 1rem;
}

.ms-progress-bar {
    height: 8px;
    background: var(--ms-gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.ms-progress-fill {
    height: 100%;
    background: var(--ms-success);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.ms-progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--ms-gray-500);
}

/* Course Details */
.ms-course-details {
    padding: 1.25rem;
}

.ms-course-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 1rem;
    color: var(--ms-gray-900);
}

.ms-course-features {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ms-course-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--ms-gray-600);
}

.ms-course-features li .dashicons {
    color: var(--ms-gray-400);
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

/* Responsive Single Course */
@media (max-width: 1024px) {
    .ms-course-content-wrapper {
        grid-template-columns: 1fr;
    }

    .ms-course-sidebar {
        position: static;
        order: -1;
    }

    .ms-course-title {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    .ms-course-header {
        padding: 2rem 0;
    }

    .ms-course-title {
        font-size: 1.5rem;
    }

    .ms-course-excerpt {
        font-size: 1rem;
    }

    .ms-course-meta-row {
        gap: 1rem;
    }

    .ms-instructor-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Responsive Archive */
@media (max-width: 640px) {
    .ms-archive-header {
        padding: 2rem 0;
    }

    .ms-archive-title {
        font-size: 1.75rem;
    }

    .ms-filter-form {
        flex-direction: column;
    }

    .ms-filter-group {
        width: 100%;
    }

    .ms-course-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Dashboard Course Cards
   ========================================================================== */

/* Continue Learning - Progress Cards */
.ms-enrolled-courses {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-course-progress-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    transition: var(--ms-transition);
}

.ms-course-progress-card:hover {
    background: var(--ms-gray-100);
}

.ms-course-progress-card .ms-course-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 60px;
    border-radius: var(--ms-border-radius-sm);
    overflow: hidden;
}

.ms-course-progress-card .ms-course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-course-progress-card .ms-course-info {
    flex: 1;
    min-width: 0;
}

.ms-course-progress-card .ms-course-info h4 {
    margin: 0 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.ms-course-progress-card .ms-course-info h4 a {
    color: var(--ms-gray-900);
    text-decoration: none;
}

.ms-course-progress-card .ms-course-info h4 a:hover {
    color: var(--ms-primary);
}

.ms-course-progress-card .ms-progress-bar {
    height: 6px;
    margin-bottom: 0.25rem;
}

.ms-course-progress-card .ms-progress-text {
    text-align: left;
    margin-top: 0;
    font-size: 0.75rem;
}

.ms-view-all-courses {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Courses Tab - Full List */
.ms-enrolled-courses-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-course-list-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius-lg);
    transition: var(--ms-transition);
}

.ms-course-list-item:hover {
    border-color: var(--ms-primary-light);
    box-shadow: var(--ms-shadow);
}

.ms-course-list-item .ms-course-thumb {
    flex-shrink: 0;
    width: 160px;
    height: 90px;
    border-radius: var(--ms-border-radius);
    overflow: hidden;
}

.ms-course-list-item .ms-course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-course-list-item .ms-course-details {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ms-course-list-item .ms-course-details h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.ms-course-list-item .ms-course-details h4 a {
    color: var(--ms-gray-900);
    text-decoration: none;
}

.ms-course-list-item .ms-course-details h4 a:hover {
    color: var(--ms-primary);
}

.ms-course-list-item .ms-course-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

.ms-course-list-item .ms-course-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ms-course-list-item .ms-course-meta .dashicons {
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
}

.ms-course-list-item .ms-status-completed {
    color: var(--ms-success);
}

.ms-course-list-item .ms-progress-bar {
    max-width: 300px;
}

.ms-course-list-item .ms-course-actions {
    margin-top: auto;
}

.ms-browse-more {
    margin-top: 1.5rem;
    text-align: center;
}

@media (max-width: 640px) {
    .ms-course-list-item {
        flex-direction: column;
    }

    .ms-course-list-item .ms-course-thumb {
        width: 100%;
        height: 180px;
    }

    .ms-course-progress-card {
        flex-direction: column;
    }

    .ms-course-progress-card .ms-course-thumb {
        width: 100%;
        height: 120px;
    }
}

/* ==========================================================================
   Dashboard Certificates Tab
   ========================================================================== */
.ms-certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.ms-certificate-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius-lg);
    padding: 1.5rem;
    transition: var(--ms-transition);
    position: relative;
    overflow: hidden;
}

.ms-certificate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ms-success), #34d399);
}

.ms-certificate-card.ms-certificate-expired::before {
    background: linear-gradient(90deg, var(--ms-gray-400), var(--ms-gray-300));
}

.ms-certificate-card:hover {
    box-shadow: var(--ms-shadow-md);
    transform: translateY(-2px);
}

.ms-certificate-card.ms-certificate-expired {
    opacity: 0.75;
}

.ms-certificate-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--ms-success-light), #ecfdf5);
    border-radius: 50%;
    color: var(--ms-success);
}

.ms-certificate-card.ms-certificate-expired .ms-certificate-badge {
    background: var(--ms-gray-100);
    color: var(--ms-gray-400);
}

.ms-certificate-badge svg {
    width: 48px;
    height: 48px;
}

.ms-certificate-content {
    flex: 1;
    text-align: center;
}

.ms-certificate-course-title {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--ms-gray-900);
    line-height: 1.4;
}

.ms-certificate-meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ms-certificate-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--ms-gray-600);
}

.ms-certificate-meta-row .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-gray-400);
}

.ms-certificate-id-text {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--ms-gray-500);
    background: var(--ms-gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: var(--ms-border-radius-sm);
}

.ms-certificate-status {
    margin-bottom: 1rem;
}

.ms-status-valid {
    background: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-status-expired {
    background: var(--ms-gray-100);
    color: var(--ms-gray-500);
}

.ms-certificate-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--ms-gray-100);
}

.ms-certificate-actions .ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.ms-certificate-actions .ms-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-text-danger {
    color: var(--ms-error);
}

@media (max-width: 640px) {
    .ms-certificates-grid {
        grid-template-columns: 1fr;
    }
    
    .ms-certificate-card {
        padding: 1.25rem;
    }
    
    .ms-certificate-actions {
        flex-direction: column;
    }
    
    .ms-certificate-actions .ms-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Curriculum List (on Course Page)
   ========================================================================== */
.ms-curriculum-list {
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    overflow: hidden;
}

.ms-curriculum-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--ms-gray-200);
    transition: var(--ms-transition);
}

.ms-curriculum-item:last-child {
    border-bottom: none;
}

.ms-curriculum-item:hover {
    background: var(--ms-gray-50);
}

.ms-curriculum-item.completed {
    background: var(--ms-success-light);
}

.ms-curriculum-item.locked {
    opacity: 0.7;
}

.ms-curriculum-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-gray-100);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ms-gray-600);
    flex-shrink: 0;
}

.ms-curriculum-item.completed .ms-curriculum-number {
    background: var(--ms-success);
    color: #fff;
}

.ms-curriculum-item.completed .ms-curriculum-number .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-curriculum-content {
    flex: 1;
    min-width: 0;
}

.ms-curriculum-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--ms-gray-800);
    text-decoration: none;
}

a.ms-curriculum-title:hover {
    color: var(--ms-primary);
}

.ms-curriculum-title .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-gray-400);
}

.ms-curriculum-excerpt {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--ms-gray-500);
    line-height: 1.4;
}

.ms-curriculum-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.ms-curriculum-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

.ms-curriculum-duration .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ms-curriculum-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--ms-border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.ms-badge-preview {
    background: var(--ms-primary-light);
    color: var(--ms-primary);
}

.ms-curriculum-lock {
    color: var(--ms-gray-400);
}

.ms-curriculum-lock .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-curriculum-summary {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    font-size: 0.875rem;
    color: var(--ms-gray-600);
}

.ms-curriculum-summary .ms-separator {
    margin: 0 0.5rem;
}

/* ==========================================================================
   Single Lesson Page
   ========================================================================== */
.ms-lesson-single {
    padding-bottom: 3rem;
}

.ms-lesson-header {
    background: var(--ms-gray-100);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.ms-lesson-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.ms-lesson-breadcrumb a {
    color: var(--ms-primary);
    text-decoration: none;
}

.ms-lesson-breadcrumb a:hover {
    text-decoration: underline;
}

.ms-breadcrumb-separator {
    color: var(--ms-gray-400);
}

.ms-lesson-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .ms-lesson-wrapper {
        grid-template-columns: 1fr;
    }
    
    .ms-lesson-sidebar {
        order: -1;
    }
}

.ms-lesson-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-lesson-section {
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius-lg);
    padding: 1.25rem;
}

.ms-lesson-section.ms-lesson-quiz {
    padding-top: 0;
    padding-bottom: 0;
}

.ms-lesson-section.ms-lesson-actions {
    text-align: center;
    padding: 1rem;
}

.ms-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-gray-700);
}

.ms-section-title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--ms-gray-400);
}

.ms-lesson-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ms-gray-900);
}

.ms-lesson-title .dashicons {
    color: var(--ms-gray-400);
}

.ms-lesson-completed-badge {
    color: var(--ms-success);
}

.ms-lesson-completed-badge .dashicons {
    color: var(--ms-success);
}

/* Video in Lesson - reuse course video preview style */
.ms-lesson-section .ms-video-preview {
    margin: 0;
}

.ms-video-player {
    background: #000;
}

/* Audio */
.ms-audio-player {
    width: 100%;
}

/* Text Content */
.ms-lesson-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ms-gray-700);
}

.ms-lesson-text h2,
.ms-lesson-text h3,
.ms-lesson-text h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--ms-gray-900);
}

.ms-lesson-text h2:first-child,
.ms-lesson-text h3:first-child,
.ms-lesson-text h4:first-child {
    margin-top: 0;
}

.ms-lesson-text p {
    margin-bottom: 1rem;
}

.ms-lesson-text p:last-child {
    margin-bottom: 0;
}

.ms-lesson-text img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ms-border-radius);
}

/* Download Boxes */
.ms-download-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ms-download-box > .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--ms-gray-400);
}

.ms-download-box > .dashicons.dashicons-media-document {
    color: #ea580c;
}

.ms-download-box > .dashicons.dashicons-download {
    color: var(--ms-success);
}

.ms-download-info {
    flex: 1;
}

.ms-download-info strong {
    display: block;
    color: var(--ms-gray-800);
}

.ms-download-info span {
    font-size: 0.875rem;
    color: var(--ms-gray-500);
}

.ms-download-box .ms-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ms-download-box .ms-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Lesson Actions */
.ms-lesson-actions {
    display: flex;
    justify-content: center;
}

.ms-lesson-complete-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ms-lesson-complete-action .ms-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Keep completion CTA visible without hover (inverted scheme). */
.ms-lesson-complete-action .ms-btn-success {
    background: #fff;
    color: var(--ms-success);
    border: 2px solid var(--ms-success);
}

.ms-lesson-complete-action .ms-btn-success:hover,
.ms-lesson-complete-action .ms-btn-success:focus {
    background: var(--ms-success);
    color: #fff;
    border-color: var(--ms-success);
}

.ms-quiz-required-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: var(--ms-gray-500);
    font-size: 0.875rem;
}

.ms-quiz-required-hint .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.ms-btn-success {
    background: var(--ms-success);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--ms-border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-btn-success:hover {
    background: #047857;
}

.ms-btn-success:disabled,
.ms-btn-success.ms-quiz-required {
    opacity: 0.5;
    cursor: not-allowed;
}

.ms-btn-success:disabled:hover,
.ms-btn-success.ms-quiz-required:hover {
    background: var(--ms-success);
}

.ms-btn-outline {
    background: transparent;
    color: var(--ms-gray-600);
    border: 1px solid var(--ms-gray-300);
    padding: 0.75rem 1.5rem;
    border-radius: var(--ms-border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-btn-outline:hover {
    background: var(--ms-gray-50);
    border-color: var(--ms-gray-400);
}

/* Lesson Navigation */
.ms-lesson-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius-lg);
}

.ms-lesson-nav-prev,
.ms-lesson-nav-next {
    flex: 1;
}

.ms-lesson-nav-next {
    text-align: right;
}

.ms-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
    text-decoration: none;
    color: var(--ms-gray-700);
    transition: var(--ms-transition);
}

.ms-nav-link:hover {
    background: var(--ms-gray-100);
    color: var(--ms-primary);
}

.ms-nav-link .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-gray-400);
}

.ms-nav-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.ms-nav-text small {
    font-size: 0.75rem;
    color: var(--ms-gray-500);
}

.ms-nav-text strong {
    font-weight: 500;
}

/* Lesson Sidebar */
.ms-lesson-sidebar-box {
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 2rem;
}

.ms-sidebar-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.ms-sidebar-title a {
    color: var(--ms-gray-800);
    text-decoration: none;
}

.ms-sidebar-title a:hover {
    color: var(--ms-primary);
}

.ms-course-progress-mini {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-course-progress-mini .ms-progress-bar {
    height: 6px;
    margin-bottom: 0.5rem;
}

.ms-course-progress-mini .ms-progress-text {
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

.ms-lesson-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.ms-lesson-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--ms-border-radius-sm);
    text-decoration: none;
    color: var(--ms-gray-700);
    font-size: 0.875rem;
    transition: var(--ms-transition);
}

.ms-lesson-list-item:hover {
    background: var(--ms-gray-50);
}

.ms-lesson-list-item.current {
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    font-weight: 500;
}

.ms-lesson-list-item.completed {
    color: var(--ms-success);
}

.ms-lesson-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-gray-100);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.ms-lesson-list-item.current .ms-lesson-number {
    background: var(--ms-primary);
    color: #fff;
}

.ms-lesson-list-item.completed .ms-lesson-number {
    background: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-lesson-list-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ms-lesson-list-title .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.ms-lesson-status {
    flex-shrink: 0;
}

.ms-lesson-status .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-success);
}

.ms-preview-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    border-radius: var(--ms-border-radius-sm);
}

/* Access Denied */
.ms-access-denied {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.ms-access-denied-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--ms-gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-access-denied-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--ms-gray-400);
}

.ms-access-denied h2 {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    color: var(--ms-gray-800);
}

.ms-access-denied p {
    margin: 0 0 1.5rem;
    color: var(--ms-gray-600);
}

/* ==========================================================================
   Quiz Single Page
   ========================================================================== */
.ms-quiz-single {
    padding: 2rem 0;
}

.ms-quiz-single .ms-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Quiz Breadcrumb */
.ms-quiz-single .ms-breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--ms-gray-500);
}

.ms-quiz-single .ms-breadcrumb a {
    color: var(--ms-primary);
    text-decoration: none;
}

.ms-quiz-single .ms-breadcrumb a:hover {
    text-decoration: underline;
}

.ms-breadcrumb-sep {
    margin: 0 0.5rem;
    color: var(--ms-gray-400);
}

/* Quiz Overview */
.ms-quiz-overview-header {
    margin-bottom: 2rem;
}

.ms-quiz-overview-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--ms-gray-900);
}

.ms-quiz-description {
    color: var(--ms-gray-600);
    font-size: 1.0625rem;
    line-height: 1.7;
}

/* Quiz Info Grid */
.ms-quiz-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.ms-quiz-info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
}

.ms-quiz-info-item .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--ms-primary);
}

.ms-info-content {
    display: flex;
    flex-direction: column;
}

.ms-info-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-gray-900);
}

.ms-info-label {
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

/* Quiz Status */
.ms-quiz-status {
    margin-bottom: 1.5rem;
}

.ms-quiz-passed-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--ms-success-light);
    color: var(--ms-success);
    border-radius: var(--ms-border-radius);
    font-weight: 500;
}

.ms-quiz-no-attempts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--ms-error-light);
    color: var(--ms-error);
    border-radius: var(--ms-border-radius);
    font-weight: 500;
}

.ms-quiz-attempts-info {
    padding: 1rem 1.25rem;
    background: var(--ms-gray-100);
    border-radius: var(--ms-border-radius);
    color: var(--ms-gray-700);
}

/* Quiz Actions */
.ms-quiz-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.ms-btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
}

.ms-btn-lg .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
}

.ms-btn-success {
    background: var(--ms-success);
    color: #fff;
    border-color: var(--ms-success);
}

.ms-btn-success:hover {
    background: #047857;
    border-color: #047857;
}

/* Previous Attempts Table */
.ms-quiz-previous-attempts {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ms-gray-200);
}

.ms-quiz-previous-attempts h3 {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.ms-attempts-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--ms-border-radius);
    overflow: hidden;
    box-shadow: var(--ms-shadow);
}

.ms-attempts-table th,
.ms-attempts-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-attempts-table th {
    background: var(--ms-gray-50);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ms-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.ms-attempts-table tr:last-child td {
    border-bottom: none;
}

.ms-status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--ms-border-radius-sm);
}

.ms-status-badge.passed {
    background: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-status-badge.failed {
    background: var(--ms-error-light);
    color: var(--ms-error);
}

.ms-status-badge.in-progress {
    background: var(--ms-primary-light);
    color: var(--ms-primary);
}

.ms-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ==========================================================================
   Quiz Taking
   ========================================================================== */
.ms-quiz-taking {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow-lg);
    overflow: hidden;
}

.ms-quiz-taking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--ms-gray-50);
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-quiz-taking-header h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.ms-quiz-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ms-quiz-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--ms-gray-100);
    border-radius: var(--ms-border-radius);
    font-family: monospace;
    font-size: 1.125rem;
    font-weight: 600;
}

.ms-quiz-timer.warning {
    background: var(--ms-error-light);
    color: var(--ms-error);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ms-quiz-progress-info {
    font-weight: 500;
    color: var(--ms-gray-600);
}

/* Progress Bar */
.ms-quiz-progress-bar {
    height: 4px;
    background: var(--ms-gray-200);
}

.ms-quiz-progress-fill {
    height: 100%;
    background: var(--ms-primary);
    transition: width 0.3s ease;
}

/* Quiz Form */
.ms-quiz-form {
    padding: 2rem;
}

.ms-quiz-question {
    display: none;
}

.ms-quiz-question.active {
    display: block;
}

.ms-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ms-question-number {
    font-size: 0.875rem;
    color: var(--ms-gray-500);
}

.ms-question-points {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ms-primary);
}

.ms-question-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--ms-gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Answer Options */
.ms-question-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.ms-answer-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--ms-gray-50);
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-answer-option:hover {
    border-color: var(--ms-primary);
    background: var(--ms-primary-light);
}

.ms-answer-option input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ms-primary);
}

.ms-answer-option input:checked + .ms-answer-text {
    color: var(--ms-primary);
    font-weight: 500;
}

.ms-answer-text {
    flex: 1;
    color: var(--ms-gray-700);
}

/* Input Fields */
.ms-answer-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    transition: var(--ms-transition);
}

.ms-answer-input:focus {
    border-color: var(--ms-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ms-answer-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    resize: vertical;
    min-height: 120px;
    transition: var(--ms-transition);
}

.ms-answer-textarea:focus {
    border-color: var(--ms-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Matching Exercise */
.ms-matching-exercise {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ms-matching-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ms-matching-left {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--ms-gray-100);
    border-radius: var(--ms-border-radius);
    font-weight: 500;
}

.ms-matching-select {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    background: #fff;
}

/* Sorting Exercise */
.ms-sorting-exercise .ms-sorting-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ms-sorting-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--ms-gray-50);
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    cursor: grab;
}

.ms-sorting-item:active {
    cursor: grabbing;
}

.ms-sorting-item .dashicons {
    color: var(--ms-gray-400);
}

/* Quiz Navigation */
.ms-quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ms-gray-200);
}

.ms-quiz-navigation .ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   Quiz Results
   ========================================================================== */
.ms-quiz-results {
    background: #fff;
    border-radius: var(--ms-border-radius-lg);
    box-shadow: var(--ms-shadow-lg);
    overflow: hidden;
}

.ms-quiz-result-header {
    padding: 3rem 2rem;
    text-align: center;
}

.ms-quiz-result-header.passed {
    background: linear-gradient(135deg, var(--ms-success) 0%, #047857 100%);
    color: #fff;
}

.ms-quiz-result-header.failed {
    background: linear-gradient(135deg, var(--ms-error) 0%, #b91c1c 100%);
    color: #fff;
}

.ms-result-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-result-icon .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.ms-quiz-result-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
}

.ms-result-score {
    margin: 0;
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Result Stats */
.ms-quiz-result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 2rem;
    background: var(--ms-gray-50);
}

.ms-stat-item {
    text-align: center;
}

.ms-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-gray-900);
}

.ms-stat-label {
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

/* Review Questions */
.ms-quiz-review {
    padding: 2rem;
}

.ms-quiz-review h2 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

.ms-review-question {
    margin-bottom: 1rem;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    overflow: hidden;
}

.ms-review-question.correct {
    border-color: var(--ms-success);
}

.ms-review-question.incorrect {
    border-color: var(--ms-error);
}

.ms-review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--ms-gray-50);
    font-size: 0.875rem;
}

.ms-review-question.correct .ms-review-header {
    background: var(--ms-success-light);
}

.ms-review-question.incorrect .ms-review-header {
    background: var(--ms-error-light);
}

.ms-review-status .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-review-question.correct .ms-review-status .dashicons {
    color: var(--ms-success);
}

.ms-review-question.incorrect .ms-review-status .dashicons {
    color: var(--ms-error);
}

.ms-review-number {
    font-weight: 600;
}

.ms-review-type {
    color: var(--ms-gray-500);
}

.ms-review-points {
    margin-left: auto;
    font-weight: 500;
}

.ms-review-content {
    padding: 1rem;
}

.ms-review-text {
    margin: 0 0 1rem;
    font-weight: 500;
}

.ms-review-answer,
.ms-review-explanation {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius-sm);
    font-size: 0.9375rem;
}

.ms-review-answer strong,
.ms-review-explanation strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
    color: var(--ms-gray-500);
}

/* Result Actions */
.ms-quiz-result-actions {
    padding: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid var(--ms-gray-200);
}

/* ==========================================================================
   Quiz Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .ms-quiz-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ms-quiz-taking-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ms-quiz-result-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .ms-matching-row {
        flex-direction: column;
    }

    .ms-matching-left,
    .ms-matching-select {
        width: 100%;
    }

    .ms-attempts-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .ms-quiz-info-grid {
        grid-template-columns: 1fr;
    }

    .ms-quiz-form {
        padding: 1rem;
    }

    .ms-quiz-result-header {
        padding: 2rem 1rem;
    }

    .ms-quiz-actions {
        flex-direction: column;
    }

    .ms-quiz-actions .ms-btn {
        width: 100%;
        justify-content: center;
    }
}
/* ==========================================================================
   Quiz Shortcode Styles
   ========================================================================== */
.ms-quiz-shortcode {
    max-width: 800px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ms-quiz-shortcode .ms-quiz-header {
    background: linear-gradient(135deg, var(--ms-primary) 0%, var(--ms-primary-hover) 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--ms-border-radius-lg) var(--ms-border-radius-lg) 0 0;
}

.ms-quiz-shortcode .ms-quiz-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.ms-quiz-shortcode .ms-quiz-header .ms-quiz-description {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.ms-quiz-shortcode .ms-quiz-header .ms-quiz-description p {
    margin: 0;
    color: inherit;
    font-weight: inherit;
}

.ms-quiz-shortcode .ms-quiz-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1rem;
}

.ms-quiz-shortcode .ms-quiz-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.ms-quiz-shortcode .ms-quiz-meta .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-quiz-shortcode .ms-quiz-timer {
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.ms-quiz-shortcode .ms-quiz-timer.ms-timer-warning {
    background: var(--ms-warning);
    animation: none;
}

.ms-quiz-shortcode .ms-quiz-timer.ms-timer-critical {
    background: var(--ms-error);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ms-quiz-shortcode .ms-quiz-form {
    background: white;
    padding: 2rem;
    border: 1px solid var(--ms-gray-200);
    border-top: none;
}

.ms-quiz-shortcode .ms-quiz-question {
    display: none;
}

.ms-quiz-shortcode .ms-quiz-question.ms-question-active,
.ms-quiz-shortcode .ms-quiz-question:first-of-type {
    display: block;
}

.ms-quiz-shortcode .ms-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ms-gray-100);
}

.ms-quiz-shortcode .ms-question-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ms-primary);
    background: var(--ms-primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.ms-quiz-shortcode .ms-question-type {
    font-size: 0.75rem;
    color: var(--ms-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ms-quiz-shortcode .ms-question-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--ms-gray-900);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.ms-quiz-shortcode .ms-question-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ms-quiz-shortcode .ms-answer-option {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    background: var(--ms-gray-50);
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-quiz-shortcode .ms-answer-option:hover {
    border-color: var(--ms-primary);
    background: var(--ms-primary-light);
}

.ms-quiz-shortcode .ms-answer-option input[type="radio"],
.ms-quiz-shortcode .ms-answer-option input[type="checkbox"] {
    margin: 0.25rem 0.75rem 0 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--ms-primary);
}

.ms-quiz-shortcode .ms-answer-option label {
    cursor: pointer;
    font-size: 1rem;
    color: var(--ms-gray-700);
    line-height: 1.5;
}

.ms-quiz-shortcode .ms-answer-option:has(input:checked) {
    border-color: var(--ms-primary);
    background: var(--ms-primary-light);
}

/* Text inputs */
.ms-quiz-shortcode .ms-text-answer {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    transition: var(--ms-transition);
}

.ms-quiz-shortcode .ms-text-answer:focus {
    outline: none;
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px var(--ms-primary-light);
}

.ms-quiz-shortcode .ms-essay-answer {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    resize: vertical;
    transition: var(--ms-transition);
}

.ms-quiz-shortcode .ms-essay-answer:focus {
    outline: none;
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px var(--ms-primary-light);
}

/* Matching questions */
.ms-quiz-shortcode .ms-matching-pairs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-quiz-shortcode .ms-matching-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
}

.ms-quiz-shortcode .ms-matching-left {
    flex: 1;
    font-weight: 500;
    color: var(--ms-gray-700);
}

.ms-quiz-shortcode .ms-matching-arrow {
    color: var(--ms-gray-400);
}

.ms-quiz-shortcode .ms-match-select {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    font-size: 0.875rem;
    background: white;
}

.ms-quiz-shortcode .ms-match-select:focus {
    outline: none;
    border-color: var(--ms-primary);
}

/* Sorting questions */
.ms-quiz-shortcode .ms-sorting-question {
    width: 100%;
}

.ms-quiz-shortcode .ms-sorting-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ms-quiz-shortcode .ms-sorting-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: var(--ms-transition);
}

.ms-quiz-shortcode .ms-sorting-item:hover {
    border-color: var(--ms-primary);
}

.ms-quiz-shortcode .ms-sorting-item:active {
    cursor: grabbing;
}

.ms-quiz-shortcode .ms-sorting-item .dashicons-menu {
    color: var(--ms-gray-400);
}

/* Navigation */
.ms-quiz-shortcode .ms-quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--ms-gray-100);
}

.ms-quiz-shortcode .ms-quiz-prev,
.ms-quiz-shortcode .ms-quiz-next,
.ms-quiz-shortcode .ms-quiz-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
    text-decoration: none;
}

.ms-quiz-shortcode .ms-quiz-prev {
    background: var(--ms-gray-100);
    color: var(--ms-gray-700);
    border: none;
}

.ms-quiz-shortcode .ms-quiz-prev:hover {
    background: var(--ms-gray-200);
}

.ms-quiz-shortcode .ms-quiz-next,
.ms-quiz-shortcode .ms-quiz-submit {
    background: var(--ms-primary);
    color: white;
    border: none;
}

.ms-quiz-shortcode .ms-quiz-next:hover,
.ms-quiz-shortcode .ms-quiz-submit:hover {
    background: var(--ms-primary-hover);
}

.ms-quiz-shortcode .ms-quiz-submit {
    background: var(--ms-success);
}

.ms-quiz-shortcode .ms-quiz-submit:hover {
    background: #047857;
}

/* Results */
.ms-quiz-shortcode .ms-quiz-results {
    display: none;
    background: white;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid var(--ms-gray-200);
    border-top: none;
    border-radius: 0 0 var(--ms-border-radius-lg) var(--ms-border-radius-lg);
}

.ms-quiz-shortcode .ms-results-icon {
    margin-bottom: 1.5rem;
}

.ms-quiz-shortcode .ms-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-gray-900);
    margin-bottom: 1rem;
}

.ms-quiz-shortcode .ms-results-score {
    font-size: 1.125rem;
    color: var(--ms-gray-600);
    margin-bottom: 1rem;
}

.ms-quiz-shortcode .ms-results-details {
    margin-bottom: 2rem;
}

.ms-quiz-shortcode .ms-quiz-retry {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--ms-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
    text-decoration: none;
}

.ms-quiz-shortcode .ms-quiz-retry:hover {
    background: var(--ms-primary-hover);
}

.ms-quiz-shortcode .ms-quiz-retry:disabled,
.ms-quiz-shortcode .ms-quiz-retry.ms-no-attempts {
    background: var(--ms-gray-400);
    cursor: not-allowed;
    opacity: 0.7;
}

.ms-quiz-shortcode .ms-quiz-retry:disabled:hover,
.ms-quiz-shortcode .ms-quiz-retry.ms-no-attempts:hover {
    background: var(--ms-gray-400);
}

/* Error state */
.ms-quiz-shortcode .ms-question-error {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive */
@media (max-width: 640px) {
    .ms-quiz-shortcode {
        margin: 1rem;
    }

    .ms-quiz-shortcode .ms-quiz-header {
        padding: 1.5rem;
    }

    .ms-quiz-shortcode .ms-quiz-header h2 {
        font-size: 1.5rem;
    }

    .ms-quiz-shortcode .ms-quiz-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ms-quiz-shortcode .ms-quiz-form {
        padding: 1.5rem;
    }

    .ms-quiz-shortcode .ms-quiz-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .ms-quiz-shortcode .ms-quiz-prev,
    .ms-quiz-shortcode .ms-quiz-next,
    .ms-quiz-shortcode .ms-quiz-submit {
        width: 100%;
        justify-content: center;
    }

    .ms-quiz-shortcode .ms-matching-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .ms-quiz-shortcode .ms-matching-arrow {
        display: none;
    }

    .ms-quiz-shortcode .ms-match-select {
        width: 100%;
    }
}

/* ==========================================================================
   FORUM STYLES
   ========================================================================== */

/* Forum CSS Variables */
.ms-forum {
    --ms-text-color: #1f2937;
    --ms-text-muted: #6b7280;
    --ms-border-color: #d1d5db;
    --ms-primary-color: #2563eb;
    --ms-bg-color: #f9fafb;
    --ms-border-radius: 8px;
}

/* Forum Container */
.ms-forum {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: var(--ms-font-family);
}

/* Forum Header */
.ms-forum-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--ms-border-color);
    gap: 1.5rem;
}

.ms-forum-header-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.ms-forum-category-icon-large {
    flex-shrink: 0;
    color: var(--ms-gray-900);
}

.ms-forum-category-icon-large .dashicons {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
    line-height: 1;
}

.ms-forum-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ms-forum-header-actions .ms-btn {
    white-space: nowrap;
}

.ms-forum-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin: 0;
}

.ms-forum-header p {
    color: var(--ms-text-muted);
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
}

/* Forum Buttons */
.ms-forum-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--ms-border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.ms-forum-btn-primary {
    background: var(--ms-primary-color);
    color: white;
}

.ms-forum-btn-primary:hover {
    background: var(--ms-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.ms-forum-btn-secondary {
    background: var(--ms-gray-100);
    color: var(--ms-text-color);
    border: 1px solid var(--ms-border-color);
}

.ms-forum-btn-secondary:hover {
    background: var(--ms-gray-200);
}

.ms-forum-btn-danger {
    background: var(--ms-error-color);
    color: white;
}

.ms-forum-btn-danger:hover {
    background: #dc2626;
}

.ms-forum-btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.ms-forum-btn .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    line-height: 1;
    vertical-align: middle;
}

/* Forum Breadcrumb */
.ms-forum-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
}

.ms-forum-breadcrumb a {
    color: var(--ms-primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.ms-forum-breadcrumb a:hover {
    color: var(--ms-primary-dark);
    text-decoration: underline;
}

.ms-forum-breadcrumb .separator {
    color: var(--ms-text-muted);
}

.ms-forum-breadcrumb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Categories/Boards List - Full Width */
.ms-forum-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Category/Board Card - Two Column Layout */
.ms-forum-category-card {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.ms-forum-category-card:hover {
    border-color: var(--ms-primary-color);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Left: Content */
.ms-forum-category-content {
    flex: 1;
    min-width: 0;
}

.ms-forum-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.ms-forum-category-icon {
    font-size: 1.25rem;
    color: var(--ms-text-color);
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    line-height: 1;
}

.ms-forum-category-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin: 0;
    padding-bottom: 0 !important;
}

.ms-forum-category-description {
    font-size: 0.9rem;
    color: var(--ms-text-color);
    margin: 0.25rem 0 0 0;
    line-height: 1.5;
}

/* Right: Stats */
.ms-forum-category-stats {
    display: flex;
    gap: 1.5rem;
    flex-shrink: 0;
}

.ms-forum-category-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 70px;
}

.ms-forum-category-stat .dashicons {
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--ms-primary-color);
}

.ms-forum-stat-text {
    font-size: 0.85rem;
    color: var(--ms-primary-color);
    font-weight: 500;
    white-space: nowrap;
}

/* Threads List */
.ms-forum-threads {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ms-forum-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.ms-forum-sort select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--ms-border-color);
    border-radius: var(--ms-border-radius);
    background: white;
    font-size: 0.9rem;
    color: var(--ms-text-color);
    cursor: pointer;
}

/* Thread Card */
.ms-forum-thread-card {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
}

.ms-forum-thread-card:hover {
    border-color: var(--ms-primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ms-forum-thread-card.is-sticky {
    border-left: 4px solid var(--ms-warning-color);
    background: linear-gradient(to right, rgba(245, 158, 11, 0.05), transparent);
}

.ms-forum-thread-card.is-closed {
    opacity: 0.7;
}

.ms-forum-thread-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.ms-forum-thread-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ms-forum-thread-title-wrap {
    flex: 1;
    min-width: 0;
}

.ms-forum-thread-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-text-color);
    margin: 0 0 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-forum-thread-title a {
    color: inherit;
    text-decoration: none;
}

.ms-forum-thread-title a:hover {
    color: var(--ms-primary-color);
}

.ms-forum-thread-badges {
    display: flex;
    gap: 0.5rem;
}

.ms-forum-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ms-forum-badge-sticky {
    background: var(--ms-warning-bg);
    color: var(--ms-warning-color);
}

.ms-forum-badge-closed {
    background: var(--ms-gray-100);
    color: var(--ms-text-muted);
}

.ms-forum-thread-meta {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

.ms-forum-thread-meta a {
    color: var(--ms-primary-color);
    text-decoration: none;
}

.ms-forum-thread-stats {
    display: flex;
    gap: 1.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.ms-forum-thread-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.ms-forum-thread-stat .count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-text-color);
}

.ms-forum-thread-stat .label {
    font-size: 0.7rem;
    color: var(--ms-text-muted);
    text-transform: uppercase;
}

.ms-forum-thread-excerpt {
    color: var(--ms-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0.5rem 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   SINGLE THREAD VIEW - Thread Detail Page
   ===================================================== */

/* Thread Detail Container */
.ms-forum-thread-detail {
    margin-top: 1.5rem;
}

/* Thread Header */
.ms-forum-thread-header {
    margin-bottom: 1.5rem;
}

.ms-forum-thread-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.ms-forum-thread-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--ms-border-radius);
    margin-right: 0.5rem;
    vertical-align: middle;
}

.ms-forum-thread-badge .dashicons {
    font-size: 0.9rem;
    width: 0.9rem;
    height: 0.9rem;
}

.ms-badge-pinned {
    background: var(--ms-warning-bg);
    color: var(--ms-warning-color);
}

.ms-badge-closed {
    background: var(--ms-gray-100);
    color: var(--ms-text-muted);
}

.ms-forum-thread-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--ms-text-muted);
    font-size: 0.9rem;
}

.ms-forum-thread-views {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ms-forum-thread-views .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

/* Original Post (OP) Card */
.ms-forum-post {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    overflow: hidden;
}

.ms-forum-post-op {
    display: flex;
    flex-direction: column;
}

/* Post Sidebar with Author Info */
.ms-forum-post-sidebar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--ms-gray-50);
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-forum-post-avatar {
    flex-shrink: 0;
}

.ms-forum-post-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.ms-forum-post-author-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.ms-forum-post-author-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--ms-text-color);
}

.ms-forum-post-author-role {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: var(--ms-border-radius);
    background: var(--ms-primary-color);
    color: white;
    width: fit-content;
}

/* Post Main Content */
.ms-forum-post-main {
    padding: 1.5rem;
}

.ms-forum-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ms-forum-post-date {
    font-size: 0.85rem;
    color: var(--ms-text-muted);
}

.ms-forum-post-content {
    color: var(--ms-text-color);
    line-height: 1.7;
    font-size: 1rem;
}

.ms-forum-post-content p {
    margin: 0 0 1rem 0;
}

.ms-forum-post-content p:last-child {
    margin-bottom: 0;
}

/* Post Actions (Like, Delete) */
.ms-forum-post-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ms-border-color);
}

/* Like Button */
.ms-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--ms-border-color);
    border-radius: 9999px;
    background: white;
    color: var(--ms-text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-like-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.ms-like-btn.ms-liked {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.ms-like-btn .dashicons {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    line-height: 1;
}

/* =====================================================
   REPLIES SECTION
   ===================================================== */

/* Replies Section */
.ms-forum-replies {
    margin-top: 2.5rem;
}

.ms-forum-replies-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin: 0 0 1.5rem 0;
}

.ms-forum-replies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty Replies State */
.ms-forum-replies-empty {
    text-align: center;
    padding: 2rem;
    color: var(--ms-text-muted);
}

.ms-forum-replies-empty .dashicons {
    font-size: 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.ms-forum-replies-empty p {
    margin: 0;
    font-size: 0.95rem;
}

/* Reply Card */
.ms-forum-reply {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
}

.ms-forum-reply-avatar {
    flex-shrink: 0;
}

.ms-forum-reply-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.ms-forum-reply-content {
    flex: 1;
    min-width: 0;
}

.ms-forum-reply-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.ms-forum-reply-author {
    font-weight: 600;
    color: var(--ms-text-color);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-forum-badge-op {
    display: inline-flex;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--ms-border-radius);
    background: var(--ms-primary-color);
    color: white;
    text-transform: uppercase;
}

.ms-forum-reply-date {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
    margin-left: auto;
}

.ms-forum-reply-body {
    color: var(--ms-text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.ms-forum-reply-body p {
    margin: 0 0 0.75rem 0;
}

.ms-forum-reply-body p:last-child {
    margin-bottom: 0;
}

/* Forum Blockquote Styles */
.ms-forum-quote {
    background: var(--ms-gray-50);
    border-left: 4px solid var(--ms-primary-color);
    border-radius: 0 var(--ms-border-radius) var(--ms-border-radius) 0;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0 1rem 0;
    font-style: italic;
}

.ms-forum-quote cite {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    font-style: normal;
    color: var(--ms-primary-color);
    margin-bottom: 0.5rem;
}

.ms-forum-quote p {
    margin: 0;
    color: var(--ms-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.ms-forum-reply-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ms-border-color);
}

/* Quote Button */
.ms-quote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--ms-border-color);
    border-radius: var(--ms-border-radius);
    background: white;
    color: var(--ms-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-quote-btn:hover {
    border-color: var(--ms-primary-color);
    color: var(--ms-primary-color);
}

.ms-quote-btn .dashicons {
    font-size: 0.9rem;
    width: 0.9rem;
    height: 0.9rem;
}

/* =====================================================
   REPLY FORM SECTION
   ===================================================== */

.ms-forum-reply-form-section {
    margin-top: 2.5rem;
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    padding: 1.5rem;
}

.ms-forum-reply-form-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ms-text-color);
    margin: 0 0 1rem 0;
}

.ms-forum-reply-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid var(--ms-border-color);
    border-radius: var(--ms-border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.ms-forum-reply-form textarea:focus {
    outline: none;
    border-color: var(--ms-primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Login Required Box */
.ms-forum-login-required {
    text-align: center;
    padding: 1.5rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius);
}

.ms-forum-login-required p {
    margin: 0 0 1rem 0;
    color: var(--ms-text-muted);
}

/* Closed Thread Notice */
.ms-forum-closed-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: var(--ms-gray-100);
    border-radius: var(--ms-border-radius);
    color: var(--ms-text-muted);
}

.ms-forum-closed-notice .dashicons {
    font-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}

.ms-forum-closed-notice p {
    margin: 0;
}

/* =====================================================
   LEGACY SUPPORT - Thread Card Styles (Keep for list views)
   ===================================================== */

/* Single Thread View */
.ms-forum-thread-single {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    overflow: hidden;
}

.ms-forum-thread-content {
    padding: 2rem;
}

/* New Thread Form */
.ms-forum-new-thread {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    border: 1px solid var(--ms-border-color);
    padding: 2rem;
}

.ms-forum-new-thread h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin: 0 0 1.5rem 0;
}

.ms-forum-form-group {
    margin-bottom: 1.5rem;
}

.ms-forum-form-group label {
    display: block;
    font-weight: 600;
    color: var(--ms-text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.ms-forum-form-group input[type="text"],
.ms-forum-form-group select,
.ms-forum-form-group textarea,
.ms-forum-input,
.ms-forum-textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ms-text-color);
    background-color: #fff;
    border: 1px solid var(--ms-border-color);
    border-radius: var(--ms-border-radius);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Explicit height for inputs and selects */
.ms-forum-form-group input[type="text"],
.ms-forum-form-group select,
.ms-forum-input {
    height: 48px;
}

/* Hover state for better visibility */
.ms-forum-form-group input[type="text"]:hover,
.ms-forum-form-group select:hover,
.ms-forum-form-group textarea:hover,
.ms-forum-input:hover,
.ms-forum-textarea:hover {
    border-color: #9ca3af;
}

.ms-forum-form-group input[type="text"]:focus,
.ms-forum-form-group select:focus,
.ms-forum-form-group textarea:focus,
.ms-forum-input:focus,
.ms-forum-textarea:focus {
    outline: none;
    border-color: var(--ms-primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Placeholder styling */
.ms-forum-form-group input::placeholder,
.ms-forum-form-group textarea::placeholder,
.ms-forum-input::placeholder,
.ms-forum-textarea::placeholder {
    color: #9ca3af;
}

.ms-forum-form-group textarea,
.ms-forum-textarea {
    min-height: 200px;
    resize: vertical;
    height: auto;
}

/* ==========================================================================
   Summernote Rich Text Editor
   ========================================================================== */
.ms-summernote-editor,
.note-editor.note-frame {
    border: 2px solid var(--ms-gray-200) !important;
    border-radius: var(--ms-border-radius) !important;
    overflow: hidden;
}

.ms-summernote-editor:hover,
.note-editor.note-frame:hover {
    border-color: var(--ms-gray-300) !important;
}

.note-editor.note-frame.note-editing {
    border-color: var(--ms-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.note-toolbar {
    background: var(--ms-gray-50) !important;
    border-bottom: 1px solid var(--ms-gray-200) !important;
    padding: 8px !important;
}

.note-btn-group {
    margin-right: 8px !important;
}

/* Toolbar buttons - exclude color palette buttons */
.note-toolbar > .note-btn-group > .note-btn,
.note-toolbar > .note-btn-group > .note-btn-group > .note-btn {
    background: #fff !important;
    border: 1px solid var(--ms-gray-200) !important;
    border-radius: var(--ms-border-radius-sm) !important;
    padding: 6px 10px !important;
    color: var(--ms-gray-700) !important;
    font-size: 14px !important;
}

.note-toolbar > .note-btn-group > .note-btn:hover,
.note-toolbar > .note-btn-group > .note-btn-group > .note-btn:hover {
    background: var(--ms-gray-100) !important;
    border-color: var(--ms-gray-300) !important;
}

.note-toolbar > .note-btn-group > .note-btn.active,
.note-toolbar > .note-btn-group > .note-btn:active,
.note-toolbar > .note-btn-group > .note-btn-group > .note-btn.active,
.note-toolbar > .note-btn-group > .note-btn-group > .note-btn:active {
    background: var(--ms-primary) !important;
    border-color: var(--ms-primary) !important;
    color: #fff !important;
}

.note-editing-area {
    background: #fff !important;
}

.note-editable {
    padding: 16px !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    min-height: 150px !important;
}

.note-editable:focus {
    outline: none !important;
}

.note-editable p {
    margin-bottom: 1em;
}

.note-editable ul,
.note-editable ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.note-placeholder {
    color: var(--ms-gray-400) !important;
    padding: 16px !important;
}

.note-statusbar {
    display: none !important;
}

/* Code view styling */
.note-codable {
    background: var(--ms-gray-900) !important;
    color: #e5e7eb !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-size: 13px !important;
    padding: 16px !important;
}

/* Link dialog */
.note-modal-content {
    border-radius: var(--ms-border-radius) !important;
}

.note-modal-header {
    background: var(--ms-gray-50) !important;
    border-bottom: 1px solid var(--ms-gray-200) !important;
}

.note-modal-footer {
    background: var(--ms-gray-50) !important;
    border-top: 1px solid var(--ms-gray-200) !important;
}

/* Style dropdown (headings) */
.note-dropdown-menu {
    border: 1px solid var(--ms-gray-200) !important;
    border-radius: var(--ms-border-radius) !important;
    box-shadow: var(--ms-shadow-md) !important;
    padding: 4px 0 !important;
}

.note-dropdown-item {
    padding: 8px 16px !important;
    color: var(--ms-gray-700) !important;
}

.note-dropdown-item:hover {
    background: var(--ms-gray-100) !important;
}

/* Image in editor */
.note-editable img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ms-border-radius-sm);
    margin: 8px 0;
}

.note-editable img.note-float-left {
    margin-right: 16px;
}

.note-editable img.note-float-right {
    margin-left: 16px;
}

/* Video embed */
.note-editable iframe {
    max-width: 100%;
    border-radius: var(--ms-border-radius-sm);
    margin: 8px 0;
}

/* Fullscreen mode */
.note-editor.note-fullscreen {
    z-index: 99999 !important;
}

.note-editor.note-fullscreen .note-editable {
    background: #fff !important;
}

/* Headings in editor */
.note-editable h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 0.67em 0;
}

.note-editable h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0.75em 0;
}

.note-editable h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 0.83em 0;
}

.note-editable h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 1em 0;
}

.note-editable blockquote {
    border-left: 4px solid var(--ms-primary);
    padding-left: 16px;
    margin: 1em 0;
    color: var(--ms-gray-600);
    font-style: italic;
}

/* Make editor responsive */
@media (max-width: 600px) {
    .note-toolbar {
        flex-wrap: wrap;
    }
    
    .note-btn-group {
        margin-bottom: 4px;
    }
}

.ms-forum-form-group .description {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
    margin-top: 0.5rem;
}

.ms-forum-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--ms-border-color);
}

/* Pagination */
.ms-forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ms-border-color);
}

.ms-forum-pagination a,
.ms-forum-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: var(--ms-border-radius);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ms-forum-pagination a {
    background: white;
    color: var(--ms-text-color);
    border: 1px solid var(--ms-border-color);
}

.ms-forum-pagination a:hover {
    background: var(--ms-gray-100);
    border-color: var(--ms-primary-color);
}

.ms-forum-pagination span.current {
    background: var(--ms-primary-color);
    color: white;
    border: 1px solid var(--ms-primary-color);
}

.ms-forum-pagination span.dots {
    border: none;
    background: none;
}

/* Empty State */
.ms-forum-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--ms-gray-50);
    border-radius: var(--ms-border-radius-lg);
    border: 2px dashed var(--ms-border-color);
}

.ms-forum-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.ms-forum-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ms-text-color);
    margin: 0 0 0.5rem 0;
}

.ms-forum-empty p {
    color: var(--ms-text-muted);
    margin: 0 0 1.5rem 0;
}

/* Login Required */
.ms-forum-login-required {
    text-align: center;
    padding: 2rem;
    background: var(--ms-info-bg);
    border-radius: var(--ms-border-radius);
    border: 1px solid var(--ms-info-color);
}

.ms-forum-login-required p {
    color: var(--ms-info-color);
    margin: 0 0 1rem 0;
}

/* Loading State */
.ms-forum-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.ms-forum-loading::after {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid var(--ms-gray-200);
    border-top-color: var(--ms-primary-color);
    border-radius: 50%;
    animation: ms-forum-spin 0.8s linear infinite;
}

@keyframes ms-forum-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   FORUM JAVASCRIPT COMPONENT STYLES
   ========================================================================== */

/* Toast Notifications */
.ms-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.ms-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border-radius: var(--ms-border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.ms-toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.ms-toast .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.ms-toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--ms-text-color);
    line-height: 1.4;
}

.ms-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.ms-toast-close:hover {
    opacity: 1;
}

.ms-toast-close .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Toast Types */
.ms-toast-success {
    border-left: 4px solid var(--ms-success-color);
}

.ms-toast-success .dashicons {
    color: var(--ms-success-color);
}

.ms-toast-error {
    border-left: 4px solid var(--ms-error-color);
}

.ms-toast-error .dashicons {
    color: var(--ms-error-color);
}

.ms-toast-warning {
    border-left: 4px solid var(--ms-warning-color);
}

.ms-toast-warning .dashicons {
    color: var(--ms-warning-color);
}

.ms-toast-info {
    border-left: 4px solid var(--ms-info-color);
}

.ms-toast-info .dashicons {
    color: var(--ms-info-color);
}

/* Confirmation Modal */
.ms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.ms-modal-overlay.ms-modal-visible {
    opacity: 1;
}

.ms-modal {
    background: white;
    border-radius: var(--ms-border-radius-lg);
    width: 100%;
    max-width: 450px;
    min-width: 320px;
    transform: scale(0.9);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.ms-modal-visible .ms-modal {
    transform: scale(1);
}

.ms-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ms-text-color);
}

.ms-modal-body {
    padding: 1.5rem;
}

.ms-modal-body p {
    margin: 0;
    color: var(--ms-text-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.ms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 1rem 1.5rem;
    background: var(--ms-gray-50);
    border-top: 1px solid var(--ms-border-color);
    border-radius: 0 0 var(--ms-border-radius-lg) var(--ms-border-radius-lg);
}

/* Button Loading Spinner */
.ms-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: ms-spin 0.7s linear infinite;
}

.ms-btn-secondary .ms-spinner {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: var(--ms-text-color);
}

@keyframes ms-spin {
    to { transform: rotate(360deg); }
}

.ms-btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

/* Like Button States */
.ms-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
}

.ms-like-btn:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.ms-like-btn.ms-liked {
    background: #fef2f2;
    border-color: #ef4444;
    color: #ef4444;
}

.ms-like-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.ms-like-btn.ms-like-bounce .dashicons {
    animation: ms-like-bounce 0.4s ease;
}

@keyframes ms-like-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.ms-like-btn.ms-like-loading {
    pointer-events: none;
    opacity: 0.6;
}

.ms-like-count {
    font-weight: 600;
}

/* Form Validation States */
.ms-forum-form-group.ms-field-error input,
.ms-forum-form-group.ms-field-error textarea,
.ms-forum-form-group.ms-field-error select {
    border-color: var(--ms-error-color);
    background: #fef2f2;
}

.ms-forum-form-group.ms-field-success input,
.ms-forum-form-group.ms-field-success textarea,
.ms-forum-form-group.ms-field-success select {
    border-color: var(--ms-success-color);
}

.ms-required {
    color: var(--ms-error-color);
    margin-left: 4px;
}

/* Character Counter */
.ms-char-counter {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--ms-text-muted);
    margin-top: 4px;
}

.ms-char-counter.ms-counter-warning {
    color: var(--ms-warning-color);
}

.ms-char-counter.ms-counter-error {
    color: var(--ms-error-color);
    font-weight: 600;
}

/* Reply Deleting State */
.ms-forum-reply.ms-reply-deleting {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.ms-forum-reply.ms-reply-deleting::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--ms-gray-200);
    border-top-color: var(--ms-primary-color);
    border-radius: 50%;
    animation: ms-spin 0.7s linear infinite;
}

/* Quote Button */
.ms-quote-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    color: var(--ms-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ms-quote-btn:hover {
    color: var(--ms-primary-color);
}

.ms-quote-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Skeleton Loading */
.ms-skeleton {
    background: linear-gradient(90deg, var(--ms-gray-100) 25%, var(--ms-gray-200) 50%, var(--ms-gray-100) 75%);
    background-size: 200% 100%;
    animation: ms-skeleton-loading 1.5s infinite;
    border-radius: var(--ms-border-radius);
}

@keyframes ms-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ms-skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.ms-skeleton-text:last-child {
    width: 60%;
}

.ms-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

/* Forum Responsive */
@media (max-width: 768px) {
    .ms-forum {
        padding: 1rem;
    }

    .ms-forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ms-forum-header h1 {
        font-size: 1.5rem;
    }

    .ms-forum-category-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .ms-forum-category-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .ms-forum-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .ms-forum-thread-header {
        flex-direction: column;
    }

    .ms-forum-thread-stats {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: flex-start;
    }

    .ms-forum-post-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ms-forum-post-actions {
        margin-top: 1rem;
    }

    .ms-forum-form-actions {
        flex-direction: column;
    }

    .ms-forum-form-actions .ms-forum-btn {
        width: 100%;
        justify-content: center;
    }

    .ms-forum-pagination {
        flex-wrap: wrap;
    }

    /* Toast mobile */
    .ms-toast-container {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .ms-toast {
        transform: translateY(120%);
    }

    .ms-toast-visible {
        transform: translateY(0);
    }
}

/* ==========================================================================
   Forum Notifications
   ========================================================================== */

.ms-notifications {
    position: relative;
    display: inline-block;
}

.ms-notifications-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ms-notifications-toggle:hover {
    background: #e0e0e0;
}

.ms-notifications-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #666;
}

.ms-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #dc3545;
    border-radius: 9px;
}

.ms-notifications-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.ms-notifications-dropdown.ms-dropdown-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(8px);
}

.ms-notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.ms-notifications-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.ms-mark-all-read {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
}

.ms-mark-all-read:hover {
    color: #333;
    text-decoration: underline;
}

.ms-notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.ms-notifications-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.ms-notifications-empty,
.ms-notifications-error {
    margin: 0;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.ms-notification-item {
    display: flex;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.ms-notification-item:hover {
    background-color: #f8f9fa;
}

.ms-notification-item:last-child {
    border-bottom: none;
}

.ms-notification-item:not(.ms-notification-read) {
    background-color: #f0f7ff;
}

.ms-notification-item:not(.ms-notification-read):hover {
    background-color: #e5f0ff;
}

.ms-notification-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border-radius: 50%;
}

.ms-notification-item:not(.ms-notification-read) .ms-notification-icon {
    background: #4f46e5;
    color: #fff;
}

.ms-notification-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-notification-content {
    flex: 1;
    min-width: 0;
}

.ms-notification-message {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
    word-wrap: break-word;
}

.ms-notification-time {
    font-size: 11px;
    color: #999;
}

.ms-notifications-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    text-align: center;
}

.ms-notifications-footer a {
    font-size: 13px;
    color: #4f46e5;
    text-decoration: none;
}

.ms-notifications-footer a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Subscription Button
   ========================================================================== */

.ms-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-subscribe-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.ms-subscribe-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-subscribe-btn.ms-subscribed {
    background: #e8f5e9;
    color: #2e7d32;
}

.ms-subscribe-btn.ms-subscribed:hover {
    background: #c8e6c9;
}

/* Thread actions with subscription */
.ms-thread-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Notifications Mobile
   ========================================================================== */

@media (max-width: 480px) {
    .ms-notifications-dropdown {
        position: fixed;
        top: auto;
        right: 10px;
        left: 10px;
        bottom: 10px;
        width: auto;
        max-width: none;
        max-height: 70vh;
        border-radius: 12px;
    }

    .ms-notifications-list {
        max-height: calc(70vh - 100px);
    }

    .ms-notification-item {
        padding: 12px 15px;
    }

    .ms-subscribe-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Forum Moderation
   ========================================================================== */

/* Moderation action buttons */
.ms-mod-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.ms-mod-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #666;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-mod-btn:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.ms-mod-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ms-mod-btn.ms-mod-edit:hover {
    color: #0073aa;
    border-color: #0073aa;
}

.ms-mod-btn.ms-mod-delete:hover {
    color: #dc3545;
    border-color: #dc3545;
}

.ms-mod-btn.ms-mod-pin.ms-pinned {
    color: #f0ad4e;
    border-color: #f0ad4e;
    background: #fff8e6;
}

.ms-mod-btn.ms-mod-close.ms-closed {
    color: #5cb85c;
    border-color: #5cb85c;
    background: #f0fff0;
}

/* Report button (for all users) */
.ms-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 12px;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ms-report-btn:hover {
    color: #dc3545;
}

.ms-report-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Pinned thread indicator */
.ms-thread-pinned .ms-thread-title::before,
.ms-thread-row.ms-pinned .ms-thread-title::before {
    content: "\f537";
    font-family: dashicons;
    margin-right: 8px;
    color: #f0ad4e;
}

.ms-thread-pinned,
.ms-thread-row.ms-pinned {
    background-color: #fffcf0 !important;
    border-left: 3px solid #f0ad4e;
}

/* Closed thread indicator */
.ms-thread-closed .ms-thread-title::after,
.ms-thread-row.ms-closed .ms-thread-title::after {
    content: "Geschlossen";
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    font-size: 10px;
    color: #666;
    background: #f0f0f0;
    border-radius: 3px;
}

/* Edited indicator */
.ms-edited-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    font-size: 11px;
    color: #999;
    font-style: italic;
}

.ms-edited-indicator .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Edit Modal styles (different from confirm modal) */
.ms-edit-modal-overlay {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ms-modal-fade-in 0.2s ease;
}

.ms-edit-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ms-modal-slide-in 0.2s ease;
}

.ms-edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-edit-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ms-gray-800);
}

.ms-edit-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: var(--ms-gray-500);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-edit-modal-close:hover {
    color: var(--ms-gray-700);
    background: var(--ms-gray-100);
}

.ms-edit-modal-body {
    padding: 20px;
}

.ms-edit-modal-body .ms-forum-form-group {
    margin-bottom: 20px;
}

.ms-edit-modal-body .ms-forum-form-group:last-of-type {
    margin-bottom: 0;
}

.ms-edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--ms-gray-200);
    background: var(--ms-gray-50);
    border-radius: 0 0 12px 12px;
}

/* Summernote inside edit modal */
.ms-edit-modal-body .note-editor {
    border-radius: var(--ms-border-radius) !important;
}

.ms-edit-modal-body .note-editable {
    min-height: 120px !important;
}

@keyframes ms-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ms-edit-modal-content,
.ms-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ms-modal-slide-in 0.2s ease;
}

@keyframes ms-modal-slide-in {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ms-edit-modal-overlay .ms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.ms-edit-modal-overlay .ms-modal-header h3,
.ms-edit-modal-overlay .ms-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ms-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: #666;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.ms-modal-body {
    padding: 20px;
}

.ms-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.ms-modal-body input[type="text"],
.ms-modal-body textarea,
.ms-modal-body select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ms-modal-body input[type="text"]:focus,
.ms-modal-body textarea:focus,
.ms-modal-body select:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    outline: none;
}

.ms-modal-body textarea {
    resize: vertical;
    min-height: 100px;
}

.ms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
    border-radius: 0 0 12px 12px;
}

.ms-form-field {
    margin-bottom: 15px;
}

.ms-form-field:last-child {
    margin-bottom: 0;
}

/* Generic button styles for modals */
.ms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ms-btn-primary {
    color: #fff;
    background: #0073aa;
}

.ms-btn-primary:hover:not(:disabled) {
    background: #005a87;
}

.ms-btn-secondary {
    color: #333;
    background: #e5e5e5;
}

.ms-btn-secondary:hover:not(:disabled) {
    background: #d5d5d5;
}

.ms-btn-danger {
    color: #fff;
    background: #dc3545;
}

.ms-btn-danger:hover:not(:disabled) {
    background: #c82333;
}

/* Ban user button */
.ms-ban-user-btn {
    color: #dc3545;
}

.ms-ban-user-btn:hover {
    background: #fee2e2;
}

/* Banned user banner */
.ms-banned-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
}

.ms-banned-notice .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ms-banned-notice h3 {
    margin: 0 0 5px;
    font-size: 16px;
}

.ms-banned-notice p {
    margin: 0;
    font-size: 14px;
}

/* Moderation responsive */
@media (max-width: 600px) {
    .ms-mod-actions {
        flex-wrap: wrap;
    }

    .ms-modal-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }

    .ms-modal-footer {
        flex-direction: column;
    }

    .ms-modal-footer .ms-btn {
        width: 100%;
    }
}

/* ==========================================================================
   Forum Search
   ========================================================================== */

/* Search Header */
.ms-search-header {
    margin-bottom: 30px;
}

.ms-search-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-text-color);
}

.ms-search-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--ms-primary-color);
}

/* Search Form */
.ms-search-form {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.ms-search-input-wrapper {
    position: relative;
    flex: 1;
}

.ms-search-input {
    width: 100%;
    padding: 14px 50px 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--ms-border-color);
    border-radius: 10px;
    background: white;
    transition: all 0.2s ease;
}

.ms-search-input:focus {
    outline: none;
    border-color: var(--ms-primary-color);
    box-shadow: 0 0 0 4px rgba(var(--ms-primary-rgb), 0.1);
}

.ms-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ms-search-submit:hover {
    background: var(--ms-primary-dark);
}

.ms-search-submit .dashicons {
    color: white;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: white;
    border: 2px solid var(--ms-border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ms-text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-filter-toggle:hover,
.ms-filter-toggle.ms-active {
    border-color: var(--ms-primary-color);
    color: var(--ms-primary-color);
}

.ms-filter-toggle .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Search Filters */
.ms-search-filters {
    margin-top: 20px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--ms-border-color);
}

.ms-filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.ms-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ms-filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ms-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ms-filter-select {
    padding: 10px 14px;
    font-size: 0.95rem;
    border: 1px solid var(--ms-border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.ms-filter-select:focus {
    outline: none;
    border-color: var(--ms-primary-color);
}

.ms-filter-actions {
    display: flex;
    gap: 12px;
}

/* Autocomplete Dropdown */
.ms-search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.ms-autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--ms-text-muted);
}

.ms-autocomplete-loading .ms-spinner {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--ms-primary-color);
}

.ms-autocomplete-results {
    max-height: 400px;
    overflow-y: auto;
}

.ms-autocomplete-header {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ms-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--ms-text-color);
    transition: background 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
}

.ms-autocomplete-item:last-child {
    border-bottom: none;
}

.ms-autocomplete-item:hover,
.ms-autocomplete-item.ms-active {
    background: #f8fafc;
}

.ms-autocomplete-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    color: var(--ms-text-muted);
}

.ms-autocomplete-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-autocomplete-content {
    flex: 1;
    min-width: 0;
}

.ms-autocomplete-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-autocomplete-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

.ms-autocomplete-type {
    padding: 2px 8px;
    background: #e2e8f0;
    border-radius: 4px;
    font-weight: 500;
}

.ms-autocomplete-category {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ms-autocomplete-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: #f8fafc;
    border-top: 1px solid var(--ms-border-color);
    color: var(--ms-primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
}

.ms-autocomplete-more:hover {
    background: #f1f5f9;
}

.ms-autocomplete-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    color: var(--ms-text-muted);
}

.ms-recent-item {
    position: relative;
}

.ms-remove-recent {
    position: absolute;
    right: 12px;
    padding: 4px;
    background: none;
    border: none;
    color: var(--ms-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ms-recent-item:hover .ms-remove-recent {
    opacity: 1;
}

.ms-remove-recent:hover {
    color: var(--ms-error-color);
}

/* Search Results */
.ms-search-results {
    margin-top: 30px;
}

.ms-search-meta {
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-results-count {
    font-size: 0.95rem;
    color: var(--ms-text-muted);
}

.ms-results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Search Result Item */
.ms-search-result {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.ms-search-result:hover {
    border-color: var(--ms-primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ms-result-badge {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 60px;
    padding: 12px 8px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--ms-text-muted);
    text-transform: uppercase;
}

.ms-result-badge .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-primary-color);
}

.ms-result-thread .ms-result-badge {
    background: #eff6ff;
}

.ms-result-reply .ms-result-badge {
    background: #f0fdf4;
}

.ms-result-reply .ms-result-badge .dashicons {
    color: #22c55e;
}

.ms-result-content {
    flex: 1;
    min-width: 0;
}

.ms-result-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
}

.ms-result-title a {
    color: var(--ms-text-color);
    text-decoration: none;
}

.ms-result-title a:hover {
    color: var(--ms-primary-color);
}

.ms-result-title mark,
.ms-result-title .ms-highlight {
    background: #fef08a;
    padding: 0 2px;
    border-radius: 2px;
}

.ms-pinned-badge {
    display: inline-flex;
    margin-left: 8px;
    color: var(--ms-primary-color);
    vertical-align: middle;
}

.ms-pinned-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-closed-badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ms-text-muted);
    vertical-align: middle;
}

.ms-result-excerpt {
    margin: 0 0 12px;
    color: var(--ms-text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ms-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--ms-text-muted);
}

.ms-result-meta > span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ms-result-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.ms-result-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-result-author .ms-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Search Empty States */
.ms-search-empty {
    text-align: center;
    padding: 60px 20px;
}

.ms-search-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--ms-border-color);
    margin-bottom: 16px;
}

.ms-search-empty h2 {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--ms-text-color);
}

.ms-search-empty p {
    margin: 0;
    color: var(--ms-text-muted);
}

.ms-search-suggestions {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    display: inline-block;
    text-align: left;
}

.ms-search-suggestions h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.ms-search-suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.ms-search-suggestions li {
    margin-bottom: 6px;
    color: var(--ms-text-muted);
}

/* Popular Searches */
.ms-popular-searches {
    margin-top: 40px;
}

.ms-popular-searches h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: var(--ms-text-muted);
}

.ms-popular-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.ms-popular-tag {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--ms-text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ms-popular-tag:hover {
    border-color: var(--ms-primary-color);
    color: var(--ms-primary-color);
    background: #f8fafc;
}

/* Search Pagination */
.ms-search-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ms-search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--ms-text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ms-search-pagination .page-numbers:hover {
    border-color: var(--ms-primary-color);
    color: var(--ms-primary-color);
}

.ms-search-pagination .page-numbers.current {
    background: var(--ms-primary-color);
    border-color: var(--ms-primary-color);
    color: white;
}

.ms-search-pagination .page-numbers .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Header Search Button */
.ms-header-search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid var(--ms-border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-header-search-btn:hover {
    border-color: var(--ms-primary-color);
    color: var(--ms-primary-color);
}

.ms-header-search-btn kbd {
    display: inline-block;
    padding: 2px 6px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
}

/* Search Responsive */
@media (max-width: 768px) {
    .ms-search-form {
        flex-direction: column;
    }

    .ms-filter-toggle {
        justify-content: center;
    }

    .ms-filter-row {
        grid-template-columns: 1fr 1fr;
    }

    .ms-filter-actions {
        flex-direction: column;
    }

    .ms-search-result {
        flex-direction: column;
    }

    .ms-result-badge {
        flex-direction: row;
        width: auto;
    }

    .ms-result-meta {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .ms-filter-row {
        grid-template-columns: 1fr;
    }

    .ms-popular-tags {
        flex-direction: column;
    }

    .ms-popular-tag {
        text-align: center;
    }
}

/* ============================================
   PHASE 8: BENUTZERPROFILE & STATISTIKEN
   ============================================ */

/* ===========================================
   8.1 PROFILE PAGE
   =========================================== */

.ms-profile {
    max-width: 1000px;
    margin: 0 auto;
}

/* Profile Header */
.ms-profile-header {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 12px;
    margin-bottom: 24px;
}

.ms-profile-avatar-section {
    flex-shrink: 0;
    text-align: center;
}

.ms-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--ms-primary-color);
    margin-bottom: 12px;
}

.ms-profile-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--ms-primary-color), #6366f1);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ms-profile-level .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Profile Info */
.ms-profile-info {
    flex: 1;
    min-width: 0;
}

.ms-profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ms-profile-name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-text-color);
}

.ms-profile-rank {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid var(--ms-border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

.ms-profile-rank .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #f59e0b;
}

/* Profile Meta */
.ms-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    color: var(--ms-text-muted);
    font-size: 0.9rem;
}

.ms-profile-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ms-profile-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Reputation Progress */
.ms-reputation-progress {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.ms-reputation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ms-reputation-label {
    font-size: 0.9rem;
    color: var(--ms-text-muted);
}

.ms-reputation-points {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ms-primary-color);
}

.ms-reputation-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ms-reputation-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ms-primary-color), #6366f1);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ms-reputation-next {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

/* Profile Stats Summary */
.ms-profile-stats-summary {
    display: flex;
    gap: 30px;
    flex-shrink: 0;
}

.ms-profile-stat {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 80px;
}

.ms-profile-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-text-color);
    margin-bottom: 4px;
}

.ms-profile-stat-label {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

/* Profile Actions */
.ms-profile-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ms-border-color, #e5e7eb);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.ms-profile-actions .ms-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-profile-actions .ms-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-send-message-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ms-send-message-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Block/Unblock Button Styles */
.ms-block-user,
.ms-unblock-user {
    color: var(--ms-text-muted) !important;
    background: transparent !important;
    border: 1px solid var(--ms-border-color, #e5e7eb) !important;
}

.ms-block-user:hover {
    color: var(--ms-danger, #ef4444) !important;
    border-color: var(--ms-danger, #ef4444) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.ms-unblock-user:hover {
    color: var(--ms-success, #10b981) !important;
    border-color: var(--ms-success, #10b981) !important;
    background: rgba(16, 185, 129, 0.05) !important;
}

.ms-block-user.ms-loading,
.ms-unblock-user.ms-loading {
    opacity: 0.7;
    pointer-events: none;
}

.ms-btn-text {
    background: transparent !important;
    border: none !important;
    padding: 0.5rem 0.75rem !important;
}

/* Profile Tabs */
.ms-profile-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.ms-profile-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ms-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ms-profile-tab:hover {
    background: #f8fafc;
    color: var(--ms-text-color);
}

.ms-profile-tab.active {
    background: var(--ms-primary-color);
    color: white;
}

.ms-profile-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-profile-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ms-profile-tab.active .ms-profile-tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Profile Tab Content */
.ms-profile-tab-content {
    display: none;
}

.ms-profile-tab-content.active {
    display: block;
}

/* ===========================================
   8.2 PROFILE OVERVIEW TAB
   =========================================== */

.ms-profile-overview {
    display: grid;
    gap: 24px;
}

/* Stats Grid */
.ms-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.ms-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.ms-stat-card:hover {
    border-color: var(--ms-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ms-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    color: white;
}

.ms-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.ms-stat-icon.threads { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.ms-stat-icon.replies { background: linear-gradient(135deg, #10b981, #059669); }
.ms-stat-icon.likes { background: linear-gradient(135deg, #f43f5e, #dc2626); }
.ms-stat-icon.given { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ms-stat-icon.views { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.ms-stat-icon.reputation { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.ms-stat-content {
    flex: 1;
}

.ms-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ms-text-color);
    line-height: 1.2;
}

.ms-stat-label {
    font-size: 0.85rem;
    color: var(--ms-text-muted);
}

/* Profile Sections */
.ms-profile-section {
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.ms-profile-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-profile-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.ms-profile-section-link {
    font-size: 0.9rem;
    color: var(--ms-primary-color);
    text-decoration: none;
}

.ms-profile-section-link:hover {
    text-decoration: underline;
}

/* Recent Badges */
.ms-recent-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
}

.ms-recent-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 180px;
}

.ms-recent-badge-icon {
    font-size: 28px;
}

.ms-recent-badge-info {
    flex: 1;
}

.ms-recent-badge-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ms-text-color);
}

.ms-recent-badge-date {
    font-size: 0.75rem;
    color: var(--ms-text-muted);
}

/* Recent Activity */
.ms-recent-activity-list {
    padding: 0;
}

.ms-activity-item {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border-color);
    transition: background 0.2s ease;
}

.ms-activity-item:last-child {
    border-bottom: none;
}

.ms-activity-item:hover {
    background: #f8fafc;
}

.ms-activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ms-activity-icon.thread {
    background: #dbeafe;
    color: #2563eb;
}

.ms-activity-icon.reply {
    background: #d1fae5;
    color: #059669;
}

.ms-activity-icon.like {
    background: #fee2e2;
    color: #dc2626;
}

.ms-activity-icon.badge {
    background: #fef3c7;
    color: #d97706;
}

.ms-activity-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-activity-content {
    flex: 1;
    min-width: 0;
}

.ms-activity-text {
    margin: 0 0 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.ms-activity-text a {
    color: var(--ms-primary-color);
    text-decoration: none;
    font-weight: 500;
}

.ms-activity-text a:hover {
    text-decoration: underline;
}

.ms-activity-time {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

/* ===========================================
   8.3 ACTIVITY TIMELINE TAB
   =========================================== */

.ms-activity-timeline {
    padding: 20px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
}

.ms-activity-day {
    margin-bottom: 30px;
}

.ms-activity-day:last-child {
    margin-bottom: 0;
}

.ms-activity-date {
    display: inline-block;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ms-text-muted);
    margin-bottom: 16px;
}

.ms-timeline-items {
    position: relative;
    padding-left: 30px;
}

.ms-timeline-items::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.ms-timeline-item {
    position: relative;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 12px;
}

.ms-timeline-item:last-child {
    margin-bottom: 0;
}

.ms-timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--ms-primary-color);
    border-radius: 50%;
}

.ms-timeline-item.reply::before {
    border-color: #10b981;
}

.ms-timeline-type {
    display: inline-block;
    padding: 3px 8px;
    background: var(--ms-primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ms-timeline-item.reply .ms-timeline-type {
    background: #10b981;
}

.ms-timeline-title {
    margin: 0 0 6px;
    font-size: 1rem;
}

.ms-timeline-title a {
    color: var(--ms-text-color);
    text-decoration: none;
}

.ms-timeline-title a:hover {
    color: var(--ms-primary-color);
}

.ms-timeline-excerpt {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
    line-height: 1.5;
}

.ms-timeline-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

.ms-timeline-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ms-timeline-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ===========================================
   8.4 THREADS & REPLIES TABS
   =========================================== */

.ms-profile-threads-list,
.ms-profile-replies-list,
.ms-profile-likes-list {
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.ms-profile-thread-item,
.ms-profile-reply-item,
.ms-profile-like-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border-color);
    transition: background 0.2s ease;
}

.ms-profile-thread-item:last-child,
.ms-profile-reply-item:last-child,
.ms-profile-like-item:last-child {
    border-bottom: none;
}

.ms-profile-thread-item:hover,
.ms-profile-reply-item:hover,
.ms-profile-like-item:hover {
    background: #f8fafc;
}

.ms-thread-icon,
.ms-reply-icon,
.ms-like-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.ms-thread-icon {
    background: #dbeafe;
    color: #2563eb;
}

.ms-reply-icon {
    background: #d1fae5;
    color: #059669;
}

.ms-like-icon {
    background: #fee2e2;
    color: #dc2626;
}

.ms-thread-icon .dashicons,
.ms-reply-icon .dashicons,
.ms-like-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ms-thread-content,
.ms-reply-content,
.ms-like-content {
    flex: 1;
    min-width: 0;
}

.ms-thread-title,
.ms-reply-title,
.ms-like-title {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 600;
}

.ms-thread-title a,
.ms-reply-title a,
.ms-like-title a {
    color: var(--ms-text-color);
    text-decoration: none;
}

.ms-thread-title a:hover,
.ms-reply-title a:hover,
.ms-like-title a:hover {
    color: var(--ms-primary-color);
}

.ms-thread-badges {
    display: inline-flex;
    gap: 6px;
    margin-left: 8px;
}

.ms-thread-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ms-thread-badge.pinned {
    background: #fef3c7;
    color: #d97706;
}

.ms-thread-badge.closed {
    background: #fee2e2;
    color: #dc2626;
}

.ms-thread-meta,
.ms-reply-meta,
.ms-like-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--ms-text-muted);
}

.ms-thread-meta span,
.ms-reply-meta span,
.ms-like-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ms-thread-meta .dashicons,
.ms-reply-meta .dashicons,
.ms-like-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.ms-reply-excerpt,
.ms-like-excerpt {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
    line-height: 1.5;
}

.ms-reply-thread-link,
.ms-like-thread-link {
    font-size: 0.85rem;
    color: var(--ms-text-muted);
}

.ms-reply-thread-link a,
.ms-like-thread-link a {
    color: var(--ms-primary-color);
    text-decoration: none;
}

.ms-reply-thread-link a:hover,
.ms-like-thread-link a:hover {
    text-decoration: underline;
}

/* ===========================================
   8.5 BADGES TAB
   =========================================== */

.ms-profile-badges {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ms-badge-category {
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.ms-badge-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-badge-category-icon {
    font-size: 24px;
}

.ms-badge-category-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.ms-badge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}

.ms-badge-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.ms-badge-item.earned {
    background: white;
    border-color: var(--ms-border-color);
}

.ms-badge-item.earned:hover {
    border-color: var(--ms-primary-color);
}

.ms-badge-item.locked {
    opacity: 0.6;
}

.ms-badge-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.ms-badge-item.locked .ms-badge-icon {
    filter: grayscale(100%);
}

.ms-badge-info {
    flex: 1;
    min-width: 0;
}

.ms-badge-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ms-badge-name span {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--ms-text-color);
}

.ms-badge-rarity {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ms-badge-rarity.common { background: #e2e8f0; color: #64748b; }
.ms-badge-rarity.uncommon { background: #d1fae5; color: #059669; }
.ms-badge-rarity.rare { background: #dbeafe; color: #2563eb; }
.ms-badge-rarity.epic { background: #e9d5ff; color: #7c3aed; }
.ms-badge-rarity.legendary { background: #fef3c7; color: #d97706; }

.ms-badge-description {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: var(--ms-text-muted);
    line-height: 1.4;
}

.ms-badge-earned-date {
    font-size: 0.8rem;
    color: #10b981;
}

.ms-badge-earned-date .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* Badge Progress */
.ms-badge-progress {
    margin-top: 8px;
}

.ms-badge-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.ms-badge-progress-fill {
    height: 100%;
    background: var(--ms-primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.ms-badge-progress-text {
    font-size: 0.75rem;
    color: var(--ms-text-muted);
}

/* ===========================================
   8.6 LEADERBOARD
   =========================================== */

.ms-leaderboard {
    max-width: 900px;
    margin: 0 auto;
}

.ms-leaderboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.ms-leaderboard-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 8px;
    font-size: 1.75rem;
}

.ms-leaderboard-title .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #f59e0b;
}

.ms-leaderboard-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--ms-text-muted);
}

/* Leaderboard Filters */
.ms-leaderboard-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;
}

.ms-leaderboard-filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ms-leaderboard-filter-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ms-text-muted);
    white-space: nowrap;
}

.ms-leaderboard-filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 8px;
    flex-wrap: wrap;
}

.ms-leaderboard-filter-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ms-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ms-leaderboard-filter-tab:hover {
    color: var(--ms-text-color);
}

.ms-leaderboard-filter-tab.active {
    background: white;
    color: var(--ms-primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Podium (Top 3) */
.ms-leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, white 100%);
    border-radius: 16px;
}

.ms-podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
}

.ms-podium-item:nth-child(1) { order: 2; } /* 1st place center */
.ms-podium-item:nth-child(2) { order: 1; } /* 2nd place left */
.ms-podium-item:nth-child(3) { order: 3; } /* 3rd place right */

.ms-podium-avatar-wrap {
    position: relative;
    margin-bottom: 12px;
}

.ms-podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
    transition: transform 0.2s ease;
}

.ms-podium-item:hover .ms-podium-avatar {
    transform: scale(1.05);
}

/* First place larger avatar */
.ms-podium-item:nth-child(1) .ms-podium-avatar {
    width: 100px;
    height: 100px;
    border-color: #fbbf24;
}

/* Second place */
.ms-podium-item:nth-child(2) .ms-podium-avatar {
    border-color: #9ca3af;
}

/* Third place */
.ms-podium-item:nth-child(3) .ms-podium-avatar {
    border-color: #d97706;
}

.ms-podium-medal {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ms-podium-medal.gold { background: linear-gradient(135deg, #fbbf24, #d97706); }
.ms-podium-medal.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.ms-podium-medal.bronze { background: linear-gradient(135deg, #d97706, #b45309); }

.ms-podium-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-text-color);
    margin-bottom: 4px;
}

.ms-podium-level {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
    margin-bottom: 8px;
}

.ms-podium-score {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f8fafc;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ms-primary-color);
}

.ms-podium-score .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-podium-stand {
    width: 100%;
    margin-top: 16px;
    border-radius: 8px 8px 0 0;
}

.ms-podium-item:nth-child(1) .ms-podium-stand {
    height: 80px;
    background: linear-gradient(180deg, #fbbf24, #d97706);
}

.ms-podium-item:nth-child(2) .ms-podium-stand {
    height: 60px;
    background: linear-gradient(180deg, #9ca3af, #6b7280);
}

.ms-podium-item:nth-child(3) .ms-podium-stand {
    height: 40px;
    background: linear-gradient(180deg, #d97706, #b45309);
}

/* Leaderboard Table */
.ms-leaderboard-table-wrap {
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 12px;
    overflow: hidden;
}

.ms-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.ms-leaderboard-table th {
    padding: 14px 20px;
    background: #f8fafc;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ms-text-muted);
    text-align: left;
    border-bottom: 1px solid var(--ms-border-color);
}

.ms-leaderboard-table th:first-child {
    width: 60px;
    text-align: center;
}

.ms-leaderboard-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border-color);
    vertical-align: middle;
}

.ms-leaderboard-table tr:last-child td {
    border-bottom: none;
}

.ms-leaderboard-table tbody tr {
    transition: background 0.2s ease;
}

.ms-leaderboard-table tbody tr:hover {
    background: #f8fafc;
}

.ms-leaderboard-table tbody tr.current-user {
    background: #eff6ff;
}

/* Rank Badge */
.ms-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
}

.ms-rank-badge.rank-1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: white; }
.ms-rank-badge.rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
.ms-rank-badge.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.ms-rank-badge.rank-default { background: #f1f5f9; color: var(--ms-text-muted); }

/* User Cell */
.ms-leaderboard-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ms-leaderboard-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.ms-leaderboard-user-info {
    flex: 1;
    min-width: 0;
}

.ms-leaderboard-user-name {
    display: block;
    font-weight: 600;
    color: var(--ms-text-color);
    text-decoration: none;
    margin-bottom: 2px;
}

.ms-leaderboard-user-name:hover {
    color: var(--ms-primary-color);
}

.ms-leaderboard-user-level {
    font-size: 0.8rem;
    color: var(--ms-text-muted);
}

/* Score Cell */
.ms-leaderboard-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ms-primary-color);
}

.ms-leaderboard-score .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Stats Cell */
.ms-leaderboard-stats {
    display: flex;
    gap: 20px;
}

.ms-leaderboard-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ms-text-muted);
    font-size: 0.9rem;
}

.ms-leaderboard-stat .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Leaderboard Legend */
.ms-leaderboard-legend {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.ms-leaderboard-legend h4 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--ms-text-muted);
}

.ms-leaderboard-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.ms-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--ms-text-color);
}

.ms-legend-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-primary-color);
}

.ms-legend-points {
    font-weight: 600;
    color: var(--ms-primary-color);
}

/* ===========================================
   8.7 PROFILE EMPTY STATES
   =========================================== */

.ms-profile-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border: 1px solid var(--ms-border-color);
    border-radius: 10px;
}

.ms-profile-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #f8fafc;
    border-radius: 50%;
    color: var(--ms-text-muted);
}

.ms-profile-empty-icon .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
}

.ms-profile-empty h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: var(--ms-text-color);
}

.ms-profile-empty p {
    margin: 0;
    color: var(--ms-text-muted);
}

/* ===========================================
   8.8 PROFILE RESPONSIVE
   =========================================== */

@media (max-width: 768px) {
    .ms-profile-header {
        flex-direction: column;
        text-align: center;
    }

    .ms-profile-name-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    .ms-profile-meta {
        justify-content: center;
    }

    .ms-profile-stats-summary {
        justify-content: center;
    }

    .ms-profile-tabs {
        justify-content: flex-start;
    }

    .ms-profile-tab {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .ms-profile-tab .dashicons {
        display: none;
    }

    .ms-profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ms-stat-card {
        padding: 16px;
    }

    .ms-stat-icon {
        width: 40px;
        height: 40px;
    }

    .ms-stat-icon .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }

    .ms-stat-value {
        font-size: 1.25rem;
    }

    .ms-leaderboard-podium {
        flex-direction: column;
        align-items: center;
    }

    .ms-podium-item {
        order: unset !important;
        width: 100%;
        max-width: 200px;
    }

    .ms-podium-item:nth-child(1) {
        order: -1 !important;
    }

    .ms-podium-stand {
        display: none;
    }

    .ms-leaderboard-table th:nth-child(4),
    .ms-leaderboard-table td:nth-child(4) {
        display: none;
    }

    .ms-badge-list {
        grid-template-columns: 1fr;
    }

    .ms-timeline-items {
        padding-left: 20px;
    }

    .ms-timeline-item::before {
        left: -16px;
    }

    .ms-leaderboard-filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .ms-profile-avatar {
        width: 100px;
        height: 100px;
    }

    .ms-profile-name {
        font-size: 1.5rem;
    }

    .ms-profile-stats-summary {
        gap: 15px;
    }

    .ms-profile-stat {
        padding: 12px;
        min-width: 60px;
    }

    .ms-profile-stat-value {
        font-size: 1.25rem;
    }

    .ms-profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .ms-leaderboard-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* ==========================================================================
   LIVE CHAT STYLES
   ========================================================================== */

/* Chat CSS Variables */
.ms-chat {
    --chat-primary: var(--ms-primary);
    --chat-primary-hover: var(--ms-primary-hover);
    --chat-primary-light: var(--ms-primary-light);
    --chat-success: var(--ms-success);
    --chat-warning: var(--ms-warning);
    --chat-error: var(--ms-error);
    --chat-bg: #ffffff;
    --chat-sidebar-bg: var(--ms-gray-50);
    --chat-border: var(--ms-gray-200);
    --chat-text: var(--ms-gray-900);
    --chat-text-muted: var(--ms-gray-500);
    --chat-message-own: var(--ms-primary);
    --chat-message-other: var(--ms-gray-100);
    --chat-online: #22c55e;
    --chat-away: #f59e0b;
    --chat-offline: var(--ms-gray-400);
}

/* Chat Container */
.ms-chat {
    display: flex;
    width: 100%;
    height: 600px;
    max-height: calc(100vh - 200px);
    min-height: 400px;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--ms-border-radius-lg);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Chat Sidebar */
.ms-chat-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--chat-sidebar-bg);
    border-right: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ms-chat-sidebar-header {
    padding: 16px;
    margin-top: 4px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--chat-bg);
}

.ms-chat-sidebar-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--chat-text);
}

.ms-chat-new-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--chat-primary);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ms-transition);
}

.ms-chat-new-btn:hover {
    background: var(--chat-primary-hover);
    transform: scale(1.05);
}

.ms-chat-new-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Chat Room List */
.ms-chat-rooms {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.ms-chat-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--chat-text-muted);
    padding: 12px 8px 8px;
    letter-spacing: 0.5px;
}

.ms-chat-room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    transition: var(--ms-transition);
    text-decoration: none;
    color: var(--chat-text);
}

.ms-chat-room-item:hover {
    background: var(--ms-gray-100);
}

.ms-chat-room-item.active {
    background: var(--chat-primary-light);
}

.ms-chat-room-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ms-border-radius);
    background: var(--chat-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ms-chat-room-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.ms-chat-room-icon.dm {
    border-radius: 50%;
    background: var(--ms-gray-300);
}

.ms-chat-room-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ms-chat-room-name {
    font-weight: 500;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-chat-room-preview {
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-chat-room-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.ms-chat-room-time {
    font-size: 0.75rem;
    color: var(--chat-text-muted);
}

.ms-chat-unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--chat-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Main Area */
.ms-chat-main {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--chat-bg);
}

.ms-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--chat-text-muted);
    padding: 40px;
    text-align: center;
}

.ms-chat-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.ms-chat-empty p {
    margin: 0;
    font-size: 1rem;
}

/* Chat Room Header */
.ms-chat-room-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--chat-bg);
}

.ms-chat-sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ms-chat-sidebar-toggle:hover {
    background: var(--ms-gray-100);
    color: var(--chat-text);
}

.ms-chat-room-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ms-chat-room-header-info .ms-chat-room-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--ms-primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ms-chat-room-header-info .ms-chat-room-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-primary);
}

.ms-chat-room-details {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.ms-chat-room-title {
    margin: 0;
    margin-top: 5px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--chat-text);
    line-height: 0.9 !important;
}

.ms-chat-room-desc-row {
    display: flex;
    align-items: center;
    column-gap: 12px; /* ~5 spaces optically */
    row-gap: 0;
    min-width: 0;
    margin-top: -2px;
    line-height: 1.25;
}

.ms-chat-room-desc {
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

.ms-chat-room-online-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.ms-chat-online-indicator {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: var(--chat-online);
    border-radius: 50%;
    flex-shrink: 0;
}

.ms-chat-room-online-count {
    color: var(--chat-text-muted);
    white-space: nowrap;
}

.ms-chat-room-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.ms-chat-room-actions button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ms-transition);
}

.ms-chat-room-actions button:hover {
    background: var(--ms-gray-100);
    color: var(--chat-text);
}

.ms-chat-room-actions button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Chat Messages Area */
.ms-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ms-chat-messages-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Message Group (same sender) */
.ms-chat-message-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 12px;
}

.ms-chat-message-group.own {
    align-items: flex-end;
}

.ms-chat-message-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 4px;
}

.ms-chat-message-group.own .ms-chat-message-group-header {
    flex-direction: row-reverse;
}

.ms-chat-message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--ms-gray-300);
    overflow: hidden;
    flex-shrink: 0;
}

.ms-chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-chat-message-sender {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--chat-text);
}

.ms-chat-message-time {
    font-size: 0.75rem;
    color: var(--chat-text-muted);
}

/* Individual Message */
.ms-chat-message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9375rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.ms-chat-message-group:not(.own) .ms-chat-message {
    background: var(--chat-message-other);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    margin-left: 36px;
}

.ms-chat-message-group:not(.own) .ms-chat-message:first-of-type {
    border-top-left-radius: 18px;
}

.ms-chat-message-group.own .ms-chat-message {
    background: var(--chat-message-own);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ms-chat-message-group.own .ms-chat-message:first-of-type {
    border-top-right-radius: 18px;
}

.ms-chat-message-group.own .ms-chat-message:last-of-type {
    border-bottom-right-radius: 18px;
}

.ms-chat-message-group:not(.own) .ms-chat-message:last-of-type {
    border-bottom-left-radius: 18px;
}

/* Individual Message Layout */
.ms-chat-message-single {
    margin: 4px 16px;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.ms-chat-message-single .ms-chat-message-content {
    background: transparent;
    padding: 0;
    border-radius: 0;
    word-wrap: break-word;
    line-height: 1.4;
}

.ms-chat-message-single .ms-chat-message-meta {
    display: contents;
}

.ms-chat-message-single .ms-chat-message-author {
    font-weight: 600;
    font-size: 0.875rem;
}

.ms-chat-message-single .ms-chat-message-author::after {
    content: ':';
}

.ms-chat-message-single .ms-chat-message-time {
    font-size: 0.75rem;
    color: var(--chat-text-muted);
    margin-left: auto;
}

.ms-chat-message a {
    color: inherit;
    text-decoration: underline;
}

.ms-chat-message-edited {
    font-size: 0.6875rem;
    opacity: 0.7;
    margin-left: 8px;
}

/* System Messages */
.ms-chat-message.system {
    max-width: 100%;
    background: transparent;
    color: var(--chat-text-muted);
    text-align: center;
    font-size: 0.8125rem;
    padding: 8px 16px;
    margin: 8px 0;
    border-radius: 0;
}

/* Date Divider */
.ms-chat-date-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.ms-chat-date-divider::before,
.ms-chat-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--chat-border);
}

.ms-chat-date-divider span {
    font-size: 0.75rem;
    color: var(--chat-text-muted);
    font-weight: 500;
    text-transform: uppercase;
}

/* Typing Indicator */
.ms-chat-typing-indicator {
    padding: 8px 16px 8px 52px;
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
    font-style: italic;
    min-height: 24px;
}

.ms-chat-typing-indicator:empty {
    display: none;
}

.ms-chat-typing-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
    vertical-align: middle;
}

.ms-chat-typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--chat-text-muted);
    border-radius: 50%;
    animation: ms-chat-typing 1.4s infinite ease-in-out both;
}

.ms-chat-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ms-chat-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ms-chat-typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input Area */
.ms-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg);
    position: relative;
}

.ms-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--ms-gray-100);
    border-radius: 24px;
    padding: 8px 8px 8px 16px;
}

.ms-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    line-height: 1.4;
    resize: none;
    max-height: 120px;
    min-height: 24px;
    padding: 4px 0;
    color: var(--chat-text);
    font-family: inherit;
}

.ms-chat-input:focus {
    outline: none;
}

.ms-chat-input::placeholder {
    color: var(--chat-text-muted);
}

.ms-chat-input-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.ms-chat-input-actions button {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ms-transition);
}

.ms-chat-input-actions button:hover {
    background: var(--ms-gray-200);
    color: var(--chat-text);
}

.ms-chat-send-btn {
    background: var(--chat-primary) !important;
    color: #fff !important;
}

.ms-chat-send-btn:hover {
    background: var(--chat-primary-hover) !important;
}

.ms-chat-send-btn:disabled {
    background: var(--ms-gray-300) !important;
    cursor: not-allowed;
}

/* Online Status Indicators */
.ms-chat-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--chat-bg);
    position: absolute;
    bottom: 0;
    right: 0;
}

.ms-chat-status-indicator.online {
    background: var(--chat-online);
}

.ms-chat-status-indicator.away {
    background: var(--chat-away);
}

.ms-chat-status-indicator.offline {
    background: var(--chat-offline);
}

.ms-chat-room-icon {
    position: relative;
}

/* DM Avatar with Status */
.ms-chat-dm-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ms-gray-300);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.ms-chat-dm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Chat Modals */
.ms-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.ms-chat-modal.active {
    display: flex;
}

.ms-chat-modal-content {
    background: var(--chat-bg);
    border-radius: var(--ms-border-radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--ms-shadow-lg);
    animation: ms-chat-modal-in 0.2s ease-out;
}

@keyframes ms-chat-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ms-chat-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-chat-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--chat-text);
}

.ms-chat-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ms-transition);
}

.ms-chat-modal-close:hover {
    background: var(--ms-gray-100);
    color: var(--chat-text);
}

.ms-chat-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

.ms-chat-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Chat Form Elements */
.ms-chat-form-group {
    margin-bottom: 16px;
}

.ms-chat-form-group:last-child {
    margin-bottom: 0;
}

.ms-chat-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--chat-text);
    margin-bottom: 6px;
}

.ms-chat-form-group input,
.ms-chat-form-group textarea,
.ms-chat-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--chat-border);
    border-radius: var(--ms-border-radius);
    font-size: 0.9375rem;
    color: var(--chat-text);
    background: var(--chat-bg);
    transition: var(--ms-transition);
}

.ms-chat-form-group input:focus,
.ms-chat-form-group textarea:focus,
.ms-chat-form-group select:focus {
    outline: none;
    border-color: var(--chat-primary);
    box-shadow: 0 0 0 3px var(--chat-primary-light);
}

.ms-chat-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Chat Buttons */
.ms-chat-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--ms-border-radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ms-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ms-chat-btn-primary {
    background: var(--chat-primary);
    color: #fff;
}

.ms-chat-btn-primary:hover {
    background: var(--chat-primary-hover);
}

.ms-chat-btn-secondary {
    background: var(--ms-gray-100);
    color: var(--chat-text);
}

.ms-chat-btn-secondary:hover {
    background: var(--ms-gray-200);
}

/* User Search Results */
.ms-chat-user-search-results {
    border: 1px solid var(--chat-border);
    border-radius: var(--ms-border-radius);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 8px;
}

.ms-chat-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-chat-user-item:hover {
    background: var(--ms-gray-50);
}

.ms-chat-user-item.selected {
    background: var(--chat-primary-light);
}

.ms-chat-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ms-gray-300);
    overflow: hidden;
}

.ms-chat-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-chat-user-info {
    flex: 1;
}

.ms-chat-user-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--chat-text);
}

.ms-chat-user-email {
    font-size: 0.8125rem;
    color: var(--chat-text-muted);
}

/* Room Members List */
.ms-chat-members-list {
    max-height: 300px;
    overflow-y: auto;
}

.ms-chat-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.ms-chat-member-item + .ms-chat-member-item {
    border-top: 1px solid var(--chat-border);
}

.ms-chat-member-role {
    font-size: 0.6875rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.ms-chat-member-role.admin {
    background: var(--ms-error-light);
    color: var(--ms-error);
}

.ms-chat-member-role.moderator {
    background: var(--ms-warning-light);
    color: var(--ms-warning);
}

/* Attachment Preview */
.ms-chat-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--ms-border-radius);
    margin-top: 8px;
}

.ms-chat-attachment-icon {
    font-size: 24px;
}

.ms-chat-attachment-info {
    flex: 1;
    min-width: 0;
}

.ms-chat-attachment-name {
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-chat-attachment-size {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Chat Loading State */
.ms-chat-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--chat-text-muted);
}

.ms-chat-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--chat-border);
    border-top-color: var(--chat-primary);
    border-radius: 50%;
    animation: ms-chat-spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes ms-chat-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Chat Mentions */
.ms-chat-mention {
    background: var(--chat-primary-light);
    color: var(--chat-primary);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

.ms-chat-message-group.own .ms-chat-mention {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

/* Chat Notification Badge */
.ms-chat-notification-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--chat-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    box-shadow: var(--ms-shadow-lg);
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    animation: ms-chat-bounce 0.3s ease-out;
}

.ms-chat-notification-badge.visible {
    display: flex;
}

@keyframes ms-chat-bounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Chat */
@media (max-width: 768px) {
    .ms-chat {
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: 0;
        flex-direction: column;
    }

    .ms-chat-sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--chat-border);
    }

    .ms-chat-sidebar.collapsed {
        display: none;
    }

    .ms-chat-main.expanded {
        flex: 1;
    }

    .ms-chat-back-btn {
        display: flex !important;
    }

    .ms-chat-message {
        max-width: 85%;
    }

    .ms-chat-modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
    }
}

@media (min-width: 769px) {
    .ms-chat-back-btn {
        display: none !important;
    }
}

/* Scrollbar Styling */
.ms-chat-messages::-webkit-scrollbar,
.ms-chat-rooms::-webkit-scrollbar,
.ms-chat-modal-body::-webkit-scrollbar {
    width: 6px;
}

.ms-chat-messages::-webkit-scrollbar-track,
.ms-chat-rooms::-webkit-scrollbar-track,
.ms-chat-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.ms-chat-messages::-webkit-scrollbar-thumb,
.ms-chat-rooms::-webkit-scrollbar-thumb,
.ms-chat-modal-body::-webkit-scrollbar-thumb {
    background: var(--ms-gray-300);
    border-radius: 3px;
}

.ms-chat-messages::-webkit-scrollbar-thumb:hover,
.ms-chat-rooms::-webkit-scrollbar-thumb:hover,
.ms-chat-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--ms-gray-400);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ms-chat.auto-theme {
        --chat-bg: #1f2937;
        --chat-sidebar-bg: #111827;
        --chat-border: #374151;
        --chat-text: #f9fafb;
        --chat-text-muted: #9ca3af;
        --chat-message-other: #374151;
    }
}

/* ==========================================================================
   Additional Chat Styles - Phase 2
   ========================================================================== */

/* Chat Layout with 3 Columns */
.ms-chat-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Chat Welcome Screen */
.ms-chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--chat-text-muted);
}

.ms-chat-welcome-icon {
    width: 80px;
    height: 80px;
    background: var(--ms-gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.ms-chat-welcome-icon .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--ms-gray-400);
}

.ms-chat-welcome h2 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--chat-text);
}

.ms-chat-welcome p {
    margin: 0 0 24px;
    font-size: 1rem;
    max-width: 400px;
}

/* Online Badge in Sidebar Header */
.ms-chat-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--chat-text-muted);
}

.ms-chat-online-dot {
    width: 8px;
    height: 8px;
    background: var(--chat-online);
    border-radius: 50%;
    animation: ms-chat-pulse 2s infinite;
}

@keyframes ms-chat-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Section Header with Button */
.ms-chat-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 16px 2px;
}

.ms-chat-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--chat-text-muted);
}

.ms-chat-new-room-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ms-transition);
}

.ms-chat-new-room-btn:hover {
    background: var(--ms-gray-200);
    color: var(--chat-primary);
}

.ms-chat-new-room-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Room List in Sidebar */
.ms-chat-rooms-wrapper {
    flex: 1;
    overflow-y: auto;
}

.ms-chat-room-list {
    padding: 0 8px 8px;
}

.ms-chat-empty-text {
    padding: 12px 16px;
    font-size: 0.875rem;
    color: var(--chat-text-muted);
    text-align: center;
}

/* Members Sidebar */
.ms-chat-members-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--chat-sidebar-bg);
    border-left: 1px solid var(--chat-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--ms-transition);
}

.ms-chat-members-sidebar:not(.open) {
    display: none;
}

.ms-chat-members-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ms-chat-members-header h4 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--chat-text);
}

.ms-chat-members-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    display: none;
}

.ms-chat-members-close:hover {
    background: var(--ms-gray-200);
}

.ms-chat-members-section {
    padding: 12px 0;
}

.ms-chat-members-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--chat-text-muted);
    margin: 0;
}

.ms-chat-members-count {
    background: var(--ms-gray-200);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.625rem;
}

.ms-chat-members-list {
    max-height: 200px;
    overflow-y: auto;
}

.ms-chat-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    transition: var(--ms-transition);
}

.ms-chat-member-item:hover {
    background: var(--ms-gray-100);
}

.ms-chat-member-item.offline {
    opacity: 0.6;
}

.ms-chat-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.ms-chat-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ms-chat-member-avatar .ms-chat-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border: 2px solid var(--chat-sidebar-bg);
}

.ms-chat-member-name {
    font-size: 0.875rem;
    color: var(--chat-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Icon Picker */
.ms-chat-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ms-chat-icon-option {
    position: relative;
    cursor: pointer;
}

.ms-chat-icon-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ms-chat-icon-option .dashicons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid var(--chat-border);
    border-radius: var(--ms-border-radius);
    font-size: 20px;
    color: var(--chat-text-muted);
    transition: var(--ms-transition);
}

.ms-chat-icon-option input[type="radio"]:checked + .dashicons {
    border-color: var(--chat-primary);
    background: var(--chat-primary-light);
    color: var(--chat-primary);
}

.ms-chat-icon-option:hover .dashicons {
    border-color: var(--chat-primary);
}

/* Danger Button */
.ms-chat-btn-danger {
    background: var(--ms-error);
    color: #fff;
}

.ms-chat-btn-danger:hover {
    background: #b91c1c;
}

/* Danger Zone */
.ms-chat-danger-zone {
    padding: 16px;
    background: var(--ms-error-light);
    border-radius: var(--ms-border-radius);
    margin-top: 16px;
}

.ms-chat-danger-zone h4 {
    margin: 0 0 8px;
    color: var(--ms-error);
    font-size: 0.875rem;
}

.ms-chat-danger-zone p {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    color: var(--ms-gray-700);
}

/* Room Info Display */
.ms-chat-room-info-display {
    font-size: 0.875rem;
}

.ms-chat-room-info-display p {
    margin: 8px 0;
}

/* Required Field Indicator */
.ms-chat-form-group .required {
    color: var(--ms-error);
}

/* Modal Body Open State */
body.ms-chat-modal-open {
    overflow: hidden;
}

/* Back Button for Mobile */
.ms-chat-back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--chat-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--chat-border);
}

.ms-chat-back-btn:hover {
    background: var(--ms-gray-50);
}

/* Mobile Sidebar Toggle */
.ms-chat-sidebar-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--chat-text-muted);
    border-radius: var(--ms-border-radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ms-chat-sidebar-toggle:hover {
    background: var(--ms-gray-100);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .ms-chat-members-sidebar:not(.open) {
        display: none;
    }
    
    .ms-chat-members-sidebar.open {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--ms-shadow-lg);
    }
    
    .ms-chat-members-close {
        display: flex;
    }
}

@media (max-width: 768px) {
    .ms-chat {
        height: calc(100vh - 100px);
        max-height: none;
        flex-direction: column;
    }
    
    .ms-chat-layout {
        flex-direction: column;
        height: 100%;
    }

    .ms-chat-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: var(--ms-shadow-lg);
        width: 280px;
        min-width: 280px;
    }
    
    .ms-chat-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .ms-chat-back-btn {
        display: flex;
    }
    
    .ms-chat-sidebar-toggle {
        display: flex;
    }
    
    .ms-chat-main {
        width: 100%;
    }
    
    .ms-chat-members-sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        min-width: 260px;
        transform: translateX(100%);
    }
    
    .ms-chat-members-sidebar.open {
        transform: translateX(0);
    }
    
    .ms-chat-members-close {
        display: flex;
    }
}

/* ==========================================================================
   Chat Toast Notifications
   ========================================================================== */
.ms-chat-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.ms-chat-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--ms-gray-800);
    color: #fff;
    border-radius: var(--ms-border-radius);
    box-shadow: var(--ms-shadow-lg);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    pointer-events: auto;
    max-width: 360px;
}

.ms-chat-toast.show {
    transform: translateX(0);
}

.ms-chat-toast-icon {
    flex-shrink: 0;
    font-size: 20px;
}

.ms-chat-toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.ms-chat-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--ms-gray-400);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

.ms-chat-toast-close:hover {
    color: #fff;
}

/* Toast Types */
.ms-chat-toast-success {
    background: var(--ms-success);
}

.ms-chat-toast-error {
    background: var(--ms-error);
}

.ms-chat-toast-warning {
    background: var(--ms-warning);
}

.ms-chat-toast-info {
    background: var(--ms-primary);
}

/* ==========================================================================
   Chat Unread Badge
   ========================================================================== */
.ms-chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--ms-error);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    margin-left: auto;
}

.ms-chat-room-item .ms-chat-unread-badge {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.ms-chat-room-item {
    position: relative;
}

/* ==========================================================================
   Chat Sound Toggle
   ========================================================================== */
.ms-chat-sound-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--ms-gray-500);
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-chat-sound-toggle:hover {
    background: var(--ms-gray-100);
    color: var(--ms-gray-700);
}

.ms-chat-sound-toggle.off {
    color: var(--ms-gray-400);
}

.ms-chat-sound-toggle.off:hover {
    color: var(--ms-gray-600);
}

/* ==========================================================================
   Chat Load More
   ========================================================================== */
.ms-chat-load-more-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    color: var(--ms-gray-500);
    font-size: 13px;
}

.ms-chat-load-more-loader .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.ms-chat-load-more-loader .dashicons.spin {
    animation: ms-chat-spin 1s linear infinite;
}

@keyframes ms-chat-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Chat Connection Status
   ========================================================================== */
.ms-chat-connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ms-warning-light);
    color: var(--ms-warning);
    font-size: 13px;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-chat-connection-status.connected {
    background: var(--ms-success-light);
    color: var(--ms-success);
}

.ms-chat-connection-status.disconnected {
    background: var(--ms-error-light);
    color: var(--ms-error);
}

/* Mobile adjustments for toasts */
@media (max-width: 768px) {
    .ms-chat-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .ms-chat-toast {
        max-width: none;
    }
}

/* ==========================================================================
   Chat File Upload
   ========================================================================== */
.ms-chat-input-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 8px;
}

.ms-chat-attach-btn,
.ms-chat-emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--ms-gray-500);
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-chat-attach-btn:hover,
.ms-chat-emoji-btn:hover {
    background: var(--ms-gray-100);
    color: var(--ms-primary);
}

.ms-chat-upload-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ms-gray-50);
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-chat-upload-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ms-chat-upload-info .dashicons {
    color: var(--ms-primary);
}

.ms-chat-upload-name {
    font-size: 13px;
    color: var(--ms-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-chat-upload-bar {
    width: 100px;
    height: 4px;
    background: var(--ms-gray-200);
    border-radius: 2px;
    overflow: hidden;
}

.ms-chat-upload-bar-fill {
    height: 100%;
    background: var(--ms-primary);
    transition: width 0.2s ease;
}

.ms-chat-upload-percent {
    font-size: 12px;
    color: var(--ms-gray-500);
    min-width: 32px;
    text-align: right;
}

/* Drag and Drop */
.ms-chat-messages.drag-over {
    background: var(--ms-primary-light);
    border: 2px dashed var(--ms-primary);
}

.ms-chat-messages.drag-over::after {
    content: 'Drop file to upload';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 24px;
    background: var(--ms-primary);
    color: #fff;
    border-radius: var(--ms-border-radius);
    font-weight: 500;
}

/* Attachments in Messages */
.ms-chat-attachment {
    margin-top: 8px;
}

.ms-chat-message-single .ms-chat-attachment {
    flex-basis: 100%;
    order: 10;
    margin-top: 6px;
}

.ms-chat-message-single .ms-chat-attachment img {
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    object-fit: contain;
}

.ms-chat-attachment-image {
    max-width: 300px;
}

.ms-chat-attachment-image img {
    max-width: 100%;
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.ms-chat-attachment-image img:hover {
    opacity: 0.9;
}

.ms-chat-attachment-file a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ms-gray-100);
    border-radius: var(--ms-border-radius-sm);
    color: var(--ms-gray-700);
    text-decoration: none;
    transition: var(--ms-transition);
}

.ms-chat-attachment-file a:hover {
    background: var(--ms-gray-200);
}

.ms-chat-attachment-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Chat Emoji Picker
   ========================================================================== */
.ms-chat-emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 16px;
    width: 300px;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    box-shadow: var(--ms-shadow-lg);
    display: none;
    z-index: 1000;
}

.ms-chat-emoji-picker.active {
    display: block;
}

.ms-chat-emoji-tabs {
    display: flex;
    border-bottom: 1px solid var(--ms-gray-200);
    padding: 4px;
    gap: 2px;
}

.ms-chat-emoji-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    font-size: 18px;
    transition: var(--ms-transition);
}

.ms-chat-emoji-tab:hover {
    background: var(--ms-gray-100);
}

.ms-chat-emoji-tab.active {
    background: var(--ms-primary-light);
}

.ms-chat-emoji-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.ms-chat-emoji-category {
    display: none;
}

.ms-chat-emoji-category.active {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.ms-chat-emoji-item {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--ms-border-radius-sm);
    cursor: pointer;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    transition: var(--ms-transition);
}

.ms-chat-emoji-item:hover {
    background: var(--ms-gray-100);
    transform: scale(1.2);
}

/* ==========================================================================
   Chat Color Picker
   ========================================================================== */
.ms-chat-color-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 16px;
    width: 240px;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    box-shadow: var(--ms-shadow-lg);
    display: none;
    z-index: 1000;
    padding: 12px;
}

.ms-chat-color-picker.active {
    display: block;
}

.ms-chat-color-picker-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ms-gray-700);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ms-gray-200);
}

.ms-chat-color-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ms-chat-color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.ms-chat-color-option:hover {
    transform: scale(1.15);
}

.ms-chat-color-option.selected {
    border-color: var(--ms-gray-800);
}

.ms-chat-color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.ms-chat-color-btn {
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--ms-gray-500);
    border-radius: var(--ms-border-radius-sm);
    transition: var(--ms-transition);
}

.ms-chat-color-btn:hover {
    background: var(--ms-gray-100);
    color: var(--ms-primary);
}

/* ==========================================================================
   Chat @Mentions
   ========================================================================== */
.ms-chat-mention-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    box-shadow: var(--ms-shadow-lg);
    display: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.ms-chat-mention-dropdown.active {
    display: block;
}

.ms-chat-mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: var(--ms-transition);
}

.ms-chat-mention-item:hover,
.ms-chat-mention-item.selected {
    background: var(--ms-primary-light);
}

.ms-chat-mention-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.ms-chat-mention-info {
    flex: 1;
    min-width: 0;
}

.ms-chat-mention-name {
    display: block;
    font-weight: 500;
    color: var(--ms-gray-900);
    font-size: 14px;
}

.ms-chat-mention-username {
    display: block;
    font-size: 12px;
    color: var(--ms-gray-500);
}

/* Mention highlight in messages */
.ms-chat-mention {
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
    cursor: pointer;
}

.ms-chat-mention:hover {
    background: var(--ms-primary);
    color: #fff;
}

/* ==========================================================================
   Chat Markdown Formatting
   ========================================================================== */
.ms-chat-message strong {
    font-weight: 600;
}

.ms-chat-message em {
    font-style: italic;
}

.ms-chat-message del {
    text-decoration: line-through;
    opacity: 0.7;
}

.ms-chat-inline-code {
    background: var(--ms-gray-100);
    color: var(--ms-error);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9em;
}

.ms-chat-code-block {
    background: var(--ms-gray-800);
    color: var(--ms-gray-100);
    padding: 12px 16px;
    border-radius: var(--ms-border-radius-sm);
    margin: 8px 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.ms-chat-code-block code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Input hint */
.ms-chat-input-hint {
    padding: 4px 12px 8px;
    color: var(--ms-gray-400);
}

.ms-chat-input-hint small {
    font-size: 11px;
}

/* Input wrapper update */
.ms-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ms-gray-50);
    border: 1px solid var(--ms-gray-200);
    border-radius: var(--ms-border-radius);
    transition: var(--ms-transition);
}

.ms-chat-input-wrapper:focus-within {
    border-color: var(--ms-primary);
    box-shadow: 0 0 0 3px var(--ms-primary-light);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .ms-chat-emoji-picker {
        width: calc(100vw - 32px);
        left: 16px;
        right: 16px;
    }
    
    .ms-chat-attachment-image {
        max-width: 100%;
    }
    
    .ms-chat-sidebar-toggle {
        display: flex;
    }
    
    .ms-chat-room-header {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .ms-chat-room-header-info .ms-chat-room-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 6px;
    }
    
    .ms-chat-room-header-info .ms-chat-room-icon .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .ms-chat-room-title {
        font-size: 0.875rem;
    }
    
    .ms-chat-room-desc {
        display: none;
    }

    .ms-chat-room-online-badge {
        display: none;
    }
}

/* ==========================================================================
   PROFILE PAGE - BEM STYLES
   Profile Full Page with Cover, Header, Tabs and Content
   ========================================================================== */

/* Profile Page Container */
.ms-profile-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Profile Header with Cover Image */
.ms-profile-header {
    position: relative;
    margin-bottom: 24px;
    background: #fff;
    border-radius: var(--ms-border-radius-lg, 12px);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Cover Image */
.ms-profile-header__cover {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ms-profile-header__cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 100%);
}

.ms-profile-header__cover-edit {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-profile-header__cover-edit:hover {
    background: #fff;
    transform: scale(1.05);
}

.ms-profile-header__cover-edit .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--ms-text-color, #333);
}

/* Profile Container */
.ms-profile-header__container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 24px;
    padding: 0 24px 24px;
    margin-top: -50px;
}

/* Avatar */
.ms-profile-header__avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ms-profile-header__avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.ms-profile-header__avatar-wrapper .ms-online-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.ms-profile-header__avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--ms-primary-color, #4f46e5);
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-profile-header__avatar-edit:hover {
    transform: scale(1.1);
}

.ms-profile-header__avatar-edit .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #fff;
}

/* Profile Info */
.ms-profile-header__info {
    flex: 1;
    min-width: 200px;
    padding-top: 60px;
}

.ms-profile-header__name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.ms-profile-header__name {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ms-text-color, #1f2937);
    line-height: 1.2;
}

.ms-profile-header__username {
    color: var(--ms-text-muted, #6b7280);
    font-size: 1rem;
}

.ms-profile-header__role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--badge-color, #6c757d);
    color: #fff;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Online Status */
.ms-profile-header__status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--ms-text-muted, #6b7280);
}

.ms-profile-header__status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

.ms-profile-header__status-indicator--online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

/* Bio */
.ms-profile-header__bio {
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: var(--ms-text-color, #374151);
    line-height: 1.6;
}

/* Meta Information */
.ms-profile-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.ms-profile-header__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--ms-text-muted, #6b7280);
}

.ms-profile-header__meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-text-muted, #9ca3af);
}

.ms-profile-header__meta-item a {
    color: var(--ms-primary-color, #4f46e5);
    text-decoration: none;
}

.ms-profile-header__meta-item a:hover {
    text-decoration: underline;
}

/* Actions */
.ms-profile-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

/* Stats Summary */
.ms-profile-header__stats {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 60px;
}

.ms-profile-header__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 10px;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
}

.ms-profile-header__stat:hover {
    background: #f1f5f9;
}

.ms-profile-header__stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-text-color, #1f2937);
    line-height: 1.2;
}

.ms-profile-header__stat-label {
    font-size: 0.75rem;
    color: var(--ms-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Profile Tabs - BEM Styles
   ========================================================================== */

.ms-profile-tabs {
    margin-bottom: 24px;
    background: #fff;
    border-radius: var(--ms-border-radius-lg, 12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ms-profile-tabs__list {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ms-profile-tabs__item {
    flex-shrink: 0;
}

.ms-profile-tabs__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    color: var(--ms-text-muted, #6b7280);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ms-profile-tabs__link:hover {
    color: var(--ms-text-color, #1f2937);
    background: #f8fafc;
}

.ms-profile-tabs__link--active {
    color: var(--ms-primary-color, #4f46e5);
    border-bottom-color: var(--ms-primary-color, #4f46e5);
    background: #f8fafc;
}

.ms-profile-tabs__link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-profile-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 11px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ms-profile-tabs__link--active .ms-profile-tabs__count {
    background: var(--ms-primary-color, #4f46e5);
    color: #fff;
}

/* Mobile Dropdown Toggle (hidden by default) */
.ms-profile-tabs__mobile-toggle {
    display: none;
}

/* Mobile Tab Dropdown */
.ms-profile-tabs__mobile {
    display: none;
}

.ms-profile-tabs__mobile-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--ms-border-color, #e5e7eb);
    border-radius: var(--ms-border-radius, 8px);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ms-text-color, #1f2937);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ms-profile-tabs__mobile-btn:hover {
    border-color: var(--ms-primary-color, #4f46e5);
}

.ms-profile-tabs__mobile-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-profile-tabs__mobile-btn .dashicons:last-child {
    color: var(--ms-text-muted, #6b7280);
    transition: transform 0.2s ease;
}

.ms-profile-tabs__mobile-btn[aria-expanded="true"] .dashicons:last-child {
    transform: rotate(180deg);
}

.ms-profile-tabs__mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    margin: 4px 0 0;
    padding: 8px 0;
    background: #fff;
    border: 1px solid var(--ms-border-color, #e5e7eb);
    border-radius: var(--ms-border-radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    list-style: none;
}

.ms-profile-tabs__mobile-menu.is-open {
    display: block;
}

.ms-profile-tabs__mobile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--ms-text-color, #374151);
    text-decoration: none;
    transition: background 0.15s ease;
}

.ms-profile-tabs__mobile-menu a:hover {
    background: #f8fafc;
}

.ms-profile-tabs__mobile-menu a.is-active {
    background: #f0f9ff;
    color: var(--ms-primary-color, #4f46e5);
}

.ms-profile-tabs__mobile-menu .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.ms-profile-tabs__mobile-menu .ms-count-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--ms-primary-color, #4f46e5);
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ==========================================================================
   Profile Content Area
   ========================================================================== */

.ms-profile-content {
    background: #fff;
    border-radius: var(--ms-border-radius-lg, 12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
    min-height: 300px;
}

/* Tab Panels */
.ms-profile-tab-panel {
    display: none;
}

.ms-profile-tab-panel--active {
    display: block;
}

/* ==========================================================================
   Online Indicator - Extended Sizes
   ========================================================================== */

.ms-online-indicator {
    display: inline-block;
    border-radius: 50%;
    background: #9ca3af;
}

.ms-online-indicator--online {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.ms-online-indicator--offline {
    background: #9ca3af;
}

.ms-online-indicator--small {
    width: 8px;
    height: 8px;
}

.ms-online-indicator--medium {
    width: 10px;
    height: 10px;
}

.ms-online-indicator--large {
    width: 12px;
    height: 12px;
}

.ms-online-indicator--xlarge {
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
}

/* ==========================================================================
   Profile Page - Error & Empty States
   ========================================================================== */

.ms-profile-page--error,
.ms-profile-page--private {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: #fff;
    border-radius: var(--ms-border-radius-lg, 12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ms-profile-private {
    text-align: center;
    padding: 48px 24px;
}

.ms-profile-private__avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.ms-profile-private__avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(50%);
    opacity: 0.7;
}

.ms-profile-private__lock {
    position: absolute;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--ms-primary-color, #4f46e5);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
}

.ms-profile-private__name {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--ms-text-color, #1f2937);
}

.ms-profile-private__message {
    color: var(--ms-text-muted, #6b7280);
    margin-bottom: 16px;
}

.ms-profile-private__hint {
    color: var(--ms-text-muted, #9ca3af);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ==========================================================================
   Profile Page - Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .ms-profile-page {
        padding: 0 12px;
    }

    .ms-profile-header__cover {
        height: 150px;
    }

    .ms-profile-header__container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 16px 20px;
        margin-top: -40px;
    }

    .ms-profile-header__avatar {
        width: 100px;
        height: 100px;
    }

    .ms-profile-header__info {
        padding-top: 16px;
        text-align: center;
    }

    .ms-profile-header__name-row {
        justify-content: center;
    }

    .ms-profile-header__name {
        font-size: 1.5rem;
    }

    .ms-profile-header__meta {
        justify-content: center;
    }

    .ms-profile-header__actions {
        justify-content: center;
    }

    .ms-profile-header__stats {
        padding-top: 16px;
        width: 100%;
        justify-content: center;
    }

    .ms-profile-header__stat {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
    }

    .ms-profile-tabs__list {
        padding: 0 4px;
    }

    .ms-profile-tabs__link {
        padding: 12px 16px;
        font-size: 0.875rem;
    }

    .ms-profile-tabs__link .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }

    .ms-profile-content {
        padding: 16px;
    }

    /* On mobile: hide desktop tabs, show dropdown */
    .ms-profile-tabs__list {
        display: none;
    }

    .ms-profile-tabs__mobile {
        display: block;
        position: relative;
        padding: 8px;
    }
}

/* ==========================================================================
   PROFILE PAGE STYLES - Dashboard-like Design
   Extends existing .ms-dashboard styles for profile pages
   ========================================================================== */

/* Profile Page Background & Layout */
.ms-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: transparent;
}

/* Page wrapper background */
.ms-dashboard-wrapper,
body.ms-profile-page-body {
    background-color: #eeeeee !important;
}

/* Ensure all boxes/cards use content background */
.ms-dashboard .ms-dashboard-header,
.ms-dashboard .ms-dashboard-nav,
.ms-dashboard .ms-dashboard-content,
.ms-dashboard .ms-profile-actions-bar,
.ms-dashboard .ms-profile-card {
    background: var(--ms-content-bg, #ffffff) !important;
}

/* Profile Username (under display name) */
.ms-profile-username {
    margin: 0;
    color: var(--ms-text-muted, #6b7280);
    font-size: 0.95rem;
}

/* Online Dot on Avatar */
.ms-avatar {
    position: relative;
}

.ms-online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

/* Profile Stats Row */
.ms-profile-stats-row {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.ms-profile-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: #f8fafc;
    border-radius: 10px;
    min-width: 80px;
    text-align: center;
    border: 1px solid var(--ms-border-color, #e5e7eb);
}

.ms-profile-stat-item .ms-stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ms-text-color, #1f2937);
    line-height: 1.2;
}

.ms-profile-stat-item .ms-stat-label {
    font-size: 0.7rem;
    color: var(--ms-text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Profile Actions Bar */
.ms-profile-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--ms-border-color, #e5e7eb);
    border-radius: var(--ms-border-radius, 8px);
    margin-bottom: 20px;
}

/* Profile Cards (for sections like About, Activity, etc.) */
.ms-profile-card {
    background: #fff;
    border: 1px solid var(--ms-border-color, #e5e7eb);
    border-radius: var(--ms-border-radius, 8px);
    margin-bottom: 20px;
    overflow: hidden;
}

.ms-profile-card .ms-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ms-border-color, #e5e7eb);
    background: #fafafa;
}

.ms-profile-card .ms-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ms-text-color, #1f2937);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ms-profile-card .ms-card-header h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--ms-text-muted, #6b7280);
}

.ms-profile-card .ms-card-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    color: var(--ms-primary, #4f46e5);
    text-decoration: none;
}

.ms-profile-card .ms-card-link:hover {
    text-decoration: underline;
}

.ms-profile-card .ms-card-body {
    padding: 20px;
}

/* Tab Count Badge in Navigation */
.ms-nav-tabs .ms-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

.ms-nav-tabs .ms-nav-item.active .ms-tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Dropdown Menu for Profile Actions */
.ms-dropdown {
    position: relative;
}

.ms-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ms-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 100;
    min-width: 180px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid var(--ms-border-color, #e5e7eb);
    border-radius: var(--ms-border-radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ms-dropdown:hover .ms-dropdown-menu,
.ms-dropdown.is-open .ms-dropdown-menu {
    display: block;
}

.ms-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--ms-text-color, #374151);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.ms-dropdown-item:hover {
    background: #f8fafc;
}

.ms-dropdown-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--ms-text-muted, #6b7280);
}

/* Loading Spinner */
.ms-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ms-primary, #4f46e5);
    border-radius: 50%;
    animation: ms-spin 0.8s linear infinite;
}

@keyframes ms-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Profile Page Responsive */
@media (max-width: 768px) {
    .ms-dashboard-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .ms-dashboard-welcome {
        flex-direction: column;
        text-align: center;
    }

    .ms-profile-stats-row {
        width: 100%;
        justify-content: center;
    }

    .ms-profile-stat-item {
        flex: 1;
        padding: 10px 12px;
        min-width: 0;
    }

    .ms-profile-actions-bar {
        justify-content: center;
    }

    .ms-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .ms-nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .ms-nav-tabs .ms-nav-item {
        white-space: nowrap;
    }
}