/**
 * Necudah Frontend Styles
 *
 * @package Necudah
 */

/* CSS Variables - can be overridden by theme options */
:root {
    --necudah-primary: #2563eb;
    --necudah-secondary: #64748b;
    --necudah-accent: #f59e0b;
    --necudah-success: #10b981;
    --necudah-warning: #f59e0b;
    --necudah-danger: #ef4444;
    --necudah-text: #1f2937;
    --necudah-text-light: #6b7280;
    --necudah-bg: #ffffff;
    --necudah-bg-alt: #f9fafb;
    --necudah-card-bg: #ffffff;
    --necudah-border: #e5e7eb;
    --necudah-container: 1200px;
    --necudah-radius: 8px;
    --necudah-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --necudah-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --necudah-font-size: 16px;
    --necudah-line-height: 1.6;
}

/* Base */
.necudah-container {
    max-width: var(--necudah-container);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.necudah-header {
    background: var(--necudah-bg);
    border-bottom: 1px solid var(--necudah-border);
    position: relative;
    z-index: 100;
}

.necudah-header--sticky {
    position: sticky;
    top: 0;
}

.necudah-header--transparent {
    background: transparent;
    border-bottom: none;
}

.necudah-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--necudah-container);
    margin: 0 auto;
    padding: 16px 20px;
    gap: 24px;
}

.necudah-header-start,
.necudah-header-end {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo */
.necudah-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.necudah-logo img {
    display: block;
    max-height: 40px;
    width: auto;
}

.necudah-logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--necudah-text);
}

.necudah-logo-text:hover {
    color: var(--necudah-primary);
}

/* Navigation */
.necudah-header-nav {
    flex: 1;
}

.necudah-nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.necudah-nav-menu li {
    margin: 0;
}

.necudah-nav-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--necudah-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--necudah-radius);
    transition: all 0.2s ease;
}

.necudah-nav-menu a:hover {
    color: var(--necudah-primary);
    background: var(--necudah-bg-alt);
}

.necudah-nav-menu .current-menu-item a {
    color: var(--necudah-primary);
}

/* User menu */
.necudah-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.necudah-header-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--necudah-text-light);
    text-decoration: none;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.necudah-header-icon:hover {
    color: var(--necudah-primary);
    background: var(--necudah-bg-alt);
}

.necudah-header-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.necudah-header-icon .necudah-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--necudah-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
}

/* User dropdown */
.necudah-user-dropdown {
    position: relative;
}

.necudah-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--necudah-radius);
    transition: all 0.2s ease;
}

.necudah-user-trigger:hover {
    background: var(--necudah-bg-alt);
}

.necudah-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.necudah-user-trigger .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--necudah-text-light);
}

.necudah-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    margin-top: 8px;
    padding: 8px 0;
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    box-shadow: var(--necudah-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.necudah-user-dropdown:hover .necudah-dropdown-menu,
.necudah-user-dropdown:focus-within .necudah-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.necudah-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--necudah-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.necudah-dropdown-menu a:hover {
    background: var(--necudah-bg-alt);
    color: var(--necudah-primary);
}

.necudah-dropdown-menu .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--necudah-text-light);
}

.necudah-dropdown-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--necudah-border);
}

/* Guest menu */
.necudah-guest-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.necudah-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    border-radius: var(--necudah-radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.necudah-btn-primary {
    background: var(--necudah-primary);
    color: white;
}

.necudah-btn-primary:hover {
    background: #1d4ed8;
    color: white;
}

.necudah-btn-secondary {
    background: var(--necudah-secondary);
    color: white;
}

.necudah-btn-secondary:hover {
    background: #475569;
    color: white;
}

.necudah-btn-danger {
    background: #dc2626;
    color: white;
}

.necudah-btn-danger:hover {
    background: #b91c1c;
    color: white;
}

.necudah-btn-outline {
    background: transparent;
    border: 1px solid var(--necudah-border);
    color: var(--necudah-text);
}

.necudah-btn-outline:hover {
    border-color: var(--necudah-primary);
    color: var(--necudah-primary);
}

.necudah-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.necudah-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Cards */
.necudah-card {
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    overflow: hidden;
}

.necudah-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-card-body {
    padding: 20px;
}

.necudah-card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--necudah-border);
    background: var(--necudah-bg-alt);
}

/* Forms */
.necudah-form-group {
    margin-bottom: 20px;
}

.necudah-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--necudah-text);
}

.necudah-form-input,
.necudah-form-textarea,
.necudah-form-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: var(--necudah-font-size);
    line-height: var(--necudah-line-height);
    color: var(--necudah-text);
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    transition: all 0.2s ease;
}

.necudah-form-input:focus,
.necudah-form-textarea:focus,
.necudah-form-select:focus {
    outline: none;
    border-color: var(--necudah-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.necudah-form-help {
    font-size: 13px;
    color: var(--necudah-text-light);
    margin-top: 6px;
}

/* Alerts */
.necudah-alert {
    padding: 14px 18px;
    border-radius: var(--necudah-radius);
    margin-bottom: 16px;
}

.necudah-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.necudah-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.necudah-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.necudah-alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Avatar */
.necudah-avatar {
    display: inline-block;
    border-radius: 50%;
    overflow: hidden;
}

.necudah-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.necudah-avatar-sm {
    width: 32px;
    height: 32px;
}

.necudah-avatar-md {
    width: 48px;
    height: 48px;
}

.necudah-avatar-lg {
    width: 80px;
    height: 80px;
}

.necudah-avatar-xl {
    width: 120px;
    height: 120px;
}

/* Grid */
.necudah-grid {
    display: grid;
    gap: 24px;
}

.necudah-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.necudah-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.necudah-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .necudah-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .necudah-grid-2,
    .necudah-grid-3,
    .necudah-grid-4 {
        grid-template-columns: 1fr;
    }

    .necudah-header-nav {
        display: none;
    }

    .necudah-header-inner {
        padding: 12px 16px;
    }
}

/* Dark mode */
[data-theme="dark"] {
    --necudah-text: #f9fafb;
    --necudah-text-light: #9ca3af;
    --necudah-bg: #1f2937;
    --necudah-bg-alt: #374151;
    --necudah-border: #4b5563;
}

/* ==========================================
   Profile Page Styles
   ========================================== */

.necudah-profile {
    background: var(--necudah-bg);
}

/* Cover Image */
.necudah-profile-cover {
    height: 250px;
    background-color: var(--necudah-bg-alt);
    background-size: cover;
    background-position: center;
    position: relative;
}

.necudah-edit-cover {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: var(--necudah-radius);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.necudah-edit-cover:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Profile Header */
.necudah-profile-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 0 40px 30px;
    max-width: var(--necudah-container);
    margin: -60px auto 0;
    position: relative;
}

.necudah-profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.necudah-profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--necudah-bg);
    box-shadow: var(--necudah-shadow);
}

.necudah-edit-avatar {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--necudah-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--necudah-shadow);
}

.necudah-member-badge {
    position: absolute;
    top: 8px;
    left: -8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: var(--necudah-shadow);
}

.necudah-member-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.necudah-profile-info {
    flex: 1;
    padding-top: 70px;
}

.necudah-profile-name {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--necudah-text);
}

.necudah-profile-bio {
    margin: 0 0 12px;
    color: var(--necudah-text-light);
    font-size: 15px;
}

.necudah-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.necudah-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--necudah-text-light);
    font-size: 13px;
}

.necudah-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.necudah-profile-actions {
    padding-top: 70px;
}

/* Profile Tabs */
.necudah-profile-tabs {
    max-width: var(--necudah-container);
    margin: 0 auto;
    padding: 0 40px;
}

.necudah-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--necudah-border);
    margin-bottom: 24px;
}

.necudah-tab {
    padding: 12px 20px;
    color: var(--necudah-text-light);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.necudah-tab:hover {
    color: var(--necudah-text);
}

.necudah-tab.active {
    color: var(--necudah-primary);
    border-bottom-color: var(--necudah-primary);
}

.necudah-tab-content {
    padding-bottom: 60px;
}

/* About Section */
.necudah-about-section h3,
.necudah-courses-section h3,
.necudah-groups-section h3,
.necudah-settings-section h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
}

.necudah-muted {
    color: var(--necudah-text-light);
}

.necudah-custom-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.necudah-field-item {
    display: flex;
    gap: 8px;
}

/* Settings Form */
.necudah-settings-form {
    max-width: 600px;
}

.necudah-form-row {
    margin-bottom: 20px;
}

.necudah-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--necudah-text);
}

.necudah-form-row input[type="text"],
.necudah-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    font-size: 15px;
}

.necudah-form-row input:focus,
.necudah-form-row textarea:focus {
    outline: none;
    border-color: var(--necudah-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.necudah-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.necudah-form-actions {
    margin-top: 24px;
}

/* Notice */
.necudah-notice {
    padding: 12px 16px;
    border-radius: var(--necudah-radius);
    margin-bottom: 20px;
}

.necudah-notice-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.necudah-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ==========================================================================
   REDDIT-STYLE DARK MODE (ULTRA-PREMIUM CONSOLIDATED)
   ========================================================================== */

[data-theme="dark"] {
    --necudah-bg: #030303 !important;
    --necudah-bg-alt: #1a1a1b !important;
    --necudah-card-bg: #1a1a1b !important;
    --necudah-text: #d7dadc !important;
    --necudah-text-light: #818384 !important;
    --necudah-border: #343536 !important;
    --necudah-primary: #10b981 !important;
}

[data-theme="dark"],
[data-theme="dark"] body {
    background-color: var(--necudah-bg) !important;
    color: var(--necudah-text) !important;
}

/* Aggressive container overrides */
[data-theme="dark"] .necudah-card,
[data-theme="dark"] .necudah-modal-body,
[data-theme="dark"] .necudah-modal-content,
[data-theme="dark"] .necudah-dropdown-menu,
[data-theme="dark"] .necudah-dropdown-panel,
[data-theme="dark"] .necudah-messenger,
[data-theme="dark"] .necudah-messages-list,
[data-theme="dark"] .necudah-message-thread,
[data-theme="dark"] .necudah-message-composer,
[data-theme="dark"] .necudah-inbox-sidebar,
[data-theme="dark"] .necudah-inbox-content,
[data-theme="dark"] .necudah-member-card,
[data-theme="dark"] .necudah-group-card {
    background: var(--necudah-bg-alt) !important;
    border-color: var(--necudah-border) !important;
    color: var(--necudah-text) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4) !important;
}

/* Header and navigation */
[data-theme="dark"] .site-header,
[data-theme="dark"] .necudah-header,
[data-theme="dark"] .necudah-frontend-header {
    background-color: var(--necudah-bg-alt) !important;
    border-bottom: 1px solid var(--necudah-border) !important;
}

[data-theme="dark"] .necudah-nav-menu a,
[data-theme="dark"] .necudah-header-icon,
[data-theme="dark"] .necudah-header-site-title {
    color: var(--necudah-text) !important;
}

/* Form Elements */
[data-theme="dark"] .necudah-form-input,
[data-theme="dark"] .necudah-form-select,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--necudah-border) !important;
    color: var(--necudah-text) !important;
}

[data-theme="dark"] input::placeholder {
    color: var(--necudah-text-light) !important;
}

/* Modal specific offsets */
[data-theme="dark"] .necudah-modal-header,
[data-theme="dark"] .necudah-modal-footer {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--necudah-border) !important;
}

/* List items and separators */
[data-theme="dark"] .necudah-message-item,
[data-theme="dark"] .necudah-notification-item,
[data-theme="dark"] .necudah-member-item,
[data-theme="dark"] .necudah-list-item {
    border-bottom: 1px solid var(--necudah-border) !important;
    background: transparent !important;
}

[data-theme="dark"] .necudah-message-item:hover,
[data-theme="dark"] .necudah-notification-item:hover,
[data-theme="dark"] .necudah-list-item:hover,
[data-theme="dark"] .necudah-message-item.active {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Scrollbars (Chrome/Safari) */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    background: var(--necudah-bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--necudah-border);
    border-radius: 5px;
    border: 2px solid var(--necudah-bg);
}

[data-theme="dark"] .necudah-avatar-trigger:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .necudah-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px 20px;
    }

    .necudah-profile-info {
        padding-top: 16px;
    }

    .necudah-profile-actions {
        padding-top: 0;
    }

    .necudah-profile-meta {
        justify-content: center;
    }

    .necudah-profile-tabs {
        padding: 0 20px;
    }

    .necudah-tabs-nav {
        overflow-x: auto;
    }

    .necudah-custom-fields {
        grid-template-columns: 1fr;
    }

    .necudah-form-row-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   Community Pages (Groups, Events, Directory)
   ========================================== */

/* Page Header */
.necudah-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-page-title h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
}

.necudah-page-title p {
    margin: 0;
    color: var(--necudah-text-light);
}

/* Filters */
.necudah-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.necudah-search-form {
    display: flex;
    gap: 8px;
}

.necudah-search-form input {
    min-width: 250px;
    padding: 10px 14px;
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
}

.necudah-filter-tabs {
    display: flex;
    gap: 4px;
}

.necudah-filter-tabs a {
    padding: 8px 16px;
    color: var(--necudah-text-light);
    text-decoration: none;
    border-radius: var(--necudah-radius);
    font-weight: 500;
    transition: all 0.2s;
}

.necudah-filter-tabs a:hover {
    color: var(--necudah-text);
    background: var(--necudah-bg-alt);
}

.necudah-filter-tabs a.active {
    color: var(--necudah-primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Groups Grid */
.necudah-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.necudah-group-card {
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.necudah-group-card:hover {
    box-shadow: var(--necudah-shadow-lg);
}

.necudah-group-cover {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: var(--necudah-bg-alt);
}

.necudah-group-cover-default {
    display: flex;
    align-items: center;
    justify-content: center;
}

.necudah-group-cover-default .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--necudah-text-light);
    opacity: 0.3;
}

.necudah-group-content {
    padding: 20px;
}

.necudah-group-type {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 8px;
}

.necudah-type-public {
    background: #dcfce7;
    color: #166534;
}

.necudah-type-private {
    background: #fef3c7;
    color: #92400e;
}

.necudah-type-hidden {
    background: #f3e8ff;
    color: #7c3aed;
}

.necudah-group-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.necudah-group-content h3 a {
    color: var(--necudah-text);
    text-decoration: none;
}

.necudah-group-content h3 a:hover {
    color: var(--necudah-primary);
}

.necudah-group-desc {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--necudah-text-light);
}

.necudah-group-meta {
    font-size: 13px;
    color: var(--necudah-text-light);
    margin-bottom: 16px;
}

.necudah-group-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* Events List */
.necudah-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.necudah-event-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
}

.necudah-event-date {
    flex-shrink: 0;
    width: 60px;
    text-align: center;
    padding: 10px;
    background: var(--necudah-primary);
    color: white;
    border-radius: var(--necudah-radius);
}

.necudah-date-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
}

.necudah-date-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.necudah-event-content {
    flex: 1;
}

.necudah-event-content h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.necudah-event-content h3 a {
    color: var(--necudah-text);
    text-decoration: none;
}

.necudah-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--necudah-text-light);
}

.necudah-event-meta .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

.necudah-event-desc {
    margin: 0;
    font-size: 14px;
    color: var(--necudah-text-light);
}

/* Event Card - Updated Structure */
.necudah-event-date-badge {
    flex-shrink: 0;
    width: 60px;
    text-align: center;
    padding: 10px;
    background: var(--necudah-primary);
    color: white;
    border-radius: var(--necudah-radius);
}

.necudah-event-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
}

.necudah-event-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.necudah-event-info {
    flex: 1;
    min-width: 0;
}

.necudah-event-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.necudah-event-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.necudah-event-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.necudah-event-meta-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.necudah-event-description {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--necudah-text-light);
}

.necudah-event-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badges */
.necudah-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

.necudah-badge .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
}

.necudah-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.necudah-badge-private {
    background: #fef3c7;
    color: #92400e;
}

.necudah-badge-global {
    background: #dbeafe;
    color: #1e40af;
}

.necudah-badge-invited {
    background: #e0e7ff;
    color: #3730a3;
}

.necudah-badge-declined {
    background: #fee2e2;
    color: #991b1b;
}

/* Button Variant */
.necudah-btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--necudah-border);
    color: var(--necudah-text-light);
}

.necudah-btn-outline-secondary:hover {
    border-color: var(--necudah-secondary);
    color: var(--necudah-text);
}

/* Form Controls */
.necudah-form-control {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--necudah-text);
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    transition: border-color 0.2s;
}

.necudah-form-control:focus {
    outline: none;
    border-color: var(--necudah-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.necudah-form-control {
    resize: vertical;
}

select.necudah-form-control {
    appearance: auto;
}

/* Event Type Selector */
.necudah-event-type-selector {
    display: flex;
    gap: 12px;
}

.necudah-event-type-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 12px;
    border: 2px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.necudah-event-type-option:hover {
    border-color: var(--necudah-primary);
}

.necudah-event-type-option.active {
    border-color: var(--necudah-primary);
    background: rgba(37, 99, 235, 0.05);
}

.necudah-event-type-option .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--necudah-text-light);
}

.necudah-event-type-option.active .dashicons {
    color: var(--necudah-primary);
}

.necudah-event-type-label {
    font-weight: 600;
    font-size: 14px;
}

.necudah-event-type-desc {
    font-size: 12px;
    color: var(--necudah-text-light);
}

/* Invite Search */
.necudah-invite-search-wrap {
    position: relative;
}

.necudah-invite-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    box-shadow: var(--necudah-shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.necudah-invite-result-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s;
}

.necudah-invite-result-item:hover {
    background: var(--necudah-bg-alt);
}

.necudah-invited-users {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.necudah-invited-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--necudah-bg-alt);
    border: 1px solid var(--necudah-border);
    border-radius: 20px;
    font-size: 13px;
}

.necudah-invited-tag .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.necudah-invite-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--necudah-text-light);
    padding: 0 2px;
}

.necudah-invite-remove:hover {
    color: var(--necudah-danger);
}

/* Event Detail Popover */
.necudah-event-popover {
    position: absolute;
    z-index: 10000;
    width: 340px;
    max-height: 480px;
    overflow-y: auto;
}

.necudah-event-popover-inner {
    background: var(--necudah-bg, #fff);
    border: 1px solid var(--necudah-border, #e5e7eb);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    padding: 20px;
    position: relative;
}

.necudah-event-popover-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: none;
    font-size: 20px;
    color: var(--necudah-text-light, #9ca3af);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.necudah-event-popover-close:hover {
    background: var(--necudah-bg-alt, #f3f4f6);
    color: var(--necudah-text, #1f2937);
}

.necudah-event-popover-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding-right: 24px;
}

.necudah-event-popover-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.necudah-event-popover-meta {
    margin-bottom: 12px;
}

.necudah-event-popover-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--necudah-text-light, #6b7280);
    padding: 3px 0;
}

.necudah-event-popover-meta-row .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.necudah-event-popover-desc {
    font-size: 13px;
    color: var(--necudah-text, #374151);
    line-height: 1.5;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--necudah-border, #e5e7eb);
}

.necudah-event-popover-people {
    margin-bottom: 14px;
}

.necudah-event-popover-people-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--necudah-text, #374151);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.necudah-event-popover-people-label .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.necudah-event-popover-people-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 150px;
    overflow-y: auto;
}

.necudah-event-popover-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 3px 8px;
    background: var(--necudah-bg-alt, #f9fafb);
    border-radius: 6px;
}

.necudah-event-popover-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--necudah-border, #e5e7eb);
}

/* Clickable events cursor */
.necudah-cal-event-clickable {
    cursor: pointer;
}

/* Attendee count on day view events */
.necudah-timegrid-event-att {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 1px;
}

.necudah-timegrid-event-att .dashicons {
    font-size: 11px;
    width: 11px;
    height: 11px;
}

/* Edit/Delete actions in popover */
.necudah-event-popover-edit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed var(--necudah-border, #e5e7eb);
}

.necudah-btn-outline-danger {
    color: #dc2626;
    border: 1px solid #fca5a5;
    background: transparent;
}
.necudah-btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Edit Event Modal */
.necudah-edit-event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.necudah-edit-event-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.necudah-edit-event-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.necudah-edit-event-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.necudah-edit-event-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.necudah-edit-event-modal-close:hover {
    color: #374151;
}

.necudah-edit-event-modal-body {
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0; /* fix for flex overflow scroll */
}

/* Lock body scroll when edit modal is open */
body.necudah-modal-open {
    overflow: hidden !important;
}

.necudah-edit-event-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 640px) {
    .necudah-edit-event-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 8px;
    }
    .necudah-edit-event-overlay {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .necudah-event-popover {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: calc(100vw - 32px);
        max-width: 340px;
    }
}

/* Calendar View */
.necudah-calendar {
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    overflow: hidden;
}

.necudah-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--necudah-bg-alt);
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-calendar-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.necudah-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--necudah-radius);
    color: var(--necudah-text);
    text-decoration: none;
    font-size: 24px;
    font-weight: 300;
    transition: all 0.2s;
}

.necudah-calendar-nav:hover {
    background: var(--necudah-border);
    color: var(--necudah-primary);
}

.necudah-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.necudah-calendar-weekday {
    padding: 10px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--necudah-text-light);
    background: var(--necudah-bg-alt);
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-calendar-day {
    min-height: 100px;
    padding: 6px;
    border-right: 1px solid var(--necudah-border);
    border-bottom: 1px solid var(--necudah-border);
    position: relative;
}

.necudah-calendar-day:nth-child(7n+7) {
    border-right: none;
}

.necudah-calendar-day--empty {
    background: var(--necudah-bg-alt);
    opacity: 0.5;
}

.necudah-calendar-day--today {
    background: rgba(37, 99, 235, 0.04);
}

.necudah-calendar-day--today .necudah-calendar-day-num {
    background: var(--necudah-primary);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.necudah-calendar-day-num {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--necudah-text);
    margin-bottom: 4px;
}

.necudah-calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.necudah-calendar-event {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}

.necudah-calendar-event--group {
    background: #dbeafe;
    color: #1e40af;
}

.necudah-calendar-event--private {
    background: #fef3c7;
    color: #92400e;
}

.necudah-calendar-event--global {
    background: #d1fae5;
    color: #065f46;
}

.necudah-calendar-event-time {
    font-weight: 600;
    margin-right: 4px;
}

@media (max-width: 768px) {
    .necudah-calendar-day {
        min-height: 60px;
        padding: 4px;
    }

    .necudah-calendar-event {
        font-size: 9px;
        padding: 1px 3px;
    }

    .necudah-calendar-event-time {
        display: none;
    }
}

/* Calendar View Tabs */
.necudah-calendar-view-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

.necudah-calendar-view-tab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--necudah-text-light);
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.necudah-calendar-view-tab:hover {
    color: var(--necudah-text);
    background: var(--necudah-bg-alt);
}

.necudah-calendar-view-tab.active {
    color: var(--necudah-primary);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    font-weight: 600;
}

.necudah-calendar-today-btn {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--necudah-primary);
    text-decoration: none;
    border: 1px solid var(--necudah-border);
    transition: all 0.2s;
}

.necudah-calendar-today-btn:hover {
    background: var(--necudah-bg-alt);
    border-color: var(--necudah-primary);
}

/* Month view: make day numbers clickable */
a.necudah-calendar-day-num {
    text-decoration: none;
    color: var(--necudah-text);
    transition: color 0.15s;
}

a.necudah-calendar-day-num:hover {
    color: var(--necudah-primary);
}

/* Time Grid (Day & Week views) */
.necudah-timegrid {
    border-top: 1px solid var(--necudah-border);
    overflow-x: auto;
}

.necudah-timegrid-body {
    position: relative;
    min-height: calc(16 * 60px); /* time_end - time_start + 1 hours */
}

.necudah-timegrid-row {
    display: flex;
    height: 60px;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-timegrid-label {
    width: 60px;
    min-width: 60px;
    padding: 4px 8px 0 0;
    text-align: right;
    font-size: 11px;
    color: var(--necudah-text-light);
    font-weight: 500;
    border-right: 1px solid var(--necudah-border);
}

.necudah-timegrid-cell {
    flex: 1;
    border-right: 1px solid var(--necudah-border);
    position: relative;
}

.necudah-timegrid-cell:last-child {
    border-right: none;
}

/* Day view: single column, cell takes full width */
.necudah-timegrid-body:not(.necudah-timegrid-body--week) .necudah-timegrid-cell {
    flex: 1;
}

.necudah-timegrid-events {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Event blocks in time grid */
.necudah-timegrid-event {
    position: absolute;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    pointer-events: auto;
    cursor: default;
    z-index: 1;
    border-left: 3px solid transparent;
    transition: box-shadow 0.15s;
}

.necudah-timegrid-event:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 2;
}

.necudah-timegrid-event--group {
    background: #dbeafe;
    color: #1e40af;
    border-left-color: #3b82f6;
}

.necudah-timegrid-event--private {
    background: #fef3c7;
    color: #92400e;
    border-left-color: #f59e0b;
}

.necudah-timegrid-event--global {
    background: #d1fae5;
    color: #065f46;
    border-left-color: #10b981;
}

.necudah-timegrid-event-title {
    display: block;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.necudah-timegrid-event-time {
    display: block;
    font-size: 10px;
    opacity: 0.75;
    margin-top: 1px;
}

/* Current time indicator */
.necudah-timegrid-now {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #ef4444;
    z-index: 5;
    pointer-events: none;
}

.necudah-timegrid-now::before {
    content: '';
    position: absolute;
    left: 54px;
    top: -4px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
}

.necudah-timegrid-now-label {
    position: absolute;
    left: 0;
    top: -8px;
    font-size: 10px;
    font-weight: 700;
    color: #ef4444;
    background: var(--necudah-bg-alt, #fff);
    padding: 0 4px;
    line-height: 1;
}

/* Week view header */
.necudah-timegrid-week-header {
    display: flex;
    border-bottom: 2px solid var(--necudah-border);
    background: var(--necudah-bg-alt);
}

.necudah-timegrid-corner {
    width: 60px;
    min-width: 60px;
    border-right: 1px solid var(--necudah-border);
}

.necudah-timegrid-week-day {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    text-decoration: none;
    color: var(--necudah-text);
    border-right: 1px solid var(--necudah-border);
    transition: background 0.15s;
}

.necudah-timegrid-week-day:last-child {
    border-right: none;
}

.necudah-timegrid-week-day:hover {
    background: rgba(37, 99, 235, 0.04);
}

.necudah-timegrid-week-day--today {
    background: rgba(37, 99, 235, 0.06);
}

.necudah-timegrid-week-dayname {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--necudah-text-light);
}

.necudah-timegrid-week-daynum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    width: 30px;
    height: 30px;
    margin-top: 2px;
}

.necudah-timegrid-week-day--today .necudah-timegrid-week-daynum {
    background: var(--necudah-primary);
    color: white;
    border-radius: 50%;
}

/* Week view: 7 columns */
.necudah-timegrid-body--week .necudah-timegrid-row {
    display: flex;
}

.necudah-timegrid-body--week .necudah-timegrid-cell {
    flex: 1;
    min-width: 0;
}

/* Week view event column positioning */
.necudah-timegrid--week .necudah-timegrid-event {
    /* Width per column: (100% - 60px label) / 7 */
    width: calc((100% - 60px) / 7 - 6px);
}

.necudah-timegrid--week .necudah-timegrid-event--col-0 { left: calc(60px + (100% - 60px) / 7 * 0 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-1 { left: calc(60px + (100% - 60px) / 7 * 1 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-2 { left: calc(60px + (100% - 60px) / 7 * 2 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-3 { left: calc(60px + (100% - 60px) / 7 * 3 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-4 { left: calc(60px + (100% - 60px) / 7 * 4 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-5 { left: calc(60px + (100% - 60px) / 7 * 5 + 3px); }
.necudah-timegrid--week .necudah-timegrid-event--col-6 { left: calc(60px + (100% - 60px) / 7 * 6 + 3px); }

/* Week view minimum width for readability */
.necudah-timegrid--week {
    min-width: 700px;
}

/* Responsive: time grid */
@media (max-width: 768px) {
    .necudah-calendar-view-tabs {
        flex-wrap: wrap;
    }

    .necudah-timegrid-label {
        width: 44px;
        min-width: 44px;
        font-size: 10px;
        padding-right: 4px;
    }

    .necudah-timegrid-corner {
        width: 44px;
        min-width: 44px;
    }

    .necudah-timegrid--week .necudah-timegrid-event {
        width: calc((100% - 44px) / 7 - 4px);
    }

    .necudah-timegrid--week .necudah-timegrid-event--col-0 { left: calc(44px + (100% - 44px) / 7 * 0 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-1 { left: calc(44px + (100% - 44px) / 7 * 1 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-2 { left: calc(44px + (100% - 44px) / 7 * 2 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-3 { left: calc(44px + (100% - 44px) / 7 * 3 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-4 { left: calc(44px + (100% - 44px) / 7 * 4 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-5 { left: calc(44px + (100% - 44px) / 7 * 5 + 2px); }
    .necudah-timegrid--week .necudah-timegrid-event--col-6 { left: calc(44px + (100% - 44px) / 7 * 6 + 2px); }

    .necudah-timegrid-event-time {
        display: none;
    }

    .necudah-timegrid-week-dayname {
        font-size: 9px;
    }

    .necudah-timegrid-week-daynum {
        font-size: 13px;
        width: 24px;
        height: 24px;
    }

    /* Day view: event full width minus label */
    .necudah-timegrid-body:not(.necudah-timegrid-body--week) .necudah-timegrid-event {
        left: 48px !important;
        right: 4px !important;
    }
}

/* Directory Grid */
.necudah-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.necudah-member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    position: relative;
    transition: box-shadow 0.2s;
}

.necudah-member-card:hover {
    box-shadow: var(--necudah-shadow-lg);
}

.necudah-member-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.necudah-member-info {
    margin-top: 12px;
}

.necudah-member-info h4 {
    margin: 0 0 8px;
    font-size: 16px;
}

.necudah-member-info h4 a {
    color: var(--necudah-text);
    text-decoration: none;
}

.necudah-member-type {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    color: white;
    border-radius: 10px;
}

.necudah-member-bio {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--necudah-text-light);
}

.necudah-member-action {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--necudah-text-light);
    opacity: 0;
    transition: opacity 0.2s;
}

.necudah-member-card:hover .necudah-member-action {
    opacity: 1;
}

/* Empty State */
.necudah-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.necudah-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--necudah-text-light);
    opacity: 0.5;
    margin-bottom: 16px;
}

.necudah-empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.necudah-empty-state p {
    margin: 0 0 20px;
    color: var(--necudah-text-light);
}

/* Pagination */
.necudah-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.necudah-pagination a,
.necudah-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    color: var(--necudah-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.necudah-pagination a:hover {
    border-color: var(--necudah-primary);
    color: var(--necudah-primary);
}

.necudah-pagination .current {
    background: var(--necudah-primary);
    border-color: var(--necudah-primary);
    color: white;
}

@media (max-width: 768px) {
    .necudah-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .necudah-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .necudah-search-form input {
        min-width: 100%;
    }

    .necudah-event-card {
        flex-direction: column;
    }

    .necudah-event-date,
    .necudah-event-date-badge {
        width: auto;
        display: flex;
        gap: 8px;
        padding: 8px 12px;
    }

    .necudah-date-month,
    .necudah-date-day,
    .necudah-event-month,
    .necudah-event-day {
        display: inline;
        font-size: 14px;
    }

    .necudah-event-actions {
        flex-wrap: wrap;
    }

    .necudah-event-type-selector {
        flex-direction: column;
    }
}

/* ==========================================
   Messaging Page
   ========================================== */

.necudah-messages-page {
    min-height: calc(100vh - 150px);
}

/* Spacing overrides for the messages page to fit under header */
.necudah-messages-page .site-main {
    padding-top: 20px !important;
}

.necudah-messages-page .necudah-card {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.necudah-messages-container {
    display: flex;
    height: calc(100vh - 220px);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 500px;
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    overflow: hidden;
    background: var(--necudah-bg);
}

/* Conversations Sidebar */
.necudah-conversations-sidebar {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--necudah-border);
    display: flex;
    flex-direction: column;
}

.necudah-conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-conversations-header h2 {
    margin: 0;
    font-size: 18px;
}

.necudah-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.necudah-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--necudah-border);
    transition: background 0.2s;
}

.necudah-conversation-item:hover {
    background: var(--necudah-bg-alt);
}

.necudah-conversation-item.active {
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--necudah-primary);
}

.necudah-conversation-item.unread {
    background: #fef3c7;
}

.necudah-conv-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--necudah-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
}

.necudah-conv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.necudah-conv-avatar .dashicons {
    font-size: 24px;
    color: var(--necudah-text-light);
}

.necudah-conv-info {
    flex: 1;
    min-width: 0;
}

.necudah-conv-info strong {
    display: block;
    font-size: 14px;
    color: var(--necudah-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.necudah-conv-time {
    font-size: 12px;
    color: var(--necudah-text-light);
}

.necudah-empty-conversations {
    text-align: center;
    padding: 40px 20px;
}

.necudah-empty-conversations .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--necudah-text-light);
    opacity: 0.3;
}

/* Messages Main */
.necudah-messages-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.necudah-message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--necudah-border);
    background: var(--necudah-bg);
}

.necudah-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.necudah-header-info strong {
    display: block;
    font-size: 16px;
}

.necudah-header-info span {
    font-size: 12px;
    color: var(--necudah-text-light);
}

/* Message Thread */
.necudah-messages-thread {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--necudah-bg-alt);
}

.necudah-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 70%;
}

.necudah-message-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.necudah-message-theirs {
    align-self: flex-start;
}

.necudah-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.necudah-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
}

.necudah-message-theirs .necudah-msg-bubble {
    background: var(--necudah-bg);
    border: 1px solid var(--necudah-border);
    border-bottom-left-radius: 4px;
}

.necudah-message-mine .necudah-msg-bubble {
    background: var(--necudah-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.necudah-msg-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.necudah-msg-time {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

/* Message Form */
.necudah-message-form {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--necudah-border);
    background: var(--necudah-bg);
}

.necudah-message-form textarea {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--necudah-border);
    border-radius: 20px;
    resize: none;
    font-size: 14px;
    max-height: 120px;
}

.necudah-message-form button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    padding: 0;
}

.necudah-message-form button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Select Conversation State */
.necudah-select-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.necudah-select-conversation .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: var(--necudah-text-light);
    opacity: 0.3;
    margin-bottom: 16px;
}

.necudah-select-conversation h3 {
    margin: 0 0 8px;
}

.necudah-select-conversation p {
    margin: 0;
    color: var(--necudah-text-light);
}

/* Back button — hidden on desktop */
.necudah-chat-back {
    display: none;
}

/* ===== Mobile Messages: WhatsApp-style view switching ===== */
@media (max-width: 768px) {
    .necudah-messages-page {
        min-height: calc(100vh - 140px);
    }

    .necudah-messages-container {
        height: calc(100vh - 140px);
        min-height: auto;
        border: none;
        border-radius: 0;
    }

    /* Default: show conversation list, hide chat */
    .necudah-conversations-sidebar {
        width: 100%;
        flex: 1;
        border-right: none;
    }

    .necudah-messages-main {
        display: none;
    }

    /* When a chat is active: hide list, show chat */
    .necudah-chat-active .necudah-conversations-sidebar {
        display: none;
    }

    .necudah-chat-active .necudah-messages-main {
        display: flex;
        flex: 1;
    }

    /* Back button — visible on mobile */
    .necudah-chat-back {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        color: var(--necudah-text, #374151);
        text-decoration: none;
        flex-shrink: 0;
        -webkit-tap-highlight-color: transparent;
    }
    .necudah-chat-back:hover {
        background: var(--necudah-bg-alt, #f3f4f6);
    }
    .necudah-chat-back .dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    /* Chat header: tighter on mobile */
    .necudah-message-header {
        padding: 10px 12px;
        gap: 10px;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Messages thread: full height */
    .necudah-messages-thread {
        padding: 12px;
        gap: 8px;
    }

    /* Bubbles: wider on mobile */
    .necudah-message {
        max-width: 85%;
    }

    /* Message form: sticky bottom, above tab bar */
    .necudah-message-form {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        position: sticky;
        bottom: 0;
        z-index: 10;
    }
    .necudah-message-form textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Conversation list: full screen, larger items */
    .necudah-conversations-header {
        padding: 14px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--necudah-bg, #fff);
    }

    .necudah-conversation-item {
        padding: 14px 16px;
    }

    /* Select conversation empty state: full screen */
    .necudah-select-conversation {
        padding: 60px 20px;
    }

    /* Group settings button */
    .necudah-group-settings-btn {
        margin-left: auto;
    }

    /* Dark mode */
    [data-theme="dark"] .necudah-chat-back {
        color: var(--necudah-text, #d7dadc);
    }
    [data-theme="dark"] .necudah-chat-back:hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

/* Modal System */
.necudah-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-bar .necudah-modal {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .necudah-modal {
        top: 46px;
    }
}

.necudah-modal.active {
    display: block;
}

.necudah-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1;
}

.necudah-modal-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    width: calc(100% - 40px);
    max-width: 550px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: 30px auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.necudah-modal.active .necudah-modal-content {
    /* static positioning — no transforms */
}

.necudah-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.necudah-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.necudah-modal-header .necudah-modal-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.necudah-modal-header .necudah-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.necudah-modal-body {
    padding: 32px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    background: #ffffff;
}

.necudah-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 32px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    border-radius: 0 0 16px 16px;
}

/* Form Enhancements */
.necudah-form-group {
    margin-bottom: 24px;
}

.necudah-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.necudah-form-input,
.necudah-form-select {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    transition: all 0.2s;
}

.necudah-form-input:focus,
.necudah-form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.necudah-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.necudah-btn-success {
    background: #10b981;
    color: white;
}

.necudah-btn-success:hover {
    background: #059669;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.necudah-label-optional {
    font-weight: 400;
    color: #94a3b8;
    font-size: 13px;
    margin-left: 4px;
}

.necudah-required {
    color: #ef4444;
    margin-left: 2px;
}

/* Custom Select Styling */
.necudah-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
}

/* Notice Styling */
.necudah-notice {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}

.necudah-notice-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.necudah-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Single Group View */
.necudah-single-group {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.necudah-group-header-premium {
    background: var(--necudah-card-bg);
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    box-shadow: var(--necudah-shadow);
    margin-bottom: 24px;
    border: 1px solid var(--necudah-border);
}

.necudah-group-cover-premium {
    height: 250px;
    background-size: cover;
    background-position: center;
    background-color: var(--necudah-bg-alt);
}

.necudah-group-cover-default {
    background: var(--necudah-primary);
    background: linear-gradient(135deg, var(--necudah-primary) 0%, var(--necudah-bg-alt) 100%);
    opacity: 0.8;
}

[data-theme="dark"] .necudah-group-cover-default {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    opacity: 1;
}

.necudah-group-header-content {
    padding: 0 40px;
}

.necudah-group-header-main {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-top: -30px;
    padding-bottom: 20px;
    padding-top: 10px;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-group-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: var(--necudah-card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 6px solid var(--necudah-card-bg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.necudah-group-avatar-large .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: var(--necudah-primary);
}

.necudah-group-title-info {
    flex: 1;
    padding-bottom: 4px;
    padding-top: 8px;
}

.necudah-group-name {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: var(--necudah-text);
    letter-spacing: -0.01em;
}

.necudah-group-meta-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.necudah-group-type-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
}

.necudah-group-stat {
    font-size: 14px;
    color: var(--necudah-text-light);
}

.necudah-group-stat strong {
    color: var(--necudah-text);
}

.necudah-group-header-actions {
    padding-bottom: 12px;
}

.necudah-group-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 0;
}

.necudah-group-tab {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--necudah-text-light);
    text-decoration: none;
    transition: all 0.2s;
}

.necudah-group-tab:hover {
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
}

.necudah-group-tab.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--necudah-primary);
}

.necudah-group-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.necudah-tab-content {
    display: none;
}

.necudah-tab-content.active {
    display: block;
}

/* Sidebar Styles */
.necudah-group-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

.necudah-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.necudah-info-item .label {
    color: var(--necudah-text-light);
}

.necudah-info-item .value {
    font-weight: 600;
}

.necudah-group-search {
    position: relative;
}

.necudah-group-search input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: var(--necudah-bg-alt);
    border: 1px solid var(--necudah-border);
    border-radius: 12px;
    color: var(--necudah-text);
}

.necudah-group-search button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    color: var(--necudah-text-light);
    cursor: pointer;
}

@media (max-width: 900px) {
    .necudah-group-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .necudah-group-header-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -80px;
    }

    .necudah-group-header-content {
        padding: 0 20px;
    }

    .necudah-group-tabs {
        justify-content: center;
    }
}

/* Group Header Premium Refinement & Shadow */
.necudah-group-cover-premium {
    position: relative;
    overflow: hidden;
    height: 300px;
}

.necudah-group-cover-shadow {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    z-index: 1;
}

.necudah-group-header-content {
    position: relative;
    z-index: 2;
}

/* Feed Composer */
.necudah-composer-card {
    padding: 16px !important;
    margin-bottom: 24px;
}

.necudah-composer-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.necudah-composer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.necudah-composer-card textarea {
    flex: 1;
    border: 1px solid var(--necudah-border);
    border-radius: 8px;
    padding: 12px;
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
    resize: none;
    min-height: 50px;
    font-family: inherit;
    transition: all 0.2s;
}

.necudah-composer-card textarea:focus {
    outline: none;
    border-color: var(--necudah-primary);
    background: var(--necudah-card-bg);
    min-height: 100px;
}

.necudah-composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--necudah-border);
}

.necudah-composer-actions select {
    background: var(--necudah-bg-alt);
    border: 1px solid var(--necudah-border);
    color: var(--necudah-text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}

/* Post Cards (Reddit Style) */
.necudah-post-card {
    margin-bottom: 16px;
    padding: 16px !important;
    transition: border-color 0.2s;
}

.necudah-post-card:hover {
    border-color: #878a8c;
}

.necudah-post-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.necudah-post-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.necudah-post-meta-wrap {
    flex: 1;
}

.necudah-post-author {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--necudah-text);
}

.necudah-post-date {
    font-size: 12px;
    color: var(--necudah-text-light);
}

.necudah-post-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
}

.necudah-post-badge.announcement {
    background: #ffd5d5;
    color: #cc0000;
}

[data-theme="dark"] .necudah-post-badge.announcement {
    background: #441111;
    color: #ff5555;
}

.necudah-post-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--necudah-text);
}

/* Post Actions Menu (3-dot dropdown) */
.necudah-post-actions-menu {
    position: relative;
    margin-left: auto;
}

.necudah-post-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    color: var(--necudah-text-light);
    transition: background 0.2s;
}

.necudah-post-menu-trigger:hover {
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
}

.necudah-post-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--necudah-card-bg);
    border: 1px solid var(--necudah-border);
    border-radius: var(--necudah-radius);
    box-shadow: var(--necudah-shadow-lg);
    padding: 6px 0;
    min-width: 120px;
    z-index: 100;
    display: none;
}

.necudah-post-menu.show {
    display: block;
}

.necudah-post-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--necudah-text);
    transition: background 0.2s;
}

.necudah-post-menu button:hover {
    background: var(--necudah-bg-alt);
}

.necudah-post-menu button.necudah-delete-post {
    color: var(--necudah-danger);
}

/* Post Footer (Comments Button) */
.necudah-post-footer {
    padding-top: 12px;
    border-top: 1px solid var(--necudah-border);
    margin-top: 12px;
}

.necudah-toggle-comments {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--necudah-text-light);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.necudah-toggle-comments:hover {
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
}

/* Comments Section */
.necudah-comments-section {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid var(--necudah-border);
}

.necudah-comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.necudah-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.necudah-comment-content {
    flex: 1;
    background: var(--necudah-bg-alt);
    padding: 10px 12px;
    border-radius: var(--necudah-radius);
}

.necudah-comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--necudah-text);
}

.necudah-comment-time {
    font-size: 12px;
    color: var(--necudah-text-light);
    margin-left: 8px;
}

.necudah-comment-content p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--necudah-text);
}

.necudah-no-comments {
    font-size: 14px;
    color: var(--necudah-text-light);
    padding: 10px 0;
}

/* Comment Form */
.necudah-comment-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.necudah-comment-form img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.necudah-comment-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--necudah-border);
    border-radius: 20px;
    background: var(--necudah-bg-alt);
    font-size: 14px;
}

.necudah-comment-form button {
    background: var(--necudah-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.necudah-comment-form button:hover {
    background: #1d4ed8;
}

/* Pinned Post Indicator */
.necudah-pinned-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--necudah-primary);
    padding: 6px 10px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
}

.necudah-activity-post.pinned {
    border: 1px solid var(--necudah-primary);
    background: rgba(37, 99, 235, 0.02);
}

/* Settings & Forms */
.necudah-settings-form .necudah-form-group {
    margin-bottom: 20px;
}

.necudah-settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--necudah-text);
}

.necudah-settings-form input[type="text"],
.necudah-settings-form textarea,
.necudah-settings-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--necudah-border);
    border-radius: 6px;
    background: var(--necudah-bg-alt);
    color: var(--necudah-text);
}

.necudah-card.danger-zone {
    border: 1px solid #ff585b !important;
}

.necudah-card.danger-zone h3 {
    color: #ff585b;
}

/* Empty States & Loading */
.necudah-empty-feed {
    text-align: center;
    padding: 48px;
    color: var(--necudah-text-light);
}

.necudah-empty-feed .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    display: inline-block;
    opacity: 0.3;
}

.necudah-feed-loading {
    text-align: center;
    padding: 40px;
}

.necudah-feed-loading .dashicons {
    font-size: 32px;
    animation: spin-nec 1s linear infinite;
}

@keyframes spin-nec {
    100% {
        transform: rotate(360deg);
    }
}

[data-theme="dark"] .necudah-post-card:hover {
    border-color: #d7dadc;
}

/* Group Avatar Image Fix */
.necudah-group-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Groups Directory Avatar Styling */
.necudah-group-card-header {
    position: relative;
    margin-bottom: 20px;
}

.necudah-group-card-avatar {
    position: absolute;
    bottom: -20px;
    left: 20px;
    width: 64px;
    height: 64px;
    background: var(--necudah-card-bg);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--necudah-card-bg);
}

.necudah-group-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.necudah-group-card-avatar .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--necudah-text-light);
}

.necudah-group-card .necudah-group-content {
    padding-top: 10px;
}

/* Member Management Styles */
.necudah-search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--necudah-card-bg);
    border: 1px solid var(--necudah-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.necudah-search-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.necudah-add-selected-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--necudah-border);
}

.necudah-add-selected-user:last-child {
    border-bottom: none;
}

.necudah-add-selected-user:hover {
    background: var(--necudah-bg-alt);
}

.necudah-add-selected-user .search-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.necudah-add-selected-user .search-info {
    flex: 1;
}

/* Manage Members List */
.necudah-manage-member-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--necudah-bg-alt);
    border-radius: 12px;
    margin-bottom: 12px;
}

.necudah-manage-member-item .member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.necudah-manage-member-item .member-info {
    flex: 1;
}

.necudah-manage-member-item .member-info strong {
    display: block;
    font-size: 15px;
}

.necudah-manage-member-item .member-info span {
    font-size: 13px;
    color: var(--necudah-text-light);
}

.necudah-manage-member-item .member-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.necudah-manage-member-item select {
    background: var(--necudah-card-bg);
    border: 1px solid var(--necudah-border);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.necudah-btn-icon {
    background: none;
    border: none;
    color: var(--necudah-text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.necudah-btn-icon:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff585b;
}

[data-theme="dark"] .necudah-search-results-dropdown {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

/* ========================
   Repeat / Recurrence UI
   ======================== */

/* Day selector buttons */
.necudah-repeat-days-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.necudah-repeat-day-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.necudah-repeat-day-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.necudah-repeat-day-btn.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* Recurring badge */
.necudah-badge-recurring {
    background: #ede9fe;
    color: #7c3aed;
}

.necudah-badge-recurring .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

/* List view edit/delete actions */
.necudah-event-edit-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.necudah-btn-icon-danger:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.necudah-list-edit-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

/* Recurrence scope selector in edit modal */
.necudah-recurrence-scope-options {
    display: flex;
    gap: 8px;
}

.necudah-recurrence-scope-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.necudah-recurrence-scope-option:hover {
    border-color: #a5b4fc;
}

.necudah-recurrence-scope-option.active {
    border-color: #6366f1;
    background: #eef2ff;
}

.necudah-recurrence-scope-option .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.necudah-recurrence-scope-option.active .dashicons {
    color: #6366f1;
}

/* Date/Time Picker */
.necudah-datetime-picker {
    margin-bottom: 16px;
}
.necudah-datetime-row {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}
.necudah-datetime-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}
.necudah-datetime-date {
    flex: 1.2;
}
.necudah-datetime-time {
    flex: 1;
}
.necudah-datetime-field select,
.necudah-datetime-field input[type="date"] {
    width: 100%;
}
.necudah-datetime-extras {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.necudah-duration-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}
.necudah-quick-duration {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.necudah-quick-btn {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    color: #374151;
    transition: all 0.15s;
    line-height: 1.4;
}
.necudah-quick-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: #eef2ff;
}
.necudah-quick-btn.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
@media (max-width: 600px) {
    .necudah-datetime-row {
        flex-direction: column;
        gap: 8px;
    }
    .necudah-datetime-extras {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==============================================
   MOBILE RESPONSIVE FIXES — Events Page
   Covers: 768px (tablet), 640px, 480px (phone)
   ============================================== */

/* --- Tablet (768px) — improve existing rules --- */
@media (max-width: 768px) {
    /* Calendar: improve readability */
    .necudah-calendar-header {
        padding: 12px 14px;
    }
    .necudah-calendar-title {
        font-size: 15px;
    }
    .necudah-calendar-weekday {
        padding: 6px 2px;
        font-size: 10px;
    }
    .necudah-calendar-day-num {
        font-size: 11px;
    }

    /* Event cards: reduce gap + padding */
    .necudah-event-card {
        gap: 12px;
        padding: 14px;
    }
    .necudah-event-content h3 {
        font-size: 16px;
    }
    .necudah-event-meta {
        gap: 10px;
    }

    /* Popover: ensure it never overflows viewport */
    .necudah-event-popover {
        max-width: calc(100vw - 32px);
    }

    /* Edit modal: reduce body padding */
    .necudah-edit-event-modal-body {
        padding: 16px;
    }

    /* Page header: full-width create button */
    .necudah-page-header .necudah-btn {
        width: 100%;
        justify-content: center;
    }

    /* Filter tabs: scrollable horizontally */
    .necudah-filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 4px;
        padding-bottom: 4px;
    }
    .necudah-filter-tabs a {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Calendar view tabs: smaller on tablet */
    .necudah-calendar-view-tab {
        padding: 5px 12px;
        font-size: 12px;
    }
    .necudah-calendar-today-btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* Create form wrapper: reduce padding */
    #necudah-events-page-form-wrap > div {
        padding: 16px !important;
    }
}

/* --- Small phones (640px) — stack and simplify --- */
@media (max-width: 640px) {
    /* Calendar month: smaller cells, dot indicators */
    .necudah-calendar-day {
        min-height: 48px;
        padding: 3px;
    }
    .necudah-calendar-event {
        font-size: 0;
        padding: 0;
        height: 6px;
        width: 6px;
        border-radius: 50%;
        display: inline-block;
        margin: 1px;
        min-width: 6px;
    }
    .necudah-calendar-event-time {
        display: none;
    }
    .necudah-calendar-day-events {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    /* Popover: full-width on small phones */
    .necudah-event-popover {
        width: calc(100vw - 24px) !important;
        max-width: none;
    }
    .necudah-event-popover-inner {
        padding: 16px;
    }
    .necudah-event-popover-actions {
        flex-direction: column;
    }
    .necudah-event-popover-actions .necudah-btn {
        width: 100%;
        justify-content: center;
    }

    /* Edit modal: tighter layout */
    .necudah-edit-event-overlay {
        padding: 8px;
    }
    .necudah-edit-event-modal-header {
        padding: 12px 14px;
    }
    .necudah-edit-event-modal-header h3 {
        font-size: 16px;
    }
    .necudah-edit-event-modal-body {
        padding: 14px;
    }
    .necudah-edit-event-modal-footer {
        padding: 12px 14px;
        flex-direction: column;
    }
    .necudah-edit-event-modal-footer .necudah-btn {
        width: 100%;
        justify-content: center;
    }

    /* Event cards: tighter */
    .necudah-event-card {
        gap: 10px;
        padding: 12px;
    }
    .necudah-event-date-badge {
        padding: 6px 10px;
    }
    .necudah-event-actions {
        width: 100%;
    }
    .necudah-event-actions .necudah-btn {
        flex: 1;
        justify-content: center;
        font-size: 12px;
        padding: 6px 8px;
    }

    /* Time grid day view: narrower label */
    .necudah-timegrid-label {
        width: 38px;
        min-width: 38px;
        font-size: 9px;
        padding: 2px 3px 0 0;
    }
    .necudah-timegrid-corner {
        width: 38px;
        min-width: 38px;
    }
    .necudah-timegrid-body:not(.necudah-timegrid-body--week) .necudah-timegrid-event {
        left: 42px !important;
        right: 4px !important;
    }
    .necudah-timegrid-now::before {
        left: 33px;
    }

    /* Calendar header nav: smaller touch targets */
    .necudah-calendar-nav {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    /* Recurrence scope options: stack */
    .necudah-recurrence-scope-options {
        flex-direction: column;
    }

    /* Form inline styles overrides (create form + edit modal) */
    .necudah-events-page select.necudah-form-control,
    .necudah-edit-event-modal select.necudah-form-control {
        min-width: 0 !important;
        width: 100% !important;
    }
    .necudah-events-page input[type="number"].necudah-form-control,
    .necudah-edit-event-modal input[type="number"].necudah-form-control {
        width: 100% !important;
    }
    .necudah-events-page .necudah-repeat-days-row,
    .necudah-edit-event-modal .necudah-repeat-days-row {
        gap: 4px;
    }
    .necudah-events-page .necudah-repeat-day-btn span,
    .necudah-edit-event-modal .necudah-repeat-day-btn span {
        font-size: 11px;
        padding: 4px 6px;
    }

    /* Quick duration buttons: wrap tighter */
    .necudah-quick-duration {
        gap: 4px;
    }
    .necudah-quick-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* Reminder/cancellation section */
    .necudah-events-page #ep-cancellation-options > div,
    .necudah-edit-event-modal #edit-cancellation-options > div {
        flex-direction: column;
        align-items: flex-start !important;
    }

    /* Edit modal: recurrence scope stack */
    .necudah-recurrence-scope-options {
        flex-direction: column;
    }
}

/* --- Extra small phones (480px) — maximum compression --- */
@media (max-width: 480px) {
    /* Calendar month: even smaller */
    .necudah-calendar-day {
        min-height: 40px;
        padding: 2px;
    }
    .necudah-calendar-day-num {
        font-size: 10px;
    }
    .necudah-calendar-weekday {
        padding: 4px 1px;
        font-size: 9px;
        letter-spacing: -0.3px;
    }
    .necudah-calendar-day--today .necudah-calendar-day-num {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    .necudah-calendar-event {
        height: 5px;
        width: 5px;
    }

    /* Calendar header: stack title */
    .necudah-calendar-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .necudah-calendar-title {
        font-size: 14px;
        width: 100%;
        text-align: center;
        order: -1;
    }

    /* View tabs: scroll */
    .necudah-calendar-view-tabs {
        gap: 2px;
    }
    .necudah-calendar-view-tab {
        padding: 4px 8px;
        font-size: 11px;
    }
    .necudah-calendar-today-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Event card: stack everything */
    .necudah-event-content h3 {
        font-size: 14px;
    }
    .necudah-event-meta {
        flex-direction: column;
        gap: 4px;
        font-size: 12px;
    }
    .necudah-event-desc {
        font-size: 13px;
    }

    /* Popover: maximum width */
    .necudah-event-popover {
        width: calc(100vw - 16px) !important;
    }
    .necudah-event-popover-inner {
        padding: 14px;
    }
    .necudah-event-popover-header h4 {
        font-size: 14px;
    }

    /* Page header */
    .necudah-page-header h1 {
        font-size: 22px;
    }
    .necudah-page-header p {
        font-size: 13px;
    }

    /* Pagination: smaller */
    .necudah-pagination a,
    .necudah-pagination span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }

    /* Empty state */
    .necudah-empty-state {
        padding: 40px 16px;
    }
    .necudah-empty-state .dashicons {
        font-size: 36px;
        width: 36px;
        height: 36px;
    }
    .necudah-empty-state h3 {
        font-size: 17px;
    }
}