/* Base Styles */
:root {
    --primary-color: #0056b3;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ced4da;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.page-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 2rem;
}

/* Form Sections and Cards */
.form-section {
    background: var(--card-bg);
    padding: 25px 30px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #e1e5eb;
}

.form-section h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Grid Layouts for Desktop */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.full-width { grid-column: 1 / -1; }

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #495057;
}

input[type="text"], input[type="email"], input[type="date"], input[type="url"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fff;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,86,179,0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 25px; /* Aligns with input fields in a row */
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Submit Button */
.submit-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s, transform 0.1s;
    width: 100%;
    display: block;
    text-align: center;
    margin-top: 10px;
}

.submit-btn:hover { background-color: #004494; }
.submit-btn:active { transform: scale(0.98); }

/* Alerts */
.alert {
    padding: 15px 20px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 5px;
    margin-bottom: 25px;
    border: 1px solid #c3e6cb;
    text-align: center;
    font-weight: 500;
}

/* Responsive Rules for Mobile & Tablet */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .checkbox-group { margin-top: 5px; }
}


/* ========================================================
   DIRECTORY LISTING (Matching image_2e5703.jpg)
   ======================================================== */
.directory-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on desktop */
    gap: 30px;
    margin-top: 20px;
}

.agent-card {
    background-color: #ffffff;
    /* Adding a subtle patterned background similar to the image */
    background-image: radial-gradient(#f0f0f0 1px, transparent 1px);
    background-size: 20px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.agent-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.agent-info {
    flex: 1;
    padding-right: 20px;
}

.agent-info h3 {
    color: #d35400; /* Orange/Rust color from the image */
    margin: 0 0 15px 0;
    font-size: 1.3rem;
    border-bottom: none;
    text-transform: uppercase;
}

.agent-info p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #333;
}

.agent-info a {
    color: #007bff;
    text-decoration: none;
}

.agent-info a:hover {
    text-decoration: underline;
}

.agent-photo img {
    width: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    /*box-shadow: 3px 3px 10px rgba(0,0,0,0.3); */
    /*border: 2px solid #fff;*/
    background-color:#ffffff;
}

/* Specific button for the directory profile link */
.btn-view-profile {
    display: inline-block;
    background-color: #d35400;
    color: #ffffff;
    border: 2px solid #d35400;
    padding: 8px 15px; /* Better size for mobile tapping */
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-top: 5px;
}

/* Hover effect: Fills in with solid color instead of using a shadow */
.btn-view-profile:hover {
    background-color: #d35400;
    color: #ffffff;
}

@media (max-width: 900px) {
    .directory-grid-2col {
        grid-template-columns: 1fr; /* Stacks to 1 column on smaller screens */
    }
}

/* ========================================================
   SINGLE PROFILE VIEW (profile.php)
   ======================================================== */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-btn {
    background: #6c757d;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.back-btn:hover { background: #5a6268; }

.profile-main-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.profile-sidebar {
    background: var(--secondary-color);
    padding: 30px;
    text-align: center;
    width: 30%;
    border-right: 1px solid var(--border-color);
}

.profile-sidebar img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    background-color:#fff;
}

.profile-details {
    padding: 30px;
    width: 70%;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-label {
    width: 30%;
    font-weight: bold;
    color: #555;
}

.detail-value {
    width: 70%;
    color: #222;
}

/* ========================================================
   ADMIN DASHBOARD STYLES
   ======================================================== */
.admin-container {
    max-width: 1300px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
}

.admin-table th, .admin-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background-color: #2c3e50;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

/* Action Buttons */
.btn-action {
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin: 2px;
    transition: opacity 0.2s;
}

.btn-action:hover { opacity: 0.8; }
.btn-approve { background-color: #28a745; }
.btn-reject { background-color: #dc3545; }
.btn-edit { background-color: #ffc107; color: #000; }
.btn-delete { background-color: #343a40; }


/* ========================================================
   CRITICAL MOBILE RESPONSIVENESS FIXES
   ======================================================== */
/* ========================================================
   PERFECT MOBILE RESPONSIVENESS FIXES
   ======================================================== */

@media (max-width: 900px) {
    /* Forces the directory grid into a single column (one member per row) on smaller screens */
    .directory-grid-2col {
        grid-template-columns: 1fr; 
    }
}

@media (max-width: 768px) {
    
    /* 1. DIRECTORY PAGE: Image strictly at the TOP, text centered below */
    .agent-card {
        flex-direction: column-reverse; /* Flips the order so the photo sits above the text */
        text-align: left;
        padding: 25px 20px;
        align-items: flex-start;
    }
    
    .agent-photo {
        margin-bottom: 20px; /* Creates spacing between the photo and the firm name */
    }
    
    .agent-info {
        padding-right: 0;
        width: 100%;
    }

    /* 2. SINGLE PROFILE PAGE: Sidebar (with image) strictly at the TOP */
    .profile-main-card {
        flex-direction: column; /* Stacks sidebar on top of the right-side details */
    }
    
    .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 30px 20px;
        box-sizing: border-box;
    }
    
    .profile-details {
        width: 100%;
        padding: 25px 20px;
        box-sizing: border-box;
    }
    
    .detail-row {
        flex-direction: column; /* Stacks the label on top of the actual data value */
        padding-bottom: 15px;
    }
    
    .detail-label, .detail-value {
        width: 100%;
    }
    
    .detail-label {
        margin-bottom: 6px;
        color: var(--primary-color); /* Highlights the labels on mobile for readability */
    }

    /* 3. FORM & ADMIN SPACING */
    .form-section {
        padding: 20px 15px;
    }
    
    .admin-container {
        padding: 15px;
        overflow-x: auto; /* Allows horizontal swiping on the admin table */
    }
    
    .admin-table {
        min-width: 800px; /* Prevents the table from crushing together on tiny screens */
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.5rem;
    }
}



