/* HOA Document Platform — Frontend */

.hoa-search-wrap,
.hoa-documents-wrap,
.hoa-my-documents {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hoa-search-subtitle {
    color: #666;
    margin-bottom: 24px;
}

/* Search Form */
.hoa-search-form {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.hoa-search-fields {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.hoa-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hoa-field-grow {
    flex: 1;
    min-width: 200px;
}

.hoa-field label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.hoa-field select,
.hoa-field input[type="text"] {
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.hoa-field select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.hoa-field select:focus,
.hoa-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hoa-search-fields .hoa-btn {
    height: 44px;
    padding: 0 24px;
}

/* Buttons */
.hoa-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    line-height: 1.4;
}

.hoa-btn-primary {
    background: #2563eb;
    color: #fff;
}
.hoa-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.hoa-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.hoa-btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.hoa-btn-success {
    background: #16a34a;
    color: #fff;
}
.hoa-btn-success:hover {
    background: #15803d;
    color: #fff;
}

.hoa-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.hoa-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Search Results — Community Cards */
.hoa-community-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.hoa-community-card {
    display: block;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.hoa-community-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

.hoa-community-name {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
}

.hoa-community-location {
    font-size: 14px;
    color: #64748b;
}

/* Community Header */
.hoa-community-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.hoa-community-header h2 {
    margin-bottom: 4px;
}

.hoa-community-meta {
    color: #64748b;
    margin-bottom: 12px;
}

/* Category Sections */
.hoa-category-section {
    margin-bottom: 32px;
}

.hoa-category-title {
    font-size: 18px;
    color: #334155;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

/* Document Cards */
.hoa-document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.hoa-document-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s ease;
}

.hoa-document-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.hoa-doc-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.hoa-doc-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.hoa-doc-desc {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
    flex: 1;
    line-height: 1.5;
}

.hoa-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.hoa-doc-price {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

/* My Documents Table */
.hoa-purchases-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.hoa-purchases-table th,
.hoa-purchases-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.hoa-purchases-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.hoa-purchases-table tr:hover td {
    background: #f8fafc;
}

/* States */
.hoa-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 8px;
}

.hoa-loading {
    text-align: center;
    padding: 20px;
    color: #64748b;
}

.hoa-cart-notice {
    position: fixed;
    top: 40px;
    right: 20px;
    padding: 12px 20px;
    background: #16a34a;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    animation: hoa-slide-in 0.3s ease;
}

@keyframes hoa-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 640px) {
    .hoa-search-fields {
        flex-direction: column;
    }
    .hoa-document-grid {
        grid-template-columns: 1fr;
    }
}
