#advancedFilters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.5s ease-in-out, padding-top 0.5s ease-in-out, padding-bottom 0.5s ease-in-out, border-width 0.1s ease-in-out;
    border-width: 0;
}
#advancedFilters.open {
    max-height: 1000px;
    padding-top: 20px;
    padding-bottom: 20px;
    border-width: 1px;
}

#toggleFiltersBtn.open svg {
    transform: rotate(180deg);
}

#togglePostFormBtn.open svg {
    transform: rotate(180deg);
}

#advancedFilters .form-group {
    margin-bottom: 0;
}

#password-strength-container {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

#password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

#password-strength-bar.weak {
    background-color: #ef4444;
    width: 33%;
}
#password-strength-bar.medium {
    background-color: #f59e0b;
    width: 66%;
}
#password-strength-bar.strong {
    background-color: #22c55e;
    width: 100%;
}

.strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #6b7280;
    height: 1.2em;
}

#mainPostForm {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
    transition: max-height 0.7s ease-in-out, padding 0.7s ease-in-out, margin 0.7s ease-in-out, border-width 0.2s ease-in-out;
}
#mainPostForm.open {
    max-height: 2000px;
    padding-top: 24px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-width: 1px;
}

.form-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0a0a0a;
}

.post-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    position: relative;
}

.post-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.premium-irish-post {
    background-color: #FF883E;
    border-color: #E67A38;
}
.premium-irish-post .post-title,
.premium-irish-post .post-content,
.premium-irish-post .post-meta,
.premium-irish-post .post-meta .author-link,
.premium-irish-post .post-budget,
.premium-irish-post .post-budget strong,
.premium-irish-post .post-details span,
.premium-irish-post .post-contact strong,
.premium-irish-post .contact-detail {
    color: #000000;
}
.premium-irish-post .post-meta svg,
.premium-irish-post .post-details svg,
.premium-irish-post .post-budget svg,
.premium-irish-post .contact-detail svg {
    color: #4B5563;
}
.premium-irish-post .post-type {
    background: #000;
    color: #FF883E;
}
.premium-irish-post .post-author-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.premium-irish-post .post-author-showcase .author-line {
    display: flex;
    align-items: center;
    gap: 8px;
}
.premium-irish-post .post-author-showcase .author-link {
    font-weight: 600;
    color: #000;
}

/* *** ADDED styles for deal item showcase *** */
.deal-item .post-author-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.deal-item .post-author-showcase .author-line {
    display: flex;
    align-items: center;
    gap: 8px;
}
.deal-item .post-author-showcase .author-link {
    font-weight: 600;
    color: #1e40af; /* Kept blue for Deals showcase for contrast */
}
.deal-item .post-author-showcase .rating-display {
    color: #4b5563;
}
.deal-item .post-author-showcase .rating-display .stars-container svg {
    color: #f59e0b;
}
/* *** End added deal item styles *** */

.emerald-post {
    background: #ecfdf5;
    border-color: #10b981;
}

.new-post-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #16a34a;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

.deal-item .new-post-badge {
    right: 65px;
}

@keyframes pulsate {
    0% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.8); }
    100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }
}

.urgent-post {
    border-color: #ef4444;
    animation: pulsate 2s infinite;
}

.post-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.post-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-type.urgent-tag {
    background: #fee2e2;
    color: #b91c1c;
}

.post-type.new-user-tag {
    background: #e0e7ff;
    color: #3730a3;
}

.post-title-meta-wrapper {
    flex-basis: 100%;
}

.post-type.job {
    background: #dbeafe;
    color: #1e40af;
}
.post-type.service {
    background: #dcfce7;
    color: #166534;
}
.post-type.lead {
    background: #fef3c7;
    color: #92400e;
}
.post-type.deal {
    background: #e0f2fe;
    color: #0369a1;
}
.post-type.seeking_job {
    background: #fff7ed;
    color: #c2410c;
}

.post-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #0a0a0a;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.post-meta {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.author-info-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

/* --- MODIFIED: Changed color to black --- */
.post-meta .author-link {
    font-weight: 600;
    color: #0a0a0a; /* Changed from blue */
    text-decoration: none;
}
.post-meta .author-link:hover {
    text-decoration: underline;
}
/* --- END MODIFICATION --- */

.post-meta-stack {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.post-meta-item:not(:empty):not(:first-child)::before {
    content: '•';
    margin: 0 8px;
}
.post-meta-item a {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.post-meta-item a:hover {
    text-decoration: underline;
}

.post-content {
    margin: 16px 0;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    color: #374151;
    line-height: 1.6;
    overflow-wrap: break-word;
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #9ca3af #f3f4f6;
}

.post-details {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}
.post-details span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.post-details svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.post-budget {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.post-budget strong {
    color: #374151;
}

/* *** KEPT baseline alignment from previous step *** */
.budget-payment-method {
    display: inline-flex;
    align-items: baseline; /* Keep baseline */
    gap: 4px;
}
.budget-payment-method svg {
    flex-shrink: 0;
}
/* *** ADDED RULE TO NUDGE ICON DOWN *** */
.budget-payment-method svg.budget-icon-cash,
.budget-payment-method svg.budget-icon-card {
    position: relative; /* Enable positioning */
    top: 2px; /* Move down by 2 pixels (adjust if needed) */
}
/* *** END ADDED RULE *** */


.post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

/* *** MODIFIED RULE - USING GRID *** */
.post-contact {
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
    display: grid; /* Changed from flex */
    grid-template-columns: 1fr auto; /* Details take remaining space, logo takes its content size */
    grid-template-rows: auto auto; /* Row 1 for details/logo, Row 2 for prompt */
    gap: 0 16px; /* No row gap, 16px column gap */
    align-items: start; /* Align items to the top of their grid cell */
}
/* *** END MODIFIED RULE *** */

/* *** MODIFIED RULE - POSITION IN GRID *** */
.post-contact-details {
    grid-column: 1 / 2; /* Place in first column */
    grid-row: 1 / 2;    /* Place in first row */
    flex-grow: 0; /* Remove flex-grow as grid handles sizing */
}
/* *** END MODIFIED RULE *** */

.post-contact strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}
.contact-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #374151;
}
.contact-detail:not(:last-child) {
    margin-bottom: 8px;
}
.contact-detail svg {
    width: 16px;
    height: 16px;
    color: #6b7280;
    flex-shrink: 0;
}

/* *** MODIFIED RULE - POSITION IN GRID & SIZE *** */
.post-contact-logo {
    grid-column: 2 / 3; /* Place in second column */
    grid-row: 1 / 2;    /* Place in first row */
    /* width: 36%; REMOVED percentage width */
    max-width: 172px;   /* Increased max-width */
    width: 100%;        /* Allow it to fill grid column up to max-width */
    height: auto;
    max-height: 156px;  /* Increased max-height */
    border-radius: 8px;
    object-fit: contain;
    margin-left: 0;
    flex-shrink: 0; /* Still useful to prevent shrinking if column is tight */
    align-self: start; /* Align self to top within grid cell */
}
/* *** END MODIFIED RULE *** */

/* *** MODIFIED RULE - POSITION IN GRID *** */
.login-prompt {
    grid-column: 1 / 3; /* Span both columns */
    grid-row: 2 / 3;    /* Place in second row */
    margin-top: 12px;
    text-align: center; /* Center the inline-block button inside */
    width: 100%;       /* Make the prompt container take full width */
}
/* *** END MODIFIED RULE *** */

/* Optional: Ensure the button behaves like an inline block for centering */
.login-prompt .btn {
    display: inline-block; /* Allow text-align:center to work */
    /* width: auto; /* Let the button size itself, or set a max-width */
    max-width: 200px; /* Example: Limit button width */
    width: 60%; /* Or slightly smaller percentage */
    /* Ensure justify-content doesn't interfere if set inline */
    justify-content: center !important;
}


.vote-btn {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vote-btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vote-btn.positive {
    color: #16a34a;
}

.vote-btn.negative {
    color: #dc2626;
}

.vote-btn.positive:hover:not(:disabled) {
    background: #f0fdf4;
    border-color: #16a34a;
}

.vote-btn.negative:hover:not(:disabled) {
    background: #fef2f2;
    border-color: #dc2626;
}

.user-info {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #374151;
}

#mainPostSpecificDate {
    margin-top: 8px;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.actions-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px; /* <<< This was the change from your first request */
}

.favorite-icon {
    width: 20px;
    height: 20px;
}

.btn-icon.favorited .favorite-icon {
    fill: #facc15;
    stroke: #facc15;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.language-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e5e7eb;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 500;
}
.remove-tag {
    margin-left: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #6b7280;
}
.remove-tag:hover {
    color: #0a0a0a;
}

.terms-box {
    height: 150px;
    border: 1px solid #e5e7eb;
    padding: 10px;
    border-radius: 8px;
    overflow-y: scroll;
    background-color: #f9fafb;
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 12px;
}
.terms-box h3 {
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 4px;
}
 .terms-box ul {
    padding-left: 20px;
}
 .terms-box li {
    margin-bottom: 6px;
}

.terms-notice {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
}

#reportModal .form-group {
    margin-bottom: 12px;
}
#reportModal input[type="radio"] {
    display: none;
}
#reportModal .form-group label {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}
#reportModal .form-group label:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}
#reportModal input[type="radio"]:checked + label {
    background-color: #0a0a0a;
    border-color: #0a0a0a;
    color: #ffffff;
    font-weight: 600;
}
.report-success-view {
    text-align: center;
}
.report-success-view svg {
    color: #16a34a;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
}
.report-success-view p {
    font-size: 16px;
    color: #374151;
}

#paginationControls {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.page-btn {
    padding: 8px 14px;
    min-width: 40px;
    text-align: center;
}

.page-btn.active {
    background: #0a0a0a;
    color: #fff;
    border-color: #0a0a0a;
}

.profile-grid-container {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 24px;
}

.profile-card-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out;
}

.profile-card-item h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 12px;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
#profileName {
    flex-grow: 1;
    font-size: 22px;
    font-weight: 600;
}

.profile-details p {
    margin-bottom: 12px;
    color: #374151;
}
.profile-details strong {
    color: #111827;
}

.premium-card {
    background: #eef2ff;
    border-color: #c7d2fe;
}
.premium-card h3 {
    color: #3730a3;
}

.clickable-card:hover {
    transform: translateY(-3px);
    cursor: pointer;
}

.setting-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input { display: none; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 4px; bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider { background-color: #16a34a; }
input:checked + .slider:before { transform: translateX(22px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.profile-about, .profile-privacy, .profile-blocked-users, .profile-premium, .profile-messages {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.blocked-user-info {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}
.blocked-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.blocked-user-item:last-child {
    border-bottom: none;
}
.blocked-user-item span {
    font-weight: 500;
}
#profileActions {
    position: relative;
}
.options-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
    width: 140px;
    overflow: hidden;
}
.menu-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.menu-item:hover {
    background-color: #f9fafb;
}
.menu-item-danger {
    color: #dc2626;
}

.logo-preview {
    margin-top: 10px;
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}
.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-card, .help-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.about-card h2, .help-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
}
.about-card p, .about-card li, .help-card p, .help-card li {
    margin-bottom: 12px;
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
}
.about-section, .help-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}
.about-section:first-of-type, .help-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.about-section h3, .help-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

#specialDealsSection {
    margin-bottom: 32px;
}

.deal-item {
    background: linear-gradient(135deg, #f3e7e9 0%, #e3eeff 100%);
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.deal-item::before {
    content: 'DEAL';
    position: absolute;
    top: 10px;
    right: -30px;
    background-color: #FF883E;
    color: white;
    padding: 4px 30px;
    font-size: 12px;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.deal-prices {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 12px;
}

.deal-original-price {
    text-decoration: line-through;
    color: #6b7280;
    font-size: 16px;
}

.deal-new-price {
    font-size: 22px;
    font-weight: 700;
    color: #16a34a;
}

.deal-expiry {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* --- UPDATED NOTIFICATION DOT STYLE --- */
#messageNotification {
    position: absolute;
    top: -8px;
    right: -8px;
    /* display: flex; REMOVED this line */
    align-items: center; /* keep */
    justify-content: center; /* keep */
    min-width: 22px;
    height: 22px;
    padding: 2px 5px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1; /* Helps vertical center */
    text-align: center; /* Added for horizontal center */
    color: #fff;
    background-color: #dc2626;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.message-item {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.message-item.unread {
    background-color: #eef2ff;
    border-color: #c7d2fe;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    color: #6b7280;
}

.message-body {
    color: #374151;
    margin-bottom: 12px;
    overflow-wrap: break-word;
}

.message-reply-form {
    margin-top: 12px;
}

.mission-statement {
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 24px;
}
.mission-statement h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #111827;
}
.mission-statement p {
    font-size: 16px;
    color: #374151;
    max-width: 500px;
    margin: 0 auto;
}

.company-info-box {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.7;
}

.help-topic {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}
.help-topic:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.help-topic h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}
.help-topic h4 svg {
    color: #1e40af;
    flex-shrink: 0;
}
.help-topic ul {
    list-style-position: inside;
    padding-left: 4px;
}
.help-topic li {
    margin-bottom: 8px;
}

#singlePostContent .post-item {
    border: none;
    box-shadow: none;
    margin-bottom: 0;
    padding: 12px;
}

#singlePostContent .post-item:hover {
    border: none;
    box-shadow: none;
}

#messagesList {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
}

.conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-bottom: 1px solid #f0f2f5;
    /* REMOVED: cursor: pointer; (moved to conversation-main) */
    transition: background-color 0.2s ease;
    gap: 16px;
}

.conversation-item:last-child {
    border-bottom: none;
}

/* Apply hover only to main content area */
.conversation-main:hover {
     background-color: #f9fafb;
     cursor: pointer;
}


.conversation-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    min-width: 0;
}

.conversation-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.conversation-sender-subject {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-sender {
    font-weight: 600;
    color: #1f1f1f;
    font-size: 15px;
    flex-shrink: 0;
}

.conversation-subject {
    font-weight: 400;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-snippet {
    font-size: 14px;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-meta {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
    display: flex; /* Make meta a flex container */
    align-items: center; /* Vertically align items inside */
}

/* Style for the hide button */
.hide-conversation-btn {
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #9ca3af;
}
.hide-conversation-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}
.hide-conversation-btn svg {
    display: block; /* Helps prevent extra space */
}


.conversation-indicator {
    width: 8px;
    height: 8px;
    background-color: transparent;
    border-radius: 50%;
    flex-shrink: 0;
}

.conversation-item.unread .conversation-indicator {
    background-color: #FF883E; /* Changed from blue to orange */
}

.conversation-item.unread .conversation-sender,
.conversation-item.unread .conversation-subject {
    font-weight: 700;
    color: #111827;
}

/* Make the meta text (date) also orange for more emphasis */
.conversation-item.unread .conversation-meta {
    font-weight: 700;
    color: #FF883E;
}

#authSuccessView {
    text-align: center;
    padding: 32px 24px;
}

#authSuccessView h2 {
    margin-bottom: 0;
}

.success-icon-container {
    margin-bottom: 20px;
}

.success-icon {
    width: 64px;
    height: 64px;
    color: #16a34a;
}

.success-heading {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.success-subheading {
    font-size: 16px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 16px;
}

.success-email {
    font-size: 18px;
    font-weight: 500;
    color: #0a0a0a;
    background-color: #f3f4f6;
    padding: 10px 16px;
    border-radius: 8px;
    display: inline-block;
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.success-footer-text {
    font-size: 14px;
    color: #6b7280;
}

.post-content::-webkit-scrollbar {
  width: 8px;
}

.post-content::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.post-content::-webkit-scrollbar-thumb {
  background-color: #9ca3af;
  border-radius: 4px;
  border: 2px solid #f3f4f6;
}

.post-content::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280;
}

#postsViewContainer {
    position: relative;
    width: 100%;
    margin-top: 24px;
}

#mainPostsList.swiper {
    display: block;
    overflow: visible;
}

#mainPostsList .swiper-wrapper {
    display: block;
}

#mainPostsList .swiper-slide {
    display: block;
    width: 100%;
    margin-bottom: 16px;
}

.swiper-pagination, .swiper-button-prev, .swiper-button-next {
    display: none;
}

/* *** UPDATED RULE FOR RESIZABLE MODAL *** */
.conversation-modal-content {
    display: flex;
    flex-direction: column;
    height: 80vh;       /* Initial height */
    max-height: 95vh;   /* Max height constraint */
    width: 70%;         /* Initial width */
    max-width: 1200px;  /* Max width constraint */
    resize: both;       /* Allows resizing in both directions */
    overflow: auto;     /* Adds scrollbars if content overflows */
    min-width: 400px;   /* Optional: Prevent making it too narrow */
    min-height: 500px;  /* Optional: Prevent making it too short */
    position: relative;
    /* *** INCREASED PADDING FOR EASIER GRABBING *** */
    padding-bottom: 15px; /* Increased space at the bottom */
    padding-right: 15px;  /* Increased space at the right */
    /* Restore original padding for other sides */
    padding-left: 32px;
    padding-top: 32px;
    /* Restore other properties */
    border-radius: 16px;
    background: #fff;
    /* Ensure transform is still applied */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}


#conversationHeader {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    /* Adjust padding if needed due to parent padding change */
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}
#conversationHeader h3 {
    margin-bottom: 4px;
}
#conversationHeader p {
    font-size: 13px;
    color: #6b7280;
}

#messageHistory {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.4;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-content {
    margin: 0;
}

.message-timestamp {
    font-size: 11px;
    color: #6b7280;
    opacity: 0.8;
}

.message-bubble.received {
    background-color: #f3f4f6;
    color: #111827;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble.sent {
    background-color: #0a0a0a;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    align-items: flex-end;
}

.message-bubble.sent .message-timestamp {
    color: #f3f4f6;
}

#conversationReplyForm {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    /* Adjust padding if needed due to parent padding change */
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
}

/* Restrict textarea resizing */
#replyMessageContent {
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
}

/* Ensure form group doesn't cause overflow */
#conversationReplyForm .form-group {
    overflow: hidden;
    margin-bottom: 10px; /* Reduced margin slightly */
}

/* *** ADDED rule to move button away from corner *** */
#conversationReplyForm .btn-group {
    justify-content: flex-end;
    margin-right: 10px;
    margin-bottom: 5px;
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.profile-rating-display {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.stars-container {
    display: flex;
    gap: 2px;
}
.stars-container svg {
    width: 16px;
    height: 16px;
    color: #f59e0b;
}

.no-reviews {
    font-style: italic;
}

.star-rating-input {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}
.star-rating-input svg {
    width: 32px;
    height: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}
.star-rating-input svg:hover {
    color: #facc15;
    transform: scale(1.1);
}
.star-rating-input:hover svg {
    color: #facc15;
}
.star-rating-input svg:hover ~ svg {
    color: #d1d5db;
}

.star-rating-input.rated {
    pointer-events: none;
}

/* --- ADDED Reset Filter Button Style --- */
.reset-filter-btn {
    padding: 6px; /* Make it smaller */
    background-color: #f3f4f6; /* Light grey background */
    border-color: #e5e7eb;
}
.reset-filter-btn:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
}
.reset-filter-btn svg {
    color: #6b7280;
}
/* --- END --- */

/* *** ADDED rule for blocked user link color *** */
.blocked-user-item .author-link,
.blocked-user-item .author-link:visited {
    color: #0a0a0a; /* Black color */
    text-decoration: none; /* Optional: Keep no underline */
}
.blocked-user-item .author-link:hover {
    text-decoration: underline; /* Standard link hover */
}
/* *** END ADDED rule *** */

@media (max-width: 768px) {
    .form-card, .profile-card-item, .about-card, .help-card, .members-card { /* Added .members-card */
        padding: 20px;
    }
    .contact-method-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .post-header {
        flex-wrap: wrap;
    }
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    .post-meta-stack {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-top: 8px;
    }
    .post-meta-item:not(:empty):not(:first-child)::before {
        display: none;
    }

    /* Update post-contact for mobile with Grid */
    .post-contact {
        grid-template-columns: 1fr; /* Stack details and logo */
        grid-template-rows: auto auto auto; /* Row for details, logo, prompt */
        gap: 16px 0; /* Only row gap */
        align-items: start; /* Keep alignment */
    }
    .post-contact-details {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }
    /* Update mobile logo size */
    .post-contact-logo {
        grid-column: 1 / 2; /* Stack below details */
        grid-row: 2 / 3;
        max-width: 156px; /* Increased from 120px */
        max-height: 130px; /* Increased height proportionally (approx) */
        margin-left: 0;
        justify-self: start; /* Align logo itself to the start */
    }
     .login-prompt {
        grid-column: 1 / 2; /* Stack below logo */
        grid-row: 3 / 4;
    }
    /* End Grid update for mobile */

    .post-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    #tips-cloud {
        width: 90%;
        max-width: 280px;
        bottom: 55px;
        right: 5%;
        font-size: 13px;
        padding: 12px 16px;
        padding-right: 30px;
        padding-top: 12px; /* Adjusted padding */
    }

    .about-card h2, .help-card h2, .members-card h2 { /* Added .members-card */
        font-size: 20px;
    }

    #advancedFilters {
        grid-template-columns: 1fr;
    }

    /* --- ADDED: Make member filters single column on mobile --- */
    .member-filters {
        grid-template-columns: 1fr;
    }
    /* --- END ADD --- */

    #postsViewContainer {
        min-height: auto;
    }

    #mainPostsList.swiper {
        width: 100%;
        height: 100%;
        display: block;
        overflow: hidden;
        border-radius: 12px;
    }

    #mainPostsList .swiper-wrapper {
        display: flex;
    }

    #mainPostsList .swiper-slide {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        flex-shrink: 0;
        height: auto;
        margin-bottom: 0;
    }

    #mainPostsList .post-item {
        width: 100%;
        height: auto;
        margin-bottom: 0;
    }

    .swiper-pagination {
        display: block;
        position: relative;
        bottom: 0;
        margin-top: 16px;
    }

    .swiper-pagination-bullet {
        background-color: #d1d5db;
        opacity: 1;
    }

    .swiper-pagination-bullet-active {
        background-color: #FF883E;
    }

    #paginationControls {
        display: none;
    }
    .swiper-button-prev, .swiper-button-next {
       display: none;
    }

    #singlePostModal .modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 16px;
        padding-top: 50px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    #singlePostModal #singlePostContent {
        flex-grow: 1;
        overflow-y: auto;
    }

    #singlePostModal .close-btn {
        position: fixed;
        top: 15px;
        right: 15px;
        background-color: rgba(0, 0, 0, 0.2);
        color: white;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 28px;
        line-height: 1;
        text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }

    .ad-slot .ad-content-wrapper {
        aspect-ratio: 16 / 9;
        margin-bottom: 8px;
    }

    .ad-slot {
        padding: 12px;
    }

    /* Adjust chat modal size on smaller screens */
    .conversation-modal-content {
        width: 95%;
        min-width: 300px; /* Reduced min-width */
        min-height: 400px;
        height: 85vh;
        max-width: 95%; /* Allow it to take up more width */
        resize: none; /* Disable resizing on mobile */
        /* --- MOBILE CHAT BUTTON FIX: Increased padding --- */
        padding: 16px;
        padding-bottom: 15px; /* Increased from 10px */
        padding-right: 15px; /* Increased from 10px */
    }

     /* Adjust header/form padding inside modal on mobile */
    #conversationHeader, #conversationReplyForm {
        padding-left: 0;
        padding-right: 0;
    }

    /* Adjust button margin on mobile */
    #conversationReplyForm .btn-group {
        /* --- MOBILE CHAT BUTTON FIX: Increased margins --- */
        margin-right: 10px;  /* Increased from 5px */
        margin-bottom: 10px; /* Increased from 5px */
    }

}

@media (min-width: 769px) {
    /* Restore 2-column layout only if NOT in holiday view */
    .profile-grid-container:not(.holiday-view-active) {
        grid-template-columns: repeat(2, 1fr);
    }

    .profile-grid-container:not(.holiday-view-active) .about-card-expanded {
        grid-column: 1 / -1;
    }

    .profile-grid-container:not(.holiday-view-active) .full-width-card {
        grid-column: 1 / -1;
    }

    /* ADDED FOR MEMBERS PAGE */
    #membersListContainer {
        grid-template-columns: 1fr 1fr; /* 2 columns on desktop */
    }

    /* --- MODIFIED: Member filters layout on desktop --- */
    .member-filters.open {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for filters when open */
    }
    /* --- END MODIFICATION --- */
}

.card-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

@keyframes pulse-red-star {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.premium-irish-post .rating-display .stars-container svg {
    color: #dc2626;
    animation: pulse-red-star 1.5s infinite ease-in-out;
}

.ad-slot {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.ad-slot h4 {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.ad-slot a {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: #1e40af;
}

.ad-slot a:hover {
    text-decoration: underline;
}

.ad-slot .ad-content-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.ad-slot .ad-video-player,
.ad-slot .ad-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ad-slot .ad-video-player {
    object-fit: cover;
}

.ad-slot .ad-logo {
    object-fit: contain;
    padding: 15%;
}

.ad-slot .ad-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: bold;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
    padding: 0;
}

.ad-slot .ad-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.ad-slot .ad-mute-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s ease;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slot .ad-mute-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.ad-slot .ad-mute-btn svg {
    width: 100%;
    height: 100%;
}

#advertisement-slot-container {
    display: none;
    margin-bottom: 24px;
}

.conversation-sender .author-link,
.conversation-sender .author-link:visited {
    color: #0a0a0a; /* Change from default purple/blue to black */
    text-decoration: none;
}

.conversation-sender .author-link:hover {
    text-decoration: underline;
}

#blockedUsersList {
    max-height: 220px; /* Sets a maximum height. Adjust this value if you want it taller or shorter. */
    overflow-y: auto;  /* Adds a vertical scrollbar only when the content overflows. */
    padding-right: 10px; /* Prevents the scrollbar from overlapping the content. */
}

/* ---------------------------------------------
--- STYLES ADDED FOR HOLIDAY MODE FEATURE ---
---------------------------------------------
*/
.holiday-notice {
    background-color: #fff7ed; /* Light orange background */
    border: 1px solid #fed7aa; /* Orange border */
    border-radius: 8px;
    padding: 16px; /* Slightly less padding */
    margin-top: 24px; /* Space above the notice */
    color: #7c2d12; /* Dark orange text */
}

/* Style the "Not Available" heading like other card subheadings */
.holiday-notice h3 {
    font-size: 16px; /* Adjust size to match other secondary headings if needed */
    font-weight: 600;
    color: #c2410c; /* Keep orange/red color for emphasis */
    margin-bottom: 8px; /* Space below heading */
    padding-bottom: 0; /* Remove potential bottom border/padding from default h3 */
    border-bottom: none; /* Ensure no border */
}

/* Standard paragraph styling within the notice */
.holiday-notice p {
    color: #374151; /* Standard text color */
    font-size: 14px; /* Standard text size */
    line-height: 1.6;
    margin-bottom: 8px; /* Consistent spacing */
}
 .holiday-notice p:last-child {
    margin-bottom: 0; /* Remove margin from last paragraph within the notice */
 }

/* Styling for the optional user message */
.holiday-notice .holiday-message {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #fed7aa; /* Keep dashed separator */
    font-style: italic;
    color: #4b5563; /* Slightly muted color */
    white-space: pre-wrap; /* Respect line breaks */
    word-break: break-word; /* Prevent long words from overflowing */
    font-size: 14px; /* Match other paragraph text */
}

/* Holiday Mode Profile Layout Override (Added for Holiday Feature) */
.profile-grid-container.holiday-view-active {
    grid-template-columns: 1fr; /* Force single column */
    max-width: 480px; /* Limit width of the single column */
    margin-left: auto; /* Center the grid container */
    margin-right: auto; /* Center the grid container */
}

/* Explicitly hide the second card container when in holiday mode */
.profile-grid-container.holiday-view-active .profile-card-item:nth-child(2) {
    display: none;
}

/* Explicitly hide the third card (About) container when in holiday mode */
.profile-grid-container.holiday-view-active .profile-card-item.about-card-expanded {
    display: none;
}

/* ----------------------------------------------------
--- STYLES ADDED FOR HELP PAGE PAGINATION ---
----------------------------------------------------
*/
.pagination-controls {
    display: flex;
    justify-content: space-between; /* Space out Prev/Next buttons */
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6; /* Separator line */
}

.page-indicator {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280; /* Muted text color */
}

/* Ensure buttons have appropriate padding */
#helpPaginationControls .page-btn {
    padding: 8px 14px;
}

/* Ensure Prev/Next have consistent width if needed */
#helpPaginationControls #helpPrevBtn,
#helpPaginationControls #helpNextBtn {
    min-width: 80px; /* Example minimum width */
    justify-content: center; /* Center text in button */
}

/* ----------------------------------------------------
--- STYLES ADDED FOR TIPS CLOUD TITLE ---
----------------------------------------------------
*/
#tip-title {
    font-size: 14px; /* Match paragraph size or slightly larger */
    font-weight: 600; /* Make it bold */
    color: #166534; /* Your desired green color */
    margin-bottom: 8px; /* Add space below the title */
    padding-bottom: 6px; /* Add space below title text */
    border-bottom: 1px solid #a7f3d0; /* Optional light green separator */
}

/* Adjust top padding of the cloud if needed */
#tips-cloud {
    padding-top: 12px;
}

/* Adjust margin of the tip text */
#tip-text {
    margin-top: 0; /* Remove potential top margin if title handles spacing */
}

/* ----------------------------------------------------
--- STYLES ADDED FOR MEMBERS LIST PAGE ---
----------------------------------------------------
*/
.members-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.members-card h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
}
.members-card p {
    margin-bottom: 24px;
    color: #374151;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}
.members-card .form-group {
    margin-bottom: 24px;
}

/* --- START: Added Member Filter Styles --- */
.member-filters {
    background: #f9fafb; /* Light background for filter area */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 24px; /* Space between filters and search */
    display: grid;
    grid-template-columns: 1fr; /* Default to single column */
    gap: 16px;
    max-height: 0;
    overflow: hidden;
    padding: 0 20px; /* Only horizontal padding when closed */
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out, border-width 0.1s ease-in-out;
    border-width: 0;
}
.member-filters.open {
    max-height: 500px; /* Adjust as needed */
    padding: 20px; /* Padding on all sides when open */
    border-width: 1px;
    /* --- ADDED grid-template-columns for open state on larger screens (handled in @media below) --- */
}
/* Ensure form group inside filters has no bottom margin */
.member-filters .form-group {
    margin-bottom: 0;
}
/* Style the toggle button when open */
#toggleMemberFiltersBtn.open svg {
    transform: rotate(180deg);
}
/* --- END: Added Member Filter Styles --- */

/* --- START: Added Member List Item Styles --- */
.member-item-speciality {
    font-size: 15px;
    color: #166534; /* Green */
    font-weight: 500;
    margin-top: 4px;
}

.member-item-experience {
    font-size: 13px; /* Slightly smaller */
    color: #4b5563;  /* Grey */
    font-weight: 500;
    margin-top: 4px;
}
/* --- END: Added Member List Item Styles --- */

#membersListContainer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-height: 800px; /* Give the list a max height */
    overflow-y: auto; /* Make it scrollable */
    padding-right: 10px; /* Space for scrollbar */
}

.member-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    background-color: #f9fafb;
}
.member-item:hover {
    border-color: #d1d5db;
    background-color: #fff;
}

.member-item-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e5e7eb; /* Placeholder color */
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.member-item-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.member-item-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-weight: 600;
    font-size: 24px;
}

.member-item-info {
    flex-grow: 1;
    min-width: 0; /* Prevents overflow */
}
/* *** MODIFIED RULE: Change display to inline-block *** */
.member-item-info .author-link {
    font-size: 16px;
    font-weight: 600;
    color: #0a0a0a; /* Changed from blue */
    text-decoration: none;
    display: inline-block; /* Changed from block */
    vertical-align: middle; /* Helps align with the badge */
}
/* *** END MODIFIED RULE *** */
.member-item-info .author-link:hover {
    text-decoration: underline;
}

.member-item-type {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280; /* Keep grey for type */
    margin-top: 2px;
    text-transform: capitalize;
}

/* ----------------------------------------------------
--- STYLES ADDED/MODIFIED FOR ONLINE/OFFLINE PRESENCE ---
----------------------------------------------------
*/
.online-indicator,
.offline-indicator {
    display: inline-block; /* Keep inline-block */
    margin-left: 8px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    vertical-align: middle; /* Align vertically with the username */
}

.online-indicator {
    background-color: #22c55e; /* Bright Green */
    /* Add a subtle pulse animation */
    animation: pulse-green 2s infinite;
}

/* NEW: Offline indicator style */
.offline-indicator {
    background-color: #ef4444; /* Red */
    opacity: 0.7; /* Make it slightly less prominent than online */
}


@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* --- START: Collapsible Profile Sections --- */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    /* Remove default bottom border from h3 if it's inside */
    border-bottom: none !important; 
    padding-bottom: 0 !important;
    margin-bottom: 12px; /* Add space before content */
}

.collapsible-header h3 {
    /* Ensure h3 doesn't have conflicting styles */
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.collapsible-header .chevron-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Arrow rotation: Point up when open */
.collapsible-header.open .chevron-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
}

.collapsible-content.open {
    max-height: 2000px; /* Large value to allow for content */
}

/* Special case for #messagesList which is a content div */
#messagesList.collapsible-content {
    /* It already has styles, just add max-height and overflow */
    max-height: 0;
    overflow: auto; /* It needs to scroll internally */
    transition: max-height 0.5s ease-in-out, padding-top 0.5s ease-in-out, padding-bottom 0.5s ease-in-out, border-width 0.1s ease-in-out;
    border-width: 0; /* Start with no border */
}
#messagesList.collapsible-content.open {
    max-height: 800px; /* Restore its scrollable height */
    border-width: 1px; /* Restore its border */
    /* Padding is already handled by its original rules */
}

/* Special case for #blockedUsersList which is a content div */
#blockedUsersList.collapsible-content {
    /* It already has styles, just add max-height */
    max-height: 0;
    /* overflow-y: auto; is already set */
    transition: max-height 0.5s ease-in-out, padding-top 0.5s ease-in-out, padding-bottom 0.5s ease-in-out;
    padding-top: 0;
    padding-bottom: 0;
}
#blockedUsersList.collapsible-content.open {
    max-height: 220px; /* Restore its scrollable height */
    padding-top: 0; /* It has no padding */
    padding-bottom: 0;
}
/* --- END: Collapsible Profile Sections --- */
/* =================================================================================
   INVOICE PAGE STYLES
================================================================================== */

.invoice-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.invoice-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #0a0a0a;
}

.invoice-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.invoice-parties-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.invoice-table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-table th {
    background-color: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
}

.invoice-table tbody tr:last-child td {
    border-bottom: none;
}

.invoice-table .item-desc {
    width: 100%;
}
.invoice-table .item-qty,
.invoice-table .item-price {
    width: 90%;
    min-width: 70px;
    text-align: right;
}

.invoice-totals {
    max-width: 300px;
    margin-left: auto;
    margin-top: 24px;
    display: grid;
    gap: 10px;
}
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}
.total-row span:first-child {
    font-weight: 500;
    color: #374151;
}
.total-row span:last-child {
    font-weight: 600;
    color: #111827;
}
.total-row.total-grand {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid #e5e7eb;
    padding-top: 10px;
    margin-top: 10px;
}

.invoice-uploads-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}

/* Responsive adjustments for invoice page */
@media (max-width: 768px) {
    .invoice-card {
        padding: 20px;
    }
    .invoice-details-grid {
        grid-template-columns: 1fr;
    }
    .invoice-parties-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .invoice-uploads-grid {
        grid-template-columns: 1fr;
    }
}

/* =================================================================================
   NEW SIGNATURE PAD MODAL STYLES
================================================================================== */

#sigPadWrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    /* Ensure the canvas is responsive but has a max width */
    width: 100%;
    max-width: 434px;
    margin: 0 auto;
    /* This creates the aspect ratio */
    height: 0;
    padding-bottom: 46.3%; /* This is (200 / 432) * 100% */
    position: relative;
    background-color: #f9fafb;
}

#signature-pad {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* =================================================================================
   NEW PHOTO UPLOADER STYLES
================================================================================== */

.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.photo-upload-slot {
    position: relative;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.photo-upload-slot input[type="file"] {
    display: none;
}

.photo-upload-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: background-color 0.2s ease;
    z-index: 1; /* Below preview */
}

.photo-upload-label:hover {
    background-color: #f3f4f6;
}

.photo-upload-label svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
}

.photo-upload-label span {
    font-size: 13px;
    font-weight: 500;
}

.photo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Hidden by default */
    z-index: 2;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-clear-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

@media (max-width: 768px) {
    .photo-upload-grid {
        grid-template-columns: repeat(2, 1fr); /* Keep 2 columns on mobile */
    }
}

/* =================================================================================
   NEW "VIEW PHOTOS" BUTTON STYLES (CORRECTED)
================================================================================== */
@keyframes pulse-green-border {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    transform: scale(1.02);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    transform: scale(1);
  }
}

.view-photos-btn {
    display: inline-flex !important; /* Use !important to override .btn-link */
    align-items: center;
    gap: 8px; /* Space between icon and text */
    padding: 8px 14px; /* More padding */
    background-color: #ffffff !important; /* White background */
    border: 1px solid #e5e7eb; /* Light border */
    border-radius: 8px; /* Rounded corners */
    color: #16a34a !important; /* Darker green text */
    font-size: 14px; /* Slightly larger font */
    font-weight: 600; /* Bolder text */
    text-decoration: none !important; /* No underline by default */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    animation: pulse-green-border 2s infinite ease-out; /* Apply the pulsing animation */
}

.view-photos-btn:hover {
    background-color: #f0fdf4 !important; /* Very light green on hover */
    border-color: #a7f3d0; /* Lighter green border on hover */
    color: #147137 !important; /* Even darker green text on hover */
    text-decoration: none !important; /* Ensure no underline on hover */
    transform: scale(1.02); /* Slight scale on hover */
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2); /* More prominent shadow on hover */
    animation: none; /* Stop pulsing on hover for better interaction */
}

.view-photos-btn svg {
    width: 20px !important; /* Larger icon */
    height: 20px !important;
    color: #16a34a !important; /* Match text color */
    flex-shrink: 0;
}

/* Ensure the count next to "View Photos" is visible and styled consistently */
.view-photos-btn .photo-count {
    color: #6b7280; /* Muted grey for the count */
    font-size: 13px; /* Slightly smaller for the count */
    font-weight: 500;
}
/* =================================================================================
   NEW PHOTO SLIDER MODAL STYLES
================================================================================== */
.photo-slider-modal-content {
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    max-height: 800px;
    padding: 16px; /* Reduced padding for more image space */
    display: flex;
    flex-direction: column;
}

#photoSliderContainer {
    width: 100%;
    height: 100%; /* Take remaining height */
    flex-grow: 1;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

#photoSliderWrapper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#photoSliderWrapper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show the whole image */
}

/* Style Swiper Nav Buttons */
.photo-slider-modal-content .swiper-button-prev,
.photo-slider-modal-content .swiper-button-next {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    transition: background-color 0.2s ease;
}
.photo-slider-modal-content .swiper-button-prev::after,
.photo-slider-modal-content .swiper-button-next::after {
    font-size: 20px;
    font-weight: bold;
}

.photo-slider-modal-content .swiper-button-prev:hover,
.photo-slider-modal-content .swiper-button-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Style Swiper Pagination */
.photo-slider-modal-content .swiper-pagination {
    /* Position pagination inside the container at the bottom */
    position: absolute; 
    bottom: 10px;
}
.photo-slider-modal-content .swiper-pagination-bullet {
    background: #aaa;
    opacity: 1;
}

.photo-slider-modal-content .swiper-pagination-bullet-active {
    background: #fff;
}

/* Close button on top of slider */
.photo-slider-modal-content .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20; /* Above swiper */
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 28px;
    line-height: 36px;
    text-align: center;
}
.photo-slider-modal-content .close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .photo-slider-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        padding: 0;
        border-radius: 0;
    }
    
    .photo-slider-modal-content .close-btn {
        top: 15px;
        right: 15px;
    }
    
    .photo-slider-modal-content .swiper-button-prev,
    .photo-slider-modal-content .swiper-button-next {
        /* Hide nav arrows on small screens, rely on touch/swipe */
        display: none;
    }
}

/* =================================================================================
   NEW DELETE ACCOUNT STYLES
================================================================================== */

.setting-toggle.danger-zone span {
    font-weight: 500;
    color: #b91c1c; /* Dark red text */
}

/* =================================================================================
   NEW INVOICE/QUOTE TOGGLE STYLES
================================================================================== */
.doc-type-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background-color: #f3f4f6; /* Light grey background for the container */
    border-radius: 8px;
    padding: 4px;
    width: fit-content; /* Make the container fit its content */
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #e5e7eb;
}

.doc-type-toggle .btn.btn-sm {
    background-color: transparent; /* Default is transparent */
    color: #4b5563; /* Default text color is grey */
    border: none;
    box-shadow: none;
    font-weight: 600;
    flex-grow: 1; /* Make buttons share space */
    min-width: 100px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.doc-type-toggle .btn.btn-sm:hover {
    background-color: #e5e7eb; /* Light grey hover if not active */
    color: #111827;
}

.doc-type-toggle .btn.btn-sm.active {
    background-color: #0a0a0a !important; /* Solid black when active */
    color: #ffffff !important; /* White text when active */
    border-color: #0a0a0a !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}