/* Housevise Integration - Base Styles */

.housevise-contacts,
.housevise-form {
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

/* Search */
.housevise-search {
    margin-bottom: 1.5rem;
}

.housevise-search label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.housevise-search-wrapper {
    position: relative;
}

.housevise-input {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

.housevise-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

textarea.housevise-input {
    resize: vertical;
}

select.housevise-input {
    appearance: auto;
}

/* Search results dropdown */
.housevise-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.housevise-result-item {
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.housevise-result-item:last-child {
    border-bottom: none;
}

.housevise-result-item:hover {
    background: #f0f7fc;
}

.housevise-result-item.housevise-no-results {
    color: #666;
    cursor: default;
}

.housevise-result-item.housevise-no-results:hover {
    background: transparent;
}

/* Selected cooperative */
.housevise-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    background: #f0f7fc;
    border: 1px solid #0073aa;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.housevise-btn-clear {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #666;
    padding: 0 0.3rem;
    line-height: 1;
    margin-left: auto;
}

.housevise-btn-clear:hover {
    color: #d00;
}

/* Loading */
.housevise-loading {
    padding: 2rem;
    text-align: center;
    color: #666;
}

.housevise-empty {
    padding: 2rem;
    text-align: center;
    color: #999;
}

/* Contacts list */
.housevise-contacts-list {
    margin-top: 1.5rem;
}

.housevise-role-group {
    margin-bottom: 1.5rem;
}

.housevise-role-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #0073aa;
    color: #333;
}

.housevise-role-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.housevise-contact-card {
    padding: 0.75rem 1rem;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.housevise-contact-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.housevise-contact-detail {
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.15rem;
}

.housevise-contact-detail a {
    color: #0073aa;
    text-decoration: none;
}

.housevise-contact-detail a:hover {
    text-decoration: underline;
}

.housevise-label {
    font-weight: 500;
}

/* Form fields */
.housevise-field {
    margin-bottom: 1rem;
}

.housevise-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.housevise-fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.housevise-fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

.housevise-field-row {
    display: flex;
    gap: 1rem;
}

.housevise-field-row .housevise-field {
    flex: 1;
}

.housevise-radio-group {
    display: flex;
    gap: 1.5rem;
}

.housevise-radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 400;
    cursor: pointer;
}

/* Buttons */
.housevise-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}

.housevise-btn-submit {
    background: #0073aa;
    color: #fff;
}

.housevise-btn-submit:hover {
    background: #005a87;
}

.housevise-btn-submit:disabled {
    background: #999;
    cursor: not-allowed;
}

/* Messages */
.housevise-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.95rem;
}

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

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

/* Announcements */
.housevise-announcements,
.housevise-coop-info,
.housevise-doornames {
    max-width: 700px;
    margin: 0 auto;
    font-family: inherit;
}

.housevise-ann-item {
    padding: 1rem 1.25rem;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.housevise-ann-item.housevise-ann-important {
    border-left: 4px solid #dc3545;
}

.housevise-ann-item.housevise-ann-megaphone {
    border-left: 4px solid #0073aa;
}

.housevise-ann-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.housevise-ann-title {
    margin: 0;
    font-size: 1.05rem;
}

.housevise-ann-date {
    font-size: 0.85rem;
    color: #888;
    white-space: nowrap;
}

.housevise-ann-from {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.housevise-ann-content {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Cooperative info */
.housevise-info-card {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 1.25rem;
}

.housevise-info-name {
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
}

.housevise-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.housevise-info-table th,
.housevise-info-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    font-size: 0.95rem;
}

.housevise-info-table th {
    font-weight: 600;
    width: 40%;
    color: #555;
}

.housevise-info-card h4 {
    margin: 1rem 0 0.5rem;
    font-size: 1rem;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 0.3rem;
}

.housevise-building-card {
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.housevise-building-details {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.2rem;
}

/* Doornames */
.housevise-building-group {
    margin-bottom: 1.5rem;
}

.housevise-building-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #0073aa;
}

.housevise-stair-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem 0;
    color: #555;
}

.housevise-door-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.housevise-door-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 0.9rem;
}

.housevise-door-apt {
    font-weight: 600;
}

.housevise-door-name {
    color: #555;
}

/* Responsive */
@media (max-width: 600px) {
    .housevise-field-row {
        flex-direction: column;
        gap: 0;
    }

    .housevise-role-contacts {
        grid-template-columns: 1fr;
    }

    .housevise-door-grid {
        grid-template-columns: 1fr;
    }

    .housevise-ann-header {
        flex-direction: column;
        gap: 0.25rem;
    }
}
