/* =============================================================================
   views/agency-dashboard.css
   Layout and structural styles specific to the Agency Dashboard view.

   Components (badges, buttons, search, pagination) live in components/.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Top-level view containers
   ----------------------------------------------------------------------------- */

#agencyView {
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: fadeIn 0.3s ease;
    min-height: 100vh;
}

.agency-layout { justify-content: flex-start; }

.agency-layout-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    box-sizing: border-box;
}

#subAccountsContent {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: white;
    animation: fadeIn 0.3s ease;
}

.filter-search-section { display: none; }

.sub-accounts-results { overflow: hidden; }

/* -----------------------------------------------------------------------------
   Agency header overrides (scoped to #agencyView to avoid bleeding into other views)
   ----------------------------------------------------------------------------- */

#agencyView .ghlm-header {
    margin-bottom: var(--space-8);
    padding: 0;
    text-align: center;
}

#agencyView .ghlm-header h2 {
    font-size: 2.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-dark);
    margin: 0 0 var(--space-4) 0;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

#agencyView .ghlm-header h2 span {
    color: var(--primary);
    font-weight: var(--font-weight-bold);
}

#agencyView .ghlm-subheader {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    color: var(--text-medium);
    line-height: 1.625;
    margin: 0 auto var(--space-6) auto;
    max-width: 700px;
    letter-spacing: -0.01em;
    text-align: center;
    padding-bottom: var(--space-5);
    position: relative;
}

#agencyView .ghlm-subheader::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 1.5px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 1.5px;
}

/* -----------------------------------------------------------------------------
   Integrated filter bar
   ----------------------------------------------------------------------------- */

.integrated-filter-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.filter-group-full-width {
    flex: 1;
    width: 100%;
}

.search-bar-full-width {
    flex: 1;
    width: 100%;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
    font-size: var(--font-size-base);
    margin: 0;
    white-space: nowrap;
}

.filter-label i {
    color: var(--primary-dark);
    font-size: var(--font-size-lg);
}

.status-filter-dropdown { position: relative; }

/* -----------------------------------------------------------------------------
   Results header
   ----------------------------------------------------------------------------- */

.results-header { display: none; }

.results-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
}

.results-count {
    background: var(--primary-dark);
    color: white;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    min-width: 60px;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   Sub-account view sections
   ----------------------------------------------------------------------------- */

.sub-accounts-section { position: relative; }

.sub-account-view         { display: none; }
.sub-account-view.active  { display: block; }

/* -----------------------------------------------------------------------------
   Location cards list
   ----------------------------------------------------------------------------- */

.locations-list {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    background: transparent;
}

.location-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5) var(--space-6);
    position: relative;
    overflow: visible;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

/* Left accent stripe */
.location-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--border-color);
}

.location-item.not-connected::before    { background: var(--primary); }
.location-item.connected-active::before { background: var(--success); }
.location-item.connected-inactive::before { background: var(--danger); }

.location-item:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.location-content { flex: 1; }

.location-title {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2);
    gap: var(--space-3);
}

.location-title h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin: 0;
    max-width: 213px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    line-height: 1.5;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-300) transparent;
}

.location-title h4::-webkit-scrollbar        { height: 4px; width: 0; }
.location-title h4::-webkit-scrollbar-track  { background: transparent; }
.location-title h4::-webkit-scrollbar-thumb  { background: var(--gray-300); border-radius: 2px; }
.location-title h4::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.location-title h4::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

.location-details {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-top: var(--space-2);
}

.location-date {
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-weight: var(--font-weight-medium);
}

.location-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    overflow: visible;
}

/* -----------------------------------------------------------------------------
   Badge container and connection detail text
   ----------------------------------------------------------------------------- */

.badge-container {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
}

.connection-info {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.detail-label {
    font-weight: var(--font-weight-medium);
    margin-right: var(--space-1);
    color: var(--text-light);
    font-size: var(--font-size-xs);
}

.detail-value {
    color: var(--text-dark);
    font-size: var(--font-size-xs);
}

/* -----------------------------------------------------------------------------
   No data / empty state
   ----------------------------------------------------------------------------- */

.no-data-message {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-light);
    background: transparent;
    border: none;
    margin: 0;
    box-shadow: none;
}

.no-data-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light), var(--bg-secondary));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    border: 2px solid var(--primary-light);
}

.no-data-icon i {
    font-size: var(--font-size-2xl);
    color: var(--primary);
}

.no-data-message h4 {
    margin: 0 0 var(--space-2) 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-dark);
}

.no-data-message p {
    margin: 0 auto;
    font-size: var(--font-size-base);
    color: var(--text-light);
    max-width: 400px;
    line-height: var(--line-height-relaxed);
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 1024px) {
    .integrated-filter-section { gap: var(--space-4); }
}

@media (max-width: 768px) {
    .agency-layout-inner { padding: var(--space-6) var(--space-4); }

    #agencyView .ghlm-header { margin-bottom: var(--space-6); }

    #agencyView .ghlm-header h2 {
        font-size: 1.75rem;
        margin-bottom: var(--space-3);
    }

    #agencyView .ghlm-subheader {
        font-size: 0.9375rem;
        max-width: 100%;
        padding-bottom: var(--space-4);
    }

    #agencyView .ghlm-subheader::after { width: 100%; }

    .integrated-filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .filter-group { width: 100%; max-width: none; }

    .location-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
    }

    .location-actions {
        align-self: stretch;
        justify-content: flex-end;
    }

    .locations-list { padding: var(--space-4); }

    .results-status {
        flex-direction: column;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .location-item       { padding: var(--space-3); }
    .locations-list      { padding: var(--space-3); }

    .location-actions {
        flex-direction: column;
        gap: var(--space-2);
    }

    .integrated-filter-section { padding: var(--space-3); }
}
