/* ============================================================
   HubSpot CRM Sync — Frontend Styles
   ============================================================ */

/* Search Bar */
.hubspot-crm-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}

.hubspot-crm-search-bar input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    font-size: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.hubspot-crm-search-bar input[type="text"]:focus {
    border-color: #ff7a59;
    box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.15);
}

.hubspot-search-spinner {
    font-size: 20px;
    animation: hubspot-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes hubspot-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ============================================================
   Grid Layout
   ============================================================ */
.hubspot-crm-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
    gap: 20px;
}

.hubspot-crm-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.hubspot-crm-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.hubspot-card-header {
    background: #ff7a59;
    color: #fff;
    padding: 16px 18px;
}

.hubspot-card-header .hubspot-company-name {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}

.hubspot-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hubspot-card-body {
    list-style: none;
    margin: 0;
    padding: 14px 18px;
    flex: 1;
}

.hubspot-card-body .hubspot-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.hubspot-card-body .hubspot-field:last-child {
    border-bottom: none;
}

.hubspot-field-label {
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 8px;
}

.hubspot-field-value {
    color: #111827;
    text-align: right;
    word-break: break-word;
}

.hubspot-card-footer {
    padding: 12px 18px;
    border-top: 1px solid #f3f4f6;
}

.hubspot-btn {
    display: inline-block;
    background: #ff7a59;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.hubspot-btn:hover {
    background: #e8634a;
    color: #fff !important;
}

/* ============================================================
   List Layout
   ============================================================ */
.hubspot-crm-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hubspot-crm-list-item {
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.hubspot-crm-list-item:last-child {
    border-bottom: none;
}

.hubspot-crm-list-item .hubspot-company-name {
    font-size: 16px;
    color: #111827;
    display: block;
    margin-bottom: 4px;
}

.hubspot-list-meta {
    font-size: 13px;
    color: #6b7280;
}

.hubspot-list-meta em {
    font-style: normal;
    font-weight: 600;
    color: #374151;
}

/* ============================================================
   Table Layout
   ============================================================ */
.hubspot-crm-table-wrap {
    overflow-x: auto;
}

.hubspot-crm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.hubspot-crm-table th {
    background: #f9fafb;
    color: #374151;
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.hubspot-crm-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

.hubspot-crm-table tbody tr:hover {
    background: #fef9f7;
}

/* ============================================================
   Single Company
   ============================================================ */
.hubspot-company-single .hubspot-company-name {
    font-size: 22px;
    margin-bottom: 16px;
    color: #111827;
}

.hubspot-company-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 20px;
}

.hubspot-detail-row {
    display: contents;
}

.hubspot-company-details dt {
    font-weight: 600;
    color: #6b7280;
    font-size: 13px;
}

.hubspot-company-details dd {
    margin: 0;
    color: #111827;
    font-size: 14px;
}

/* ============================================================
   Error / Empty States
   ============================================================ */
.hubspot-crm-error,
.hubspot-crm-empty {
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
}

.hubspot-crm-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.hubspot-crm-empty {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

/* ============================================================
   Responsive
   ============================================================ */
@media ( max-width: 600px ) {
    .hubspot-crm-grid {
        grid-template-columns: 1fr;
    }

    .hubspot-company-details {
        grid-template-columns: 1fr;
    }
}
