/* ========================================
   Agencies Listing Page - Premium Styles
   Theme: Houzez Real Estate
   Primary Color: #00A9FF
   Font: Plus Jakarta Sans
   ======================================== */

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    background-color: #f5f5f5;
}

.agencies-listing-page {
    min-height: 100vh;
}

/* ========================================
   Page Header Section
   ======================================== */

.agencies-header-section {
    background: linear-gradient(135deg, #00A9FF 0%, #0088cc 100%);
    padding: 60px 0 40px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.agencies-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,149.3C960,160,1056,160,1152,138.7C1248,117,1344,75,1392,53.3L1440,32L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.agencies-header-content {
    position: relative;
    z-index: 1;
}

.agencies-title-area {
    text-align: center;
    margin-bottom: 40px;
}

.agencies-title-area h1 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.agencies-title-area h1 i {
    font-size: 52px;
}

.agencies-title-area p {
    font-size: 18px;
    margin: 0;
    opacity: 0.95;
    font-weight: 500;
}

/* ========================================
   Search Bar
   ======================================== */

.agencies-search-bar {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.search-input-group {
    position: relative;
    margin-bottom: 20px;
}

.search-input-group i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #00A9FF;
}

.agencies-search-input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: "Plus Jakarta Sans", sans-serif;
    transition: all 0.3s ease;
}

.agencies-search-input:focus {
    outline: none;
    border-color: #00A9FF;
    box-shadow: 0 0 0 4px rgba(0, 169, 255, 0.1);
}

.search-filters-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.filter-select {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-weight: 500;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #00A9FF;
    box-shadow: 0 0 0 4px rgba(0, 169, 255, 0.1);
}

.filter-select:hover {
    border-color: #00A9FF;
}

/* ========================================
   Results Section
   ======================================== */

.agencies-results-section {
    padding: 40px 0 60px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 15px;
}

.results-count h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.count-badge {
    background: linear-gradient(135deg, #00A9FF 0%, #0088cc 100%);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
}

.count-badge strong {
    font-size: 16px;
}

.view-toggle-group {
    display: flex;
    gap: 10px;
}

.view-toggle-btn {
    width: 45px;
    height: 45px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
    color: #666;
}

.view-toggle-btn:hover {
    border-color: #00A9FF;
    color: #00A9FF;
}

.view-toggle-btn.active {
    background: #00A9FF;
    border-color: #00A9FF;
    color: #fff;
}

/* ========================================
   Agencies Grid
   ======================================== */

.agencies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.agencies-grid.list-view {
    grid-template-columns: 1fr;
}

/* ========================================
   Agency Card
   ======================================== */

.agency-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    position: relative;
}

.agency-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #00A9FF;
}

.agency-card.featured {
    border-color: #ffd700;
    background: linear-gradient(to bottom, #fffef7 0%, #fff 100%);
}

.agency-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
}

/* ========================================
   Card Header
   ======================================== */

.agency-card-header {
    position: relative;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8f4ff 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.agency-logo-wrapper {
    position: relative;
}

.agency-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.featured-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
}

.featured-badge i {
    font-size: 12px;
}

.btn-favorite-agency {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
    color: #666;
}

.btn-favorite-agency:hover {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
    transform: scale(1.1);
}

.btn-favorite-agency.active {
    background: #ff4757;
    border-color: #ff4757;
    color: #fff;
}

/* ========================================
   Card Body
   ======================================== */

.agency-card-body {
    padding: 25px 30px;
}

.agency-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    transition: color 0.3s ease;
}

.agency-card:hover .agency-name {
    color: #00A9FF;
}

.agency-location {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agency-location i {
    color: #00A9FF;
    font-size: 16px;
}

/* ========================================
   Rating
   ======================================== */

.agency-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}

.stars {
    display: flex;
    gap: 3px;
}

.stars i {
    color: #ffc107;
    font-size: 16px;
}

.rating-value {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.rating-count {
    font-size: 13px;
    color: #999;
}

/* ========================================
   Description & Specialties
   ======================================== */

.agency-description {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin: 0 0 15px 0;
}

.agency-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.specialty-tag {
    padding: 6px 14px;
    background: #e8f4ff;
    color: #00A9FF;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   Stats
   ======================================== */

.agency-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item i {
    font-size: 28px;
    color: #00A9FF;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* ========================================
   Card Footer
   ======================================== */

.agency-card-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-view-profile,
.btn-contact-agency {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.btn-view-profile {
    background: #fff;
    color: #00A9FF;
    border: 2px solid #00A9FF;
}

.btn-view-profile:hover {
    background: #00A9FF;
    color: #fff;
    transform: translateY(-2px);
}

.btn-contact-agency {
    background: linear-gradient(135deg, #00A9FF 0%, #0088cc 100%);
    color: #fff;
}

.btn-contact-agency:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 169, 255, 0.4);
}

/* ========================================
   List View Styles
   ======================================== */

.agencies-grid.list-view .agency-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
        "header body footer";
}

.agencies-grid.list-view .agency-card-header {
    grid-area: header;
    flex-direction: column;
    padding: 30px;
    min-width: 200px;
}

.agencies-grid.list-view .agency-card-body {
    grid-area: body;
    padding: 30px;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

.agencies-grid.list-view .agency-card-footer {
    grid-area: footer;
    background: transparent;
    flex-direction: column;
    padding: 30px;
    min-width: 200px;
}

.agencies-grid.list-view .agency-stats {
    grid-template-columns: repeat(3, auto);
    gap: 30px;
}

/* ========================================
   Pagination
   ======================================== */

.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination-btn {
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn:hover:not(:disabled) {
    background: #00A9FF;
    border-color: #00A9FF;
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-number {
    width: 45px;
    height: 45px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: #00A9FF;
    border-color: #00A9FF;
    color: #fff;
}

.page-number.active {
    background: linear-gradient(135deg, #00A9FF 0%, #0088cc 100%);
    border-color: #00A9FF;
    color: #fff;
}

.pagination-dots {
    color: #999;
    font-size: 18px;
    padding: 0 5px;
}

/* ========================================
   Notifications
   ======================================== */

.notification-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid #00A9FF;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification i {
    font-size: 20px;
    color: #00A9FF;
}

.notification span {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1200px) {
    .agencies-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 25px;
    }

    .agencies-grid.list-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .agencies-header-section {
        padding: 40px 0 30px;
    }

    .agencies-title-area h1 {
        font-size: 36px;
    }

    .agencies-title-area h1 i {
        font-size: 38px;
    }

    .search-filters-group {
        grid-template-columns: 1fr;
    }

    .agencies-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }

    .agencies-grid.list-view .agency-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "body"
            "footer";
    }

    .agencies-grid.list-view .agency-card-header,
    .agencies-grid.list-view .agency-card-body,
    .agencies-grid.list-view .agency-card-footer {
        border: none;
    }

    .agencies-grid.list-view .agency-card-header {
        flex-direction: row;
        justify-content: space-between;
    }

    .agencies-grid.list-view .agency-card-footer {
        flex-direction: row;
        background: #f8f9fa;
    }

    .results-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .agencies-title-area h1 {
        font-size: 28px;
        flex-direction: column;
        gap: 10px;
    }

    .agencies-title-area p {
        font-size: 16px;
    }

    .agencies-search-bar {
        padding: 20px;
    }

    .agencies-grid {
        grid-template-columns: 1fr;
    }

    .agency-card-footer {
        grid-template-columns: 1fr;
    }

    .agency-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pagination-numbers {
        gap: 5px;
    }

    .page-number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .agencies-header-section {
        padding: 30px 0 20px;
    }

    .agencies-title-area h1 {
        font-size: 24px;
    }

    .agencies-search-input {
        padding: 14px 18px 14px 50px;
        font-size: 14px;
    }

    .agency-logo {
        width: 100px;
        height: 100px;
    }

    .agency-name {
        font-size: 20px;
    }

    .results-count h2 {
        font-size: 22px;
    }

    .count-badge {
        font-size: 12px;
        padding: 6px 16px;
    }

    .notification {
        min-width: auto;
        width: calc(100vw - 40px);
    }
}
