/**
 * HOA Portal Pro - Public Styles
 *
 * WCAG 2.1 AA Compliant | ADA Accessible
 *
 * @package HOA_Portal_Pro
 * @version 1.0.5.0
 */

/* ================================
   CSS Variables / Theming
   ================================ */
:root {
    --hoa-primary: #0056b3;
    --hoa-primary-dark: #003d80;
    --hoa-secondary: #495057;
    --hoa-success: #1e7e34;
    --hoa-warning: #d39e00;
    --hoa-danger: #c82333;
    --hoa-info: #117a8b;
    --hoa-light: #f8f9fa;
    --hoa-dark: #212529;
    --hoa-border: #adb5bd;
    --hoa-border-radius: 4px;
    --hoa-spacing: 1rem;
    --hoa-transition: all 0.3s ease;
    --hoa-focus-color: #0056b3;
    --hoa-focus-width: 3px;
}

/* ================================
   Skip to Content (ADA)
   ================================ */
.hoa-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--hoa-dark);
    color: #fff;
    padding: 8px 16px;
    z-index: 100001;
    font-size: 0.875rem;
    text-decoration: none;
    transition: top 0.2s ease;
}

.hoa-skip-link:focus {
    top: 0;
    outline: var(--hoa-focus-width) solid var(--hoa-focus-color);
    outline-offset: 2px;
}

/* ================================
   Focus Indicators (ADA)
   ================================ */
.hoa-portal-pro *:focus-visible,
.hoa-portal-dashboard *:focus-visible {
    outline: var(--hoa-focus-width) solid var(--hoa-focus-color);
    outline-offset: 2px;
}

.hoa-btn:focus-visible,
.hoa-input:focus-visible,
.hoa-select:focus-visible,
.hoa-textarea:focus-visible,
.hoa-alert-dismiss:focus-visible,
.hoa-portal-pro a:focus-visible,
.hoa-portal-dashboard a:focus-visible {
    outline: var(--hoa-focus-width) solid var(--hoa-focus-color);
    outline-offset: 2px;
}

/* Remove default outline when not using keyboard */
.hoa-portal-pro :focus:not(:focus-visible),
.hoa-portal-dashboard :focus:not(:focus-visible) {
    outline: none;
}

/* ================================
   Base Styles
   ================================ */
.hoa-portal-pro {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--hoa-dark);
    font-size: 1rem;
}

.hoa-portal-pro *,
.hoa-portal-pro *::before,
.hoa-portal-pro *::after {
    box-sizing: border-box;
}

/* ================================
   Typography
   ================================ */
.hoa-portal-pro h1,
.hoa-portal-pro h2,
.hoa-portal-pro h3,
.hoa-portal-pro h4 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hoa-dark);
}

.hoa-portal-pro h2 { font-size: 1.75rem; }
.hoa-portal-pro h3 { font-size: 1.5rem; }
.hoa-portal-pro h4 { font-size: 1.25rem; }

.hoa-portal-pro p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* ================================
   Buttons
   ================================ */
.hoa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--hoa-border-radius);
    cursor: pointer;
    transition: var(--hoa-transition);
}

.hoa-btn:hover,
.hoa-btn:focus {
    opacity: 0.9;
}

.hoa-btn-primary {
    color: #fff;
    background-color: var(--hoa-primary);
    border-color: var(--hoa-primary);
}

.hoa-btn-primary:hover {
    background-color: var(--hoa-primary-dark);
    border-color: var(--hoa-primary-dark);
}

.hoa-btn-secondary {
    color: #333;
    background-color: var(--hoa-light);
    border-color: var(--hoa-border);
}

.hoa-btn-success {
    color: #fff;
    background-color: var(--hoa-success);
    border-color: var(--hoa-success);
}

.hoa-btn-danger {
    color: #fff;
    background-color: var(--hoa-danger);
    border-color: var(--hoa-danger);
}

.hoa-btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.hoa-btn-full {
    width: 100%;
}

/* ================================
   Forms
   ================================ */
.hoa-form {
    max-width: 100%;
}

.hoa-form-group {
    margin-bottom: 1rem;
}

.hoa-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hoa-form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hoa-form-row .hoa-form-group {
    flex: 1;
    min-width: 200px;
}

.hoa-input,
.hoa-select,
.hoa-textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    transition: var(--hoa-transition);
}

.hoa-input:focus,
.hoa-select:focus,
.hoa-textarea:focus {
    border-color: var(--hoa-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 115, 170, 0.25);
}

.hoa-textarea {
    resize: vertical;
    min-height: 100px;
}

.hoa-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.hoa-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.hoa-form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.hoa-form-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--hoa-border-radius);
}

.hoa-form-message.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.hoa-form-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.hoa-help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--hoa-secondary);
}

/* ================================
   Tables
   ================================ */
.hoa-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.hoa-table th,
.hoa-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--hoa-border);
}

.hoa-table th {
    font-weight: 600;
    background-color: var(--hoa-light);
}

.hoa-table tbody tr:hover {
    background-color: rgba(0, 115, 170, 0.05);
}

/* ================================
   Badges
   ================================ */
.hoa-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    text-transform: capitalize;
}

.hoa-badge-open,
.hoa-badge-pending {
    color: #856404;
    background-color: #fff3cd;
}

.hoa-badge-in_progress,
.hoa-badge-confirmed {
    color: #004085;
    background-color: #cce5ff;
}

.hoa-badge-resolved,
.hoa-badge-success {
    color: #155724;
    background-color: #d4edda;
}

.hoa-badge-closed,
.hoa-badge-cancelled {
    color: #383d41;
    background-color: #e2e3e5;
}

.hoa-badge-urgent,
.hoa-badge-priority-urgent {
    color: #fff;
    background-color: var(--hoa-danger);
}

.hoa-badge-high,
.hoa-badge-priority-high {
    color: #fff;
    background-color: #fd7e14;
}

.hoa-badge-medium,
.hoa-badge-priority-medium {
    color: #212529;
    background-color: var(--hoa-warning);
}

.hoa-badge-low,
.hoa-badge-priority-low {
    color: #155724;
    background-color: #d4edda;
}

.hoa-badge-category {
    color: #0c5460;
    background-color: #d1ecf1;
}

/* ================================
   Notices
   ================================ */
.hoa-notice {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--hoa-border-radius);
    border-left: 4px solid;
}

.hoa-notice-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: var(--hoa-info);
}

.hoa-notice-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: var(--hoa-warning);
}

.hoa-notice-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: var(--hoa-danger);
}

.hoa-notice-success {
    color: #155724;
    background-color: #d4edda;
    border-color: var(--hoa-success);
}

/* ================================
   Modal
   ================================ */
.hoa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hoa-modal-content {
    background-color: #fff;
    border-radius: var(--hoa-border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.hoa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--hoa-border);
}

.hoa-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.hoa-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--hoa-secondary);
    padding: 0;
    line-height: 1;
}

.hoa-modal-close:hover {
    color: var(--hoa-dark);
}

.hoa-modal-body {
    padding: 1.5rem;
}

/* ================================
   Filter Form
   ================================ */
.hoa-filter-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ================================
   Dashboard
   ================================ */
.hoa-portal-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.hoa-dashboard-header {
    margin-bottom: 2rem;
}

.hoa-welcome-message h2 {
    margin-bottom: 0.25rem;
}

.hoa-user-role {
    color: var(--hoa-secondary);
    font-size: 0.875rem;
}

.hoa-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.hoa-stat-card {
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    padding: 1.5rem;
    text-align: center;
}

.hoa-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hoa-stat-content {
    margin-bottom: 0.5rem;
}

.hoa-stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--hoa-primary);
}

.hoa-stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--hoa-secondary);
}

.hoa-stat-link {
    font-size: 0.75rem;
    color: var(--hoa-primary);
    text-decoration: none;
}

.hoa-stat-link:hover {
    text-decoration: underline;
}

.hoa-dashboard-nav {
    margin-bottom: 2rem;
}

.hoa-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.hoa-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    text-decoration: none;
    transition: var(--hoa-transition);
}

.hoa-quick-action:hover {
    border-color: var(--hoa-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hoa-action-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hoa-action-label {
    font-size: 0.875rem;
    color: var(--hoa-dark);
}

.hoa-dashboard-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
}

.hoa-dashboard-logout {
    margin-top: 2rem;
    text-align: center;
}

/* ================================
   Tickets
   ================================ */
.hoa-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.hoa-ticket-card {
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    padding: 1.25rem;
    transition: var(--hoa-transition);
}

.hoa-ticket-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hoa-ticket-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.hoa-ticket-id {
    font-size: 0.75rem;
    color: var(--hoa-secondary);
    font-family: monospace;
}

.hoa-ticket-title {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.hoa-ticket-meta {
    font-size: 0.75rem;
    color: var(--hoa-secondary);
    margin-bottom: 0.75rem;
}

.hoa-ticket-meta span {
    display: block;
    margin-bottom: 0.25rem;
}

.hoa-ticket-excerpt {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.hoa-ticket-actions {
    display: flex;
    gap: 0.5rem;
}

.hoa-ticket-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-ticket-badges {
    display: flex;
    gap: 0.5rem;
}

.hoa-ticket-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--hoa-light);
    border-radius: var(--hoa-border-radius);
}

.hoa-meta-item {
    font-size: 0.875rem;
}

.hoa-meta-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--hoa-secondary);
}

.hoa-ticket-detail-description {
    margin-bottom: 1.5rem;
}

.hoa-ticket-detail-description h3 {
    margin-bottom: 0.5rem;
}

.hoa-ticket-photo-gallery,
.hoa-ticket-ai-review {
    margin-bottom: 1.5rem;
}

.hoa-ticket-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
}

.hoa-ticket-photo-item {
    display: block;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    overflow: hidden;
    background: #fff;
}

.hoa-ticket-photo-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.hoa-ticket-ai-review {
    padding: 1rem;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    background: #f8fbff;
}

/* ================================
   Announcements
   ================================ */
.hoa-announcements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-announcements-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.hoa-announcements-pinned {
    margin-bottom: 2rem;
}

.hoa-announcement-card {
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.hoa-announcement-card.hoa-priority-urgent {
    border-left: 4px solid var(--hoa-danger);
}

.hoa-announcement-card.hoa-priority-important {
    border-left: 4px solid var(--hoa-warning);
}

.hoa-announcement-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.hoa-pin-icon {
    font-size: 0.875rem;
}

.hoa-announcement-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
}

.hoa-announcement-content {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.hoa-announcement-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--hoa-secondary);
}

.hoa-announcement-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--hoa-border);
}

/* ================================
   Amenities Calendar
   ================================ */
.hoa-amenities-wrapper {
    max-width: 100%;
}

.hoa-amenities-header {
    margin-bottom: 1.5rem;
}

.hoa-amenities-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-amenity-info {
    background: var(--hoa-light);
    padding: 1.5rem;
    border-radius: var(--hoa-border-radius);
    margin-bottom: 1.5rem;
}

.hoa-amenity-description {
    margin-bottom: 1rem;
    color: var(--hoa-secondary);
}

.hoa-amenity-details {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.hoa-amenity-rules {
    font-size: 0.875rem;
}

.hoa-amenity-rules h4 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.hoa-calendar-wrapper {
    margin-bottom: 2rem;
}

.hoa-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.hoa-calendar-grid {
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    overflow: hidden;
}

.hoa-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--hoa-light);
}

.hoa-calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--hoa-secondary);
}

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

.hoa-calendar-day {
    min-height: 80px;
    padding: 0.5rem;
    border-right: 1px solid var(--hoa-border);
    border-bottom: 1px solid var(--hoa-border);
    position: relative;
}

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

.hoa-calendar-day-empty {
    background: var(--hoa-light);
}

.hoa-calendar-day-today {
    background-color: rgba(0, 115, 170, 0.1);
}

.hoa-calendar-day-past {
    background-color: #f9f9f9;
    color: #999;
}

.hoa-day-number {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

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

.hoa-day-event {
    font-size: 0.625rem;
    padding: 2px 4px;
    border-radius: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hoa-event-pending {
    background-color: #fff3cd;
    color: #856404;
}

.hoa-event-confirmed {
    background-color: #cce5ff;
    color: #004085;
}

.hoa-event-own {
    font-weight: 600;
}

.hoa-btn-reserve {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.75rem;
    line-height: 1;
    background: var(--hoa-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: var(--hoa-transition);
}

.hoa-calendar-day:hover .hoa-btn-reserve {
    opacity: 1;
}

/* ================================
   Auth Forms
   ================================ */
.hoa-auth-wrapper {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    overflow: hidden;
}

.hoa-auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--hoa-border);
}

.hoa-auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--hoa-transition);
}

.hoa-auth-tab:hover {
    background: var(--hoa-light);
}

.hoa-auth-tab-active {
    background: var(--hoa-primary);
    color: #fff;
}

.hoa-auth-form {
    display: none;
    padding: 1.5rem;
}

.hoa-auth-form-active {
    display: block;
}

.hoa-form-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.hoa-form-links a {
    color: var(--hoa-primary);
    text-decoration: none;
}

.hoa-form-links a:hover {
    text-decoration: underline;
}

.hoa-form-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--hoa-light);
    border-radius: var(--hoa-border-radius);
    font-size: 0.75rem;
    color: var(--hoa-secondary);
}

/* ================================
   Responsive
   ================================ */
@media (max-width: 768px) {
    .hoa-form-row {
        flex-direction: column;
    }

    .hoa-form-row .hoa-form-group {
        min-width: 100%;
    }

    .hoa-tickets-header,
    .hoa-announcements-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .hoa-tickets-grid {
        grid-template-columns: 1fr;
    }

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

    .hoa-calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .hoa-day-number {
        font-size: 0.75rem;
    }

    .hoa-btn-reserve {
        opacity: 1;
    }
}

/* ================================
   Global Alert Bar
   ================================ */
.hoa-alert-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.hoa-alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-bottom: 2px solid var(--hoa-info);
}

.hoa-alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-bottom: 2px solid var(--hoa-warning);
}

.hoa-alert-urgent {
    background-color: #f8d7da;
    color: #721c24;
    border-bottom: 2px solid var(--hoa-danger);
    font-weight: 700;
}

.hoa-alert-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hoa-alert-icon {
    font-size: 1.25rem;
}

.hoa-alert-message {
    flex: 1;
}

.hoa-alert-dismiss {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.5rem;
    opacity: 0.7;
}

.hoa-alert-dismiss:hover {
    opacity: 1;
}

/* ================================
   Violations
   ================================ */
.hoa-violations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-violation-detail .hoa-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--hoa-light);
    border-radius: var(--hoa-border-radius);
}

.hoa-detail-section {
    margin-bottom: 1.5rem;
}

.hoa-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.hoa-photo-thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--hoa-border-radius);
    border: 1px solid var(--hoa-border);
}

/* ================================
   Ledger
   ================================ */
.hoa-ledger-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.hoa-ledger-aging {
    margin-bottom: 2rem;
}

.hoa-ledger-form {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--hoa-light);
    border-radius: var(--hoa-border-radius);
}

/* ================================
   Voting / Ballots
   ================================ */
.hoa-voting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hoa-ballot-card {
    background: #fff;
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.hoa-ballot-meta {
    font-size: 0.875rem;
    color: var(--hoa-secondary);
    margin-bottom: 1rem;
}

.hoa-quorum-bar {
    height: 24px;
    background: var(--hoa-light);
    border: 1px solid var(--hoa-border);
    border-radius: var(--hoa-border-radius);
    overflow: hidden;
    position: relative;
    margin-bottom: 1rem;
}

.hoa-quorum-fill {
    height: 100%;
    background: var(--hoa-success);
    transition: width 0.3s ease;
}

.hoa-quorum-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hoa-dark);
}

.hoa-result-bar {
    height: 20px;
    background: var(--hoa-light);
    border-radius: var(--hoa-border-radius);
    overflow: hidden;
    display: inline-block;
    width: 100px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.hoa-result-fill {
    height: 100%;
    background: var(--hoa-primary);
}

.hoa-ballot-results h2 {
    margin-bottom: 1.5rem;
}

/* ================================
   Directory
   ================================ */
.hoa-directory {
    max-width: 100%;
}

/* ================================
   Detail Grid (shared)
   ================================ */
.hoa-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.hoa-detail-item {
    font-size: 0.875rem;
}

/* ================================
   Badge additions
   ================================ */
.hoa-badge-open,
.hoa-badge-pending {
    color: #664d03;
    background-color: #fff3cd;
}

.hoa-badge-acknowledged {
    color: #055160;
    background-color: #cff4fc;
}

.hoa-badge-resolved,
.hoa-badge-success,
.hoa-badge-paid {
    color: #0f5132;
    background-color: #d1e7dd;
}

.hoa-badge-dismissed,
.hoa-badge-cancelled,
.hoa-badge-closed {
    color: #41464b;
    background-color: #e2e3e5;
}

.hoa-badge-overdue {
    color: #842029;
    background-color: #f8d7da;
}

.hoa-badge-active {
    color: #0f5132;
    background-color: #d1e7dd;
}

.hoa-badge-draft {
    color: #664d03;
    background-color: #fff3cd;
}

/* ================================
   High Contrast Mode (ADA)
   ================================ */
@media (prefers-contrast: high) {
    :root {
        --hoa-border: #000;
        --hoa-primary: #0000cc;
        --hoa-primary-dark: #000099;
        --hoa-danger: #cc0000;
        --hoa-success: #006600;
    }

    .hoa-btn,
    .hoa-badge,
    .hoa-notice {
        border-width: 2px;
    }

    .hoa-input,
    .hoa-select,
    .hoa-textarea {
        border-width: 2px;
    }

    .hoa-table th,
    .hoa-table td {
        border-width: 2px;
    }

    *:focus-visible {
        outline-width: 4px;
    }
}

/* ================================
   Reduced Motion (ADA)
   ================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .hoa-skip-link {
        transition: none;
    }
}

/* Coastal UI refresh: scoped to HOA shortcodes so theme styles remain independent. */
.hoa-portal-pro {
    --hoa-primary: #075c45;
    --hoa-primary-dark: #064733;
    --hoa-secondary: #46586c;
    --hoa-dark: #172437;
    --hoa-light: #f5f8ff;
    --hoa-border: #dce5f2;
    --hoa-focus-color: #075c45;
    --hoa-border-radius: 12px;
    color: #172437;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.hoa-portal-pro .hoa-portal-dashboard {max-width: 1320px; padding: clamp(12px, 2vw, 28px); background: #f7f9ff; border-radius: 24px;}
.hoa-portal-pro .hoa-dashboard-header {display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; padding:clamp(22px,3vw,38px); margin-bottom:20px; border:1px solid #dce5f2; border-radius:20px; background:#fff; box-shadow:0 4px 16px rgba(20,40,68,.04);}
.hoa-portal-pro .hoa-dashboard-eyebrow {display:block; margin-bottom:10px; color:#075c45; font-size:.75rem; font-weight:750; text-transform:uppercase; letter-spacing:.12em;}
.hoa-portal-pro .hoa-welcome-message h2 {margin:0 0 8px; color:#172437; font-size:clamp(1.65rem,3vw,2.45rem); font-weight:750; letter-spacing:-.035em; line-height:1.15;}
.hoa-portal-pro .hoa-user-role {display:inline-flex; align-items:center; gap:8px; margin:0; padding:6px 12px; border-radius:999px; background:#def8eb; color:#064733; font-size:.8rem; font-weight:700;}
.hoa-portal-pro .hoa-user-role::before {content:""; width:7px; height:7px; border-radius:50%; background:#087951;}
.hoa-portal-pro .hoa-dashboard-header-actions {display:flex; flex-wrap:wrap; gap:10px;}
.hoa-portal-pro .hoa-btn-primary {background:#075c45; border-color:#075c45; color:#fff;}
.hoa-portal-pro .hoa-btn-primary:hover {background:#064733; border-color:#064733; color:#fff;}
.hoa-portal-pro .hoa-btn-secondary {background:#eef3ff; border-color:#dce5f2; color:#172437;}
.hoa-portal-pro .hoa-btn-secondary:hover {background:#e0eaff; color:#172437;}
.hoa-portal-pro .hoa-dashboard-stats {grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:28px;}
.hoa-portal-pro .hoa-stat-card {display:flex; flex-direction:column; align-items:flex-start; min-width:0; text-align:left; border:1px solid #dce5f2; border-radius:16px; padding:20px; box-shadow:0 3px 12px rgba(20,40,68,.035);}
.hoa-portal-pro .hoa-stat-icon {display:grid; place-items:center; width:36px; height:36px; margin:0 0 17px; border-radius:10px; background:#eaf2ff; font-size:1.2rem;}
.hoa-portal-pro .hoa-stat-number {font-size:2rem; color:#172437; letter-spacing:-.04em; line-height:1.15;}
.hoa-portal-pro .hoa-stat-label {color:#46586c; font-size:.77rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em;}
.hoa-portal-pro .hoa-stat-link {margin-top:auto; padding-top:15px; color:#075c45; font-size:.84rem; font-weight:700;}
.hoa-portal-pro .hoa-dashboard-nav h3 {color:#172437; font-size:1.2rem; letter-spacing:-.02em;}
.hoa-portal-pro .hoa-quick-actions {grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px;}
.hoa-portal-pro .hoa-quick-action {flex-direction:row; justify-content:flex-start; min-width:0; gap:12px; padding:16px 18px; text-align:left; border:1px solid #dce5f2; border-radius:14px; background:#fff;}
.hoa-portal-pro .hoa-quick-action:hover {border-color:#075c45; background:#f1fbf6; transform:translateY(-2px);}
.hoa-portal-pro .hoa-action-icon {display:grid; place-items:center; flex:none; width:38px; height:38px; margin:0; border-radius:10px; background:#e8f5ee; font-size:1.15rem;}
.hoa-portal-pro .hoa-action-label {color:#172437; font-weight:700; line-height:1.3;}
.hoa-portal-pro .hoa-dashboard-content {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; align-items:start;}
.hoa-portal-pro .hoa-dashboard-section {min-width:0; margin:0; padding:clamp(18px,2vw,26px); border:1px solid #dce5f2; border-radius:18px; box-shadow:0 3px 12px rgba(20,40,68,.035); overflow-x:auto; scroll-margin-top:24px;}
.hoa-portal-pro .hoa-dashboard-section h3 {color:#172437; font-size:1.2rem; font-weight:750; letter-spacing:-.02em;}
.hoa-portal-pro #hoa-tickets,.hoa-portal-pro #hoa-amenities,.hoa-portal-pro #hoa-ledger,.hoa-portal-pro #hoa-directory {grid-column:1/-1;}
.hoa-portal-pro .hoa-table {border:1px solid #dce5f2; border-radius:12px; overflow:hidden;}
.hoa-portal-pro .hoa-table thead {background:#edf3ff;}
.hoa-portal-pro .hoa-table th {color:#25354b; font-size:.76rem; text-transform:uppercase; letter-spacing:.035em;}
.hoa-portal-pro .hoa-table td {border-color:#e8edf5;}
.hoa-portal-pro .hoa-input,.hoa-portal-pro .hoa-select,.hoa-portal-pro .hoa-textarea {border:1px solid #bdcddd; border-radius:9px; background:#fff; color:#172437;}
.hoa-portal-pro .hoa-amenities-wrapper,.hoa-portal-pro .hoa-violations {max-width:100%;}
.hoa-portal-pro .hoa-modal-content {border-radius:18px;}
@media(max-width:900px){.hoa-portal-pro .hoa-dashboard-stats {grid-template-columns:repeat(2,minmax(0,1fr));}.hoa-portal-pro .hoa-quick-actions {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:640px){.hoa-portal-pro .hoa-portal-dashboard {padding:12px; border-radius:14px;}.hoa-portal-pro .hoa-dashboard-header {padding:20px;}.hoa-portal-pro .hoa-dashboard-header-actions,.hoa-portal-pro .hoa-dashboard-header-actions .hoa-btn {width:100%;}.hoa-portal-pro .hoa-dashboard-stats,.hoa-portal-pro .hoa-quick-actions,.hoa-portal-pro .hoa-dashboard-content {grid-template-columns:minmax(0,1fr);}.hoa-portal-pro .hoa-dashboard-section {grid-column:1/-1;}.hoa-portal-pro .hoa-stat-card {padding:17px;}.hoa-portal-pro .hoa-quick-action {padding:14px;}}
@media(prefers-reduced-motion:reduce){.hoa-portal-pro .hoa-quick-action:hover {transform:none;}}

/* Main request action is separate from the calendar's hover-only plus controls. */
.hoa-amenities-header .hoa-request-reservation {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    width: auto;
    height: auto;
    min-height: 44px;
    padding: 12px 20px;
    margin: 8px 0;
    font-size: 1rem;
    line-height: 1.4;
}
@media (max-width: 600px) {
    .hoa-amenities-header .hoa-request-reservation { width: 100%; }
}
