/* ========================================
   Agents Listing Page - Premium Styles
   Theme: Houzez Real Estate
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.agents-listing-page {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f5f5f5;
    color: #011923;
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== AGENTS HEADER SECTION ===== */
.agents-header-section {
    background: linear-gradient(135deg, #00A9FF 0%, #0088cc 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.agents-header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    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,165.3C384,171,480,149,576,138.7C672,128,768,128,864,149.3C960,171,1056,213,1152,213.3C1248,213,1344,171,1392,149.3L1440,128L1440,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.5;
}

.agents-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.agents-title-area {
    color: #fff;
}

.agents-title-area h1 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.agents-title-area p {
    font-size: 19px;
    font-weight: 400;
    opacity: 0.95;
    margin: 0;
    max-width: 600px;
}

/* Stats Area */
.agents-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: #fff;
}

.stat-item h3 {
    font-size: 42px;
    font-weight: 800;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.stat-item p {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

/* ===== SEARCH AND FILTER SECTION ===== */
.agents-search-section {
    background: #fff;
    padding: 35px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.agents-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.search-filters-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 300px;
    position: relative;
}

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

.agents-search-input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.filter-group {
    min-width: 200px;
}

.filter-select {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #011923;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* ===== AGENTS RESULTS SECTION ===== */
.agents-results-section {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 30px 60px 30px;
}

.agents-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 25px 30px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.agents-results-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #011923;
    margin: 0;
}

.agents-results-header h2 span {
    color: #00A9FF;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 10px;
}

.view-toggle-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-btn i {
    font-size: 18px;
}

.view-toggle-btn.active {
    background: #00A9FF;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 169, 255, 0.3);
}

.view-toggle-btn:hover:not(.active) {
    background: #e8f4ff;
    color: #00A9FF;
}

/* ===== AGENTS GRID ===== */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
}

/* List View */
.agents-grid.list-view {
    grid-template-columns: 1fr;
}

.agents-grid.list-view .agent-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-areas:
        "image content"
        "image actions";
    gap: 25px;
}

.agents-grid.list-view .agent-image-wrapper {
    grid-area: image;
    height: 100%;
}

.agents-grid.list-view .agent-content {
    grid-area: content;
}

.agents-grid.list-view .agent-actions {
    grid-area: actions;
    align-self: end;
}

.agents-grid.list-view .featured-badge {
    left: 15px;
    right: auto;
}

.agents-grid.list-view .btn-favorite-agent {
    right: 15px;
    left: auto;
}

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

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

/* Featured Agent */
.agent-card.featured-agent {
    border: 2px solid #FFD700;
    background: linear-gradient(to bottom, #fffdf7 0%, #fff 100%);
}

.agent-card.featured-agent:hover {
    border-color: #FFD700;
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.3);
}

.featured-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

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

/* Favorite Button */
.btn-favorite-agent {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

.btn-favorite-agent.active i {
    animation: heartBeat 0.6s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Agent Image */
.agent-image-wrapper {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.agent-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.agent-card:hover .agent-image {
    transform: scale(1.08);
}

/* Agent Status Badge */
.agent-status {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    z-index: 2;
}

.agent-status i {
    font-size: 10px;
}

.agent-status.online {
    background: rgba(46, 213, 115, 0.95);
    color: #fff;
}

.agent-status.online i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.agent-status.offline {
    background: rgba(0, 0, 0, 0.75);
}

/* Agent Content */
.agent-content {
    padding: 25px;
}

.agent-name {
    font-size: 24px;
    font-weight: 700;
    color: #011923;
    margin: 0 0 5px 0;
    transition: color 0.3s ease;
}

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

.agent-title {
    font-size: 15px;
    font-weight: 600;
    color: #00A9FF;
    margin: 0 0 15px 0;
}

/* Agent Rating */
.agent-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.agent-rating .stars {
    display: flex;
    gap: 3px;
    color: #FFD700;
    font-size: 16px;
}

.agent-rating .rating-text {
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

/* Agent Description */
.agent-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Agent Location */
.agent-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

/* Agent Specialties */
.agent-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.specialty-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.specialty-tag.luxury {
    background: #fff5e6;
    color: #ff8c00;
    border: 1px solid #ffe0b3;
}

.specialty-tag.commercial {
    background: #e6f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

.specialty-tag.residential {
    background: #f0e6ff;
    color: #7c3aed;
    border: 1px solid #d9b3ff;
}

.specialty-tag.rental {
    background: #e6fff9;
    color: #00a885;
    border: 1px solid #b3ffe6;
}

.specialty-tag.investment {
    background: #ffe6e6;
    color: #cc0000;
    border: 1px solid #ffb3b3;
}

/* Agent Stats Grid */
.agent-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: #e8f4ff;
    transform: translateY(-2px);
}

.stat-box i {
    font-size: 26px;
    color: #00A9FF;
}

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

.stat-number {
    font-size: 22px;
    font-weight: 800;
    color: #011923;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}

/* Agent Actions */
.agent-actions {
    display: flex;
    gap: 12px;
}

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

.btn-view-profile {
    background: #f0f0f0;
    color: #011923;
    border: 2px solid #e0e0e0;
}

.btn-view-profile:hover {
    background: #00A9FF;
    color: #fff;
    border-color: #00A9FF;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 169, 255, 0.3);
}

.btn-contact-agent {
    background: #00A9FF;
    color: #fff;
}

.btn-contact-agent:hover {
    background: #0090d9;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 169, 255, 0.4);
}

/* ===== PAGINATION ===== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
    padding: 30px 0;
}

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

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

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

.page-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: 700;
    color: #011923;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover:not(.active) {
    background: #e8f4ff;
    border-color: #00A9FF;
    color: #00A9FF;
}

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

.page-dots {
    font-size: 18px;
    font-weight: 700;
    color: #666;
    padding: 0 5px;
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification-container {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

.notification span {
    font-size: 15px;
    font-weight: 600;
    color: #011923;
}

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

/* ===== RESPONSIVE DESIGN ===== */

/* Large Tablets and Small Desktops (1200px) */
@media (max-width: 1200px) {
    .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 25px;
    }

    .agents-header-content {
        gap: 30px;
    }

    .agents-title-area h1 {
        font-size: 42px;
    }

    .stat-item h3 {
        font-size: 36px;
    }
}

/* Tablets (992px) */
@media (max-width: 992px) {
    .agents-header-section {
        padding: 50px 0;
    }

    .agents-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .agents-title-area p {
        font-size: 17px;
    }

    .agents-stats {
        width: 100%;
        justify-content: space-between;
    }

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

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

    .view-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .agents-grid.list-view .agent-card {
        grid-template-columns: 180px 1fr;
    }
}

/* Mobile Landscape and Small Tablets (768px) */
@media (max-width: 768px) {
    .agents-header-section {
        padding: 40px 0;
    }

    .agents-header-content {
        padding: 0 20px;
    }

    .agents-title-area h1 {
        font-size: 32px;
        gap: 15px;
    }

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

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

    .agents-stats {
        gap: 25px;
    }

    .stat-item h3 {
        font-size: 32px;
    }

    .stat-item p {
        font-size: 14px;
    }

    .agents-search-section {
        padding: 25px 0;
    }

    .agents-search-container {
        padding: 0 20px;
    }

    .search-filters-row {
        flex-direction: column;
    }

    .search-input-group {
        width: 100%;
        min-width: auto;
    }

    .filter-group {
        width: 100%;
        min-width: auto;
    }

    .agents-results-section {
        margin: 30px auto;
        padding: 0 20px 50px 20px;
    }

    .agents-results-header {
        padding: 20px;
    }

    .agents-results-header h2 {
        font-size: 24px;
    }

    .agents-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .agent-card {
        max-width: 600px;
        margin: 0 auto;
    }

    .agents-grid.list-view .agent-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "image"
            "content"
            "actions";
    }

    .agents-grid.list-view .agent-image-wrapper {
        height: 280px;
    }

    .pagination-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .notification-container {
        right: 20px;
        left: 20px;
    }

    .notification {
        min-width: auto;
    }
}

/* Mobile Portrait (576px) */
@media (max-width: 576px) {
    .agents-header-content {
        padding: 0 15px;
    }

    .agents-title-area h1 {
        font-size: 26px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .agents-title-area h1 i {
        font-size: 30px;
    }

    .agents-title-area p {
        font-size: 15px;
    }

    .agents-stats {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .stat-item {
        text-align: left;
        width: 100%;
        padding: 15px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }

    .agents-search-container {
        padding: 0 15px;
    }

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

    .filter-select {
        font-size: 14px;
        padding: 14px 18px;
    }

    .agents-results-section {
        padding: 0 15px 40px 15px;
    }

    .agents-results-header {
        padding: 18px;
    }

    .agents-results-header h2 {
        font-size: 20px;
    }

    .view-toggle-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .view-toggle-btn i {
        font-size: 16px;
    }

    .agent-image-wrapper {
        height: 250px;
    }

    .agent-content {
        padding: 20px;
    }

    .agent-name {
        font-size: 21px;
    }

    .agent-title {
        font-size: 14px;
    }

    .agent-description {
        font-size: 14px;
    }

    .agent-stats-grid {
        gap: 10px;
    }

    .stat-box {
        padding: 12px;
    }

    .stat-box i {
        font-size: 22px;
    }

    .stat-number {
        font-size: 19px;
    }

    .stat-label {
        font-size: 11px;
    }

    .agent-actions {
        flex-direction: column;
    }

    .btn-view-profile,
    .btn-contact-agent {
        width: 100%;
        padding: 12px 18px;
        font-size: 14px;
    }

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

    .btn-favorite-agent {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .pagination-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

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

    .notification-container {
        top: 80px;
        right: 15px;
        left: 15px;
    }
}

/* Extra Small Mobile (400px) */
@media (max-width: 400px) {
    .agents-title-area h1 {
        font-size: 22px;
    }

    .agents-title-area p {
        font-size: 14px;
    }

    .stat-item h3 {
        font-size: 28px;
    }

    .agents-results-header h2 {
        font-size: 18px;
    }

    .agent-name {
        font-size: 19px;
    }

    .page-numbers {
        gap: 5px;
    }

    .page-number {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ===== SMOOTH ANIMATIONS ===== */
.agent-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation for cards */
.agent-card:nth-child(1) { animation-delay: 0.1s; }
.agent-card:nth-child(2) { animation-delay: 0.2s; }
.agent-card:nth-child(3) { animation-delay: 0.3s; }
.agent-card:nth-child(4) { animation-delay: 0.4s; }
.agent-card:nth-child(5) { animation-delay: 0.5s; }
.agent-card:nth-child(6) { animation-delay: 0.6s; }
.agent-card:nth-child(7) { animation-delay: 0.7s; }
.agent-card:nth-child(8) { animation-delay: 0.8s; }
.agent-card:nth-child(9) { animation-delay: 0.9s; }
.agent-card:nth-child(10) { animation-delay: 1.0s; }
.agent-card:nth-child(11) { animation-delay: 1.1s; }
.agent-card:nth-child(12) { animation-delay: 1.2s; }
