/* Talent Page Styles - Redesigned for Modern UI/UX */

/* Main Layout */
.talent-listing-page-wrapper {
    background-color: var(--background-light);
    min-height: 100vh;
    padding-bottom: var(--spacing-xxl); /* More padding at bottom */
}

/* Hero Section - More prominent and centered */
.hero-section {
    background: linear-gradient(to right, var(--primary-extra-light), var(--primary-light)); /* Soft gradient */
    padding: var(--spacing-xxxl) 0; /* More vertical padding */
    text-align: center;
    margin-bottom: var(--spacing-xxl); /* Space below hero */
    border-bottom: 1px solid var(--border-color); /* Subtle separator */
    box-shadow: var(--shadow-sm); /* Soft shadow */
    position: relative;
    overflow: hidden;
}

.hero-section::before { /* Optional: subtle background pattern */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%239BAAB8" fill-opacity="0.1" fill-rule="evenodd"%3E%3Cpath d="M5 0h1L0 6V5zM6 5v1H5z"/%3E%3C/g%3E%3C/svg%3E');
    opacity: 0.3;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 1; /* Ensure content is above pattern */
}

.hero-text {
    max-width: 800px;
    margin: 0 auto;
}

.hero-text h1 {
    font-size: var(--font-size-xxxxl); /* Larger, impactful title */
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    font-weight: 800; /* Bolder */
}

.hero-subtitle {
    font-size: var(--font-size-xl); /* Larger subtitle */
    color: var(--primary-dark); /* Darker primary for emphasis */
    margin-bottom: var(--spacing-xl);
    font-weight: 500;
}

/* Main Search Bar in Hero */
.main-search-bar {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg); /* More rounded */
    padding: 0.75rem 1rem; /* Increased padding */
    box-shadow: var(--shadow-md); /* More pronounced shadow */
    transition: all 0.3s ease;
    max-width: 700px; /* Max width for search bar */
    margin: var(--spacing-xl) auto 0; /* Center it below text */
}

.main-search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light); /* Stronger focus ring */
}

.main-search-bar .search-icon {
    color: var(--text-light);
    font-size: var(--font-size-lg);
    margin-right: var(--spacing-md);
}

.main-search-bar input {
    flex: 1;
    border: none;
    padding: 0.5rem; /* Adjust padding within input */
    font-size: var(--font-size-base);
    color: var(--text-dark);
    background: transparent;
}

.main-search-bar input:focus {
    outline: none;
}

.main-search-bar button {
    padding: 0.75rem 1.8rem; /* Larger button */
    font-weight: 600;
    border-radius: var(--border-radius-lg); /* More rounded button */
    margin-left: 0.75rem;
    box-shadow: var(--shadow-xs); /* Subtle button shadow */
}

/* Quick Filters Section - Interactive Cards */
.quick-filters-section {
    margin-top: var(--spacing-xxl);
    margin-bottom: var(--spacing-xxl);
}

.quick-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* More flexible grid */
    gap: var(--spacing-md);
    justify-content: center; /* Center cards if not full width */
}

.quick-filter-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 1rem; /* More padding */
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.quick-filter-card::before { /* Subtle hover/active background */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-extra-light);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 0;
}

.quick-filter-card:hover::before,
.quick-filter-card.active::before {
    opacity: 1;
}

.quick-filter-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: var(--shadow-sm);
}

.quick-filter-card i {
    font-size: var(--font-size-xxl);
    color: var(--primary);
    background-color: var(--primary-extra-light);
    width: 60px; /* Larger icon background */
    height: 60px;
    border-radius: 50%; /* Circular icon background */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.quick-filter-card:hover i {
    background-color: var(--primary);
    color: var(--white);
}

.quick-filter-card span {
    font-size: var(--font-size-base); /* Slightly larger text */
    color: var(--text-dark);
    font-weight: 600; /* Bolder text */
    position: relative;
    z-index: 1;
}

.quick-filter-card.active {
    background-color: var(--primary); /* Active card background */
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.quick-filter-card.active i {
    color: var(--primary); /* Icon color remains primary */
    background-color: var(--white); /* Icon background becomes white */
}

.quick-filter-card.active span {
    color: var(--white); /* Active text color */
}

/* Talent Browse Section */
.talent-browse-section {
    margin-top: var(--spacing-xl); /* Space above the grid */
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    border: 1px solid var(--border-color);
}

.browse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.browse-header .section-title {
    margin: 0;
    font-size: var(--font-size-xxl);
    color: var(--text-dark);
}

.browse-header .btn {
    font-size: var(--font-size-sm);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.browse-header .filter-arrow {
    transition: transform 0.3s ease;
}

.browse-header .btn[aria-expanded="true"] .filter-arrow {
    transform: rotate(180deg);
}

/* Active Filters Display */
.active-filters-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px; /* Gap between tags and label */
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px dashed var(--border-color);
}

.active-filters-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-right: var(--spacing-sm);
    flex-shrink: 0; /* Prevent shrinking */
}

.active-filters-display .selected-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: 1px solid var(--primary);
}

.active-filters-display .remove-tag {
    cursor: pointer;
    color: var(--primary-dark);
    font-size: var(--font-size-xs);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.active-filters-display .remove-tag:hover {
    opacity: 1;
    color: var(--danger);
}

.clear-all-filters-btn {
    margin-left: auto; /* Push to the right */
    color: var(--text-light);
    font-weight: 500;
}

.clear-all-filters-btn:hover {
    color: var(--danger);
}

/* Advanced Filters Container (Collapsible) */
.advanced-filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Flexible columns */
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out, transform 0.4s ease-out; /* Smooth transition for expand/collapse */
    max-height: 0; /* Start collapsed */
    overflow: hidden; /* Hide content when collapsed */
    opacity: 0;
    transform: translateY(-10px);
}

.advanced-filters-container.show {
    max-height: 1000px; /* Increased max-height to ensure content fits */
    opacity: 1;
    transform: translateY(0);
}

.advanced-filters-container .filter-group {
    margin-bottom: 0; /* Remove default margin-bottom from form-group */
}

/* --- ENHANCED CUSTOM DROPDOWN STYLING --- */
.custom-dropdown {
    position: relative;
    width: 100%;
}
.custom-dropdown .dropdown-toggle {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem; /* More vertical padding */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); /* Subtle inner shadow */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-weight: 500;
    color: var(--text-dark);
}
.custom-dropdown .dropdown-toggle:hover {
    border-color: var(--border-color-hover);
}
.custom-dropdown.active .dropdown-toggle {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.custom-dropdown .dropdown-arrow {
    transition: transform 0.2s;
    font-size: var(--font-size-sm);
    color: var(--text-light);
}
.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg); /* Larger, more prominent shadow */
    z-index: 50;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding-bottom: 1rem; /* FIX: Added padding bottom */
}
.custom-dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.custom-dropdown .dropdown-menu-checkboxes {
    padding: var(--spacing-sm);
}
.custom-dropdown .checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem; /* Increased padding */
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease;
}
.custom-dropdown .checkbox-item:hover {
    background-color: var(--background-hover); /* Subtle background on hover */
}
.custom-dropdown .checkbox-item input[type="checkbox"] {
    margin-right: 0.75rem;
    transform: scale(1.1);
    accent-color: var(--primary); /* Change checkbox color */
}
.custom-dropdown .checkbox-item label {
    margin: 0;
    font-weight: 400;
    color: var(--text-body);
    flex-grow: 1;
    cursor: pointer;
}
.custom-dropdown .checkbox-item:hover label {
    color: var(--primary-dark);
}
.custom-dropdown .no-results-message {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

.loading-spinner-small {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-light);
    font-size: var(--font-size-sm);
}

/* Talent Grid Section */
.talent-grid-section {
    margin-top: 0;
    padding-top: var(--spacing-xxs);
    position: relative;
    z-index: 1;
}

.talent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: var(--spacing-sm); /* Consistent gap */
}

/* --- ENHANCEMENTS & FIXES FOR TALENT CARDS --- */
.talent-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem; 
    display: flex;
    flex-direction: column;
    gap: 0.75rem; 
    /* REVISED: Removed fixed dimensions. Cards will now be fluid and responsive. */
    min-width: 350px; 
    max-width: 100%;
    height: auto; 
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: var(--shadow-xs);
}
.talent-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.talent-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

/* FIX: Talent Avatar Styling */
.talent-avatar {
    width: 72px;
    height: 72px;
    background-color: var(--primary);
    border-radius: 50%; /* Make it circular */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--font-size-xxl);
    font-weight: bold;
    flex-shrink: 0; /* Prevent shrinking */
    overflow: hidden; /* Hide overflow if image is too big */
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.talent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers the circular area */
}
.talent-avatar.premium-border {
    border: 2px solid #DAA520; /* Goldenrod color for a touch of class */
    box-shadow: 0 0 8px rgba(218, 165, 32, 0.5); /* Subtle glow without flashing */
}

.talent-details {
    flex: 1;
    text-align: center; /* Center the text within details */
}

.talent-name {
    margin: 0;
    font-size: var(--font-size-lg); /* Slightly larger name */
    font-weight: 600;
    color: var(--text-dark);
}

.talent-profession {
    /* REMOVED: Profession section */
    display: none;
}

.talent-rating {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the rating stars */
    gap: 0.3rem;
    margin-top: 0.15rem;
    color: var(--accent);
    font-size: var(--font-size-sm);
    font-weight: 500;
}
.talent-rating i.text-gray-400 {
    color: var(--text-light);
}

.talent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.talent-location-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-body);
    font-size: var(--font-size-sm);
    justify-content: center; /* Center the location info */
}

.talent-location-container i {
    color: var(--primary);
    font-size: var(--font-size-base);
}

.talent-skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0;
    margin-top: 0rem; /* Reduced spacing to be more compact */
    justify-content: center; /* Center the skills */
}

.skill-tag {
    background-color: var(--tag-background);
    color: var(--tag-text);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    height: fit-content; /* Prevent vertical stretching */
    line-height: 1; /* Keep text centered */
    min-height: 1.5rem; /* Set consistent height */
}

.skill-tag:hover {
    background-color: var(--secondary);
    color: var(--white);
}

.talent-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: auto;
}

.talent-actions .btn {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.talent-actions .btn i {
    font-size: var(--font-size-base);
}

/* Loading and No Results States */
.loading-spinner {
    grid-column: 1 / -1; /* Span full width */
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading-spinner i {
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-md);
    color: var(--primary);
}

.no-results {
    grid-column: 1 / -1; /* Span full width */
    text-align: center;
    padding: 3rem;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.no-results i {
    font-size: var(--font-size-xxxl);
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.no-results p {
    color: var(--text-body);
    margin-bottom: var(--spacing-lg);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-section {
        padding: var(--spacing-xxl) 0;
    }
    .hero-text h1 {
        font-size: var(--font-size-xxxl);
    }
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    .main-search-bar {
        flex-direction: column;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    .main-search-bar button {
        width: 100%;
        margin-left: 0;
    }

    .quick-filters-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* Smaller cards for tablets */
    }

    .talent-browse-section {
        padding: var(--spacing-lg);
    }

    .browse-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .browse-header .section-title {
        font-size: var(--font-size-xl);
    }

    .active-filters-display {
        flex-direction: column;
        align-items: flex-start;
    }
    .active-filters-label {
        margin-bottom: var(--spacing-xs);
    }
    .clear-all-filters-btn {
        margin-left: 0; /* Align left on mobile */
        width: 100%;
        text-align: left;
    }

    .advanced-filters-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .talent-card {
        /* Remove fixed width constraints for a more fluid layout */
        min-width: 320px;
        max-width: 100%;
        margin: 0;
        padding: 1rem;
        min-height: 380px;
        display: flex; /* Change to flex instead of grid */
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .talent-card-header {
        /* Align header content horizontally */
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding-bottom: 0.25rem;
        border-bottom: none;
        gap: 1rem;
    }

    .talent-details {
        text-align: left;
    }
    
    .talent-rating {
        justify-content: flex-start;
    }
    
    .talent-skills-container {
        justify-content: flex-start;
    }

    .talent-location-container {
        justify-content: flex-start;
    }

    .talent-actions {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .quick-filters-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on very small screens */
    }
}
