/**
 * agents.css
 * Core styling for the Agent List Directory Page.
 */

/* --- BASE STYLES --- */
* { 
    box-sizing: border-box; 
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* THE SILVER BULLET: Completely disables horizontal scrolling page-wide */
}
.container { 
    max-width: 1450px; 
    margin: 0 auto; 
    padding: 2rem; 
}
.page-header { text-align: center; margin-bottom: 2rem; }
.page-header h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: #003DA5; }
.section-subtitle { font-size: 1.1rem; color: #666; }

/* --- GRID LAYOUT --- */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem; 
    margin-top: 2rem;
}

/* --- CARD STYLING --- */
.agent-card {
    background: #ffffff;
    border: 1px solid #E1E0E4;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.agent-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* --- IMAGE STYLING --- */
.agent-img-wrapper {
    width: 180px; /* INCREASED FROM 130px */
    height: 180px; /* INCREASED FROM 130px */
    border-radius: 50%; 
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: #f9f9f9; 
    border: 3px solid #E1E0E4; /* Slightly thicker border for larger image */
}

.agent-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

/* --- TEXT STYLING --- */
.agent-card-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0C0020; 
    margin: 0 0 4px 0;
}

.agent-card-title {
    font-size: 1rem;
    color: #E11B22; 
    font-weight: 600;
    margin: 0 0 1rem 0;
}


/* --- CONTACT INFO SECTION --- */
.agent-contact-info {
    width: 100%;
    margin-bottom: 1.5rem;
    text-align: center; /* CHANGED FROM LEFT to center text */
    flex-grow: 1; 
}

.contact-item {
    display: flex;
    justify-content: center; /* ADDED to center the icon and text together */
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #666; 
}

.contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0; 
    color: #003DA5; 
}

.contact-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #003DA5;
}

/* --- ACTION BUTTONS --- */
.agent-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    margin-top: auto; 
}

.btn-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-red { background: #E11B22; color: #ffffff; border: none; }
.btn-red:hover { background: #b3151b; }

.btn-outline-blue { background: transparent; color: #003DA5; border: 2px solid #003DA5; }
.btn-outline-blue:hover { background: #003DA5; color: #ffffff; }

/* --- PAGINATION --- */
.pagination-container {
    grid-column: 1 / -1; /* Spans the full width of the grid */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #E1E0E4;
    flex-wrap: wrap;
}

.page-btn {
    background: #ffffff;
    border: 1px solid #E1E0E4;
    color: #0C0020;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    font-size: 0.95rem;
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    border-color: #003DA5;
    color: #003DA5;
}

.page-btn.active {
    background: #003DA5;
    color: white;
    border-color: #003DA5;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- SOCIAL MEDIA & ICON LINKS --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    width: 100%;
}

.social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f4ff;
    color: #003DA5;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    padding: 0;
}

.social-icon-btn:hover {
    background: #003DA5;
    color: #ffffff;
    transform: translateY(-2px);
}

.agent-search-wrapper svg,
.search-icon {
    position: absolute;
    left: 35px; /* Pushes it just past the wrapper's 15px padding */
    top: 50%;
    transform: translateY(-50%); /* Perfectly centers it vertically */
    pointer-events: none; /* Stops the icon from blocking clicks if the user taps it */
}

/* --- EMAIL MODAL STYLING --- */
.modal-overlay { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.5); 
    z-index: 3000; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(3px); /* Adds a modern blur to the background */
}

.modal-overlay.active { display: flex; }

.modal-content { 
    background: white; 
    padding: 30px; 
    border-radius: 12px; 
    width: 90%; 
    max-width: 450px; 
    position: relative; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); 
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close { 
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: #f1f1f1; 
    border: none; 
    font-size: 1.5rem; 
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer; 
    color: #666; 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s; 
}

.modal-close:hover { background: #E11B22; color: white; }

.modal-title { margin: 0 0 5px 0; font-size: 1.4rem; color: #0C0020; }
.modal-subtitle { font-size: 0.95rem; color: #666; margin-bottom: 20px; }

.modal-input-row { margin-bottom: 15px; }
.modal-input-row input { 
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #E1E0E4; 
    border-radius: 8px; 
    outline: none; 
    font-size: 1rem; 
    font-family: inherit;
}
.modal-input-row input:focus { border-color: #003DA5; }

.modal-textarea { 
    width: 100%; 
    padding: 12px 15px; 
    border: 1px solid #E1E0E4; 
    border-radius: 8px; 
    height: 120px; 
    outline: none; 
    resize: none; 
    font-family: inherit; 
    font-size: 1rem; 
    margin-bottom: 20px;
}
.modal-textarea:focus { border-color: #003DA5; }

.modal-btn { 
    width: 100%; 
    background: #E11B22; 
    color: white; 
    border: none; 
    padding: 14px; 
    font-size: 1.1rem; 
    font-weight: bold; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
}
.modal-btn:hover { background: #b3151b; }

/* --- SEARCH BAR --- */
/* --- RESPONSIVE SEARCH BAR FIX --- */
.agent-search-wrapper {
    position: relative; /* CRITICAL: This acts as the anchor, locking the absolute icon inside! */
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    padding: 0 15px;
    box-sizing: border-box;
}

#agentSearchInput {
    width: 100%;
    box-sizing: border-box;
    padding-left: 45px; /* Adds space on the left so user text doesn't type over the icon */
}

.agent-search-wrapper input {
    width: 100%;
    padding: 14px 20px 14px 45px; /* Extra left padding for a visual icon/spacing */
    font-size: 1.1rem;
    border: 2px solid #E1E0E4;
    border-radius: 30px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    color: #0C0020;
}

.agent-search-wrapper input:focus {
    border-color: #003DA5;
    box-shadow: 0 4px 15px rgba(0, 61, 165, 0.15);
}

/* Optional visual search icon inside the input */
/* Keeps the search bar contained */
.agent-search-wrapper {
    position: relative; 
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    padding: 0 15px;
    box-sizing: border-box;
}

#agentSearchInput {
    width: 100%;
    box-sizing: border-box;
    padding-left: 45px; 
}

/* Centers the phone number */
.agent-phone {
    display: flex;
    justify-content: center; 
    align-items: center;     
    width: 100%;
    gap: 8px;                
    margin-bottom: 15px;     
}