/* --- Global Styles & Variables --- */
:root {
    --primary-color: #2c3e50; /* Dark Blue */
    --secondary-color: #3498db; /* Bright Blue */
    --accent-color: #e74c3c; /* Coral Red */
    --light-color: #ffffff;
    --dark-color: #333333;
    --grey-color: #f4f4f4;
    --text-color: #555;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
}

h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 3rem;
}

/* --- Password Reset Form --- */
#password-reset-form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
}

#password-reset-form h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

#password-reset-form p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

#password-reset-form input[type="email"],
#password-reset-form input[type="password"],
#password-reset-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

#password-reset-form input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#password-reset-form .btn {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1rem;
    cursor: pointer;
}

#password-reset-form .btn-outline {
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
}

#password-reset-form .btn-outline:hover {
    background: rgba(52, 152, 219, 0.1);
}

#reset-message {
    padding: 0.75rem;
    margin-top: 1rem;
    border-radius: 4px;
    display: none;
}

#reset-message.error-message {
    background-color: #fde8e8;
    color: #c53030;
    border: 1px solid #feb2b2;
}

#reset-message.success-message {
    background-color: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

/* --- Header --- */
header {
    background: var(--light-color);
    color: var(--dark-color);
    padding: 1rem 0;
    border-bottom: 1px solid #e7e7e7;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo a {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

header .nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

header .nav-links a {
    color: var(--dark-color);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.9rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-bottom 0.3s;
}

header .nav-links a:hover, #login-btn:hover {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}

#login-btn {
    background: var(--accent-color);
    color: var(--light-color);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

#login-btn:hover {
    background: #c0392b;
    border-bottom: none;
    color: var(--light-color);
}

/* --- Hero Section --- */
.hero {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 6rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: auto;
}

.search-form input {
    width: 70%;
    padding: 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

.search-form button {
    padding: 15px 30px;
    border: none;
    background: var(--accent-color);
    color: var(--light-color);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0 5px 5px 0;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #c0392b;
}

/* --- Advocate Type Filters --- */
.advocate-types {
    padding: 2rem 0;
    background: #ecf0f1;
}

.type-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.filter-btn {
    background: var(--light-color);
    border: 1px solid #bdc3c7;
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.filter-btn:hover {
    background: var(--secondary-color);
    color: var(--light-color);
    border-color: var(--secondary-color);
}

/* --- Practice Areas --- */
.practice-areas {
    padding: 5rem 0;
}

.areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.area-card {
    background: var(--light-color);
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.area-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.area-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.area-card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* =================================
   Advocates Page Styles
   ================================= */

/* Page Header */
.advocates-page .page-header {
    background: linear-gradient(135deg, var(--primary-color), #1a3a5f);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    margin-bottom: 40px;
}

.advocates-page .page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: white;
}

.advocates-page .page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* Search Section */
.search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px 0;
    margin-bottom: 40px;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.search-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 5px 5px 5px 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.search-box:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 5px 25px rgba(52, 152, 219, 0.25);
}

.search-box i {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-right: 10px;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 1rem;
    background: transparent;
    color: #2c3e50;
}

.search-box input::placeholder {
    color: #95a5a6;
    font-weight: 400;
}

.filter-options {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
}

.custom-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.custom-select:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Listing Header */
.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.listing-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--primary-color);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options span {
    color: #666;
    font-size: 0.95rem;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
}

/* Advocate Listings */
.advocate-listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.advocate-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.advocate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.advocate-card:hover .card-image img {
    transform: scale(1.05);
}

.experience-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

.card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    margin: 0 0 5px;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.specialty {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.location {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.location i {
    margin-right: 5px;
    color: #999;
}

.rating {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.rating i {
    color: #ffc107;
    margin-right: 2px;
    font-size: 0.9rem;
}

.rating span {
    margin-left: 8px;
    color: #777;
    font-size: 0.85rem;
}

.card-footer {
    margin-top: auto;
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    flex: 1;
    gap: 5px;
}

.primary-btn i {
    font-size: 0.9rem;
}

.primary-btn.outline {
    background: white;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.primary-btn.outline:hover {
    background: #f8f9fa;
}

.primary-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 50px 20px;
    grid-column: 1 / -1;
}

.no-results-img {
    max-width: 200px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.no-results h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.no-results p {
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-nav {
    padding: 8px 15px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.page-nav:hover:not(.disabled) {
    background: #f8f9fa;
    border-color: #ccc;
}

.page-nav.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-numbers a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-numbers a:hover,
.page-numbers a.active {
    background: var(--secondary-color);
    color: white;
}

.page-numbers span {
    display: flex;
    align-items: flex-end;
    padding: 0 5px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .advocate-listings {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .search-container {
        padding: 20px;
    }
    
    .filter-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sort-options {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 576px) {
    .advocate-listings {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box input[type="text"] {
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .search-box button {
        border-radius: 8px;
        padding: 12px;
    }
    
    .card-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .primary-btn {
        width: 100%;
        padding: 10px;
    }
}

/* --- Legal Experts Section --- */
.legal-experts {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.experts-grid {
    display: flex;
    overflow-x: auto;
    padding: 20px 0;
    gap: 20px;
    margin: 0 -15px;
    scrollbar-width: thin;
    scrollbar-color: #3498db #f1f1f1;
}

.experts-grid::-webkit-scrollbar {
    height: 8px;
}

.experts-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.experts-grid::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.expert-card {
    flex: 0 0 auto;
    width: 160px;
    padding: 15px 10px;
    margin: 0 5px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.expert-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.expert-card .card-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 10px;
}

.expert-card .card-image img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.4s;
}

.expert-card:hover .card-image img {
    transform: scale(1.05);
}

.expert-card .card-content {
    padding: 25px;
    text-align: center;
}

.expert-card h3 {
    font-size: 1.4rem;
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-weight: 600;
}

.expert-card p {
    font-size: 0.9rem;
    margin: 0 0 1.5rem 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* --- CTA Section --- */
.cta {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 5rem 0;
    text-align: center;
}

.cta h2 {
    color: var(--light-color);
    font-size: 2.8rem;
}

.cta p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn-cta {
    background: var(--accent-color);
    color: var(--light-color);
    padding: 15px 35px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-cta:hover {
    background: #c0392b;
}

/* --- Footer --- */
footer {
    background: var(--dark-color);
    color: #bdc3c7;
    padding: 3rem 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-content h4 {
    color: var(--light-color);
    margin-bottom: 1rem;
}

.footer-content p, .footer-content a {
    color: #bdc3c7;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-content a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #444;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header .nav-links {
        display: none; /* Simple hide for now, can be replaced with a burger menu */
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .search-form {
        flex-direction: column;
    }
    .search-form input, .search-form button {
        width: 100%;
        border-radius: 5px;
        margin-bottom: 10px;
    }
}

/* --- New Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding-top: 50px;
}

.modal-content.new-modal {
    background-color: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: animatetop 0.4s;
    overflow: hidden;
    padding: 0;
}

.modal-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}

.close-btn {
    color: white;
    font-size: 28px;
    font-weight: bold;
    opacity: 0.8;
}

.close-btn:hover,
.close-btn:focus {
    color: #f1f1f1;
    text-decoration: none;
    cursor: pointer;
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

/* --- Login Modal Toggle --- */
.login-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.login-toggle input[type="radio"] {
    display: none;
}

.login-toggle label {
    padding: 10px 20px;
    cursor: pointer;
    border: 1px solid #ccc;
    margin: 0 5px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.login-toggle input[type="radio"]:checked+label {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* --- New Form Styles --- */
.new-modal form {
    display: flex;
    flex-direction: column;
}

.new-modal form label {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.new-modal form input[type="email"],
.new-modal form input[type="password"],
.new-modal form input[type="text"],
.new-modal form select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
}

.new-modal form .forgot-password {
    text-align: right;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.new-modal form button {
    background-color: var(--secondary-color);
    color: white;
    padding: 14px 20px;
    margin-top: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s;
}

.new-modal form button:hover {
    background-color: var(--primary-color);
}

/* --- Registration Choice --- */
#registration-choice {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
}

.register-box {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    width: 45%;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.register-box:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.register-box i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.register-box h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.profile-header img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #eee;
}

.profile-header h2 {
    margin-top: 15px;
    margin-bottom: 5px;
}

.profile-details h3 {
    border-bottom: 2px solid #0779e4;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
}
