/* College Search & Filter Styles */

/* Search Form */
.college-search-wrapper {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-header {
    text-align: center;
    margin-bottom: 25px;
}

.search-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #002147;
    margin-bottom: 8px;
}

.search-header p {
    color: #666;
    font-size: 16px;
}

/* Search Input with Autocomplete */
.search-autocomplete-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

#college-search-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
}

#college-search-input:focus {
    border-color: #ff5a00;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.1);
}

.search-btn {
    padding: 14px 30px;
    background: #ff5a00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #e04f00;
    transform: translateY(-2px);
}

/* Autocomplete Results */
#autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.ac-college-name {
    font-weight: 600;
    color: #002147;
    margin-bottom: 4px;
}

.ac-college-location {
    font-size: 13px;
    color: #666;
}

/* Filter Section */
.filter-section {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.filter-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
}

.filter-toggle h3 {
    font-size: 18px;
    font-weight: 600;
    color: #002147;
    margin: 0;
}

.filter-toggle i {
    font-size: 20px;
    color: #666;
    transition: transform 0.3s;
}

.filter-toggle.active i {
    transform: rotate(180deg);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.filter-input {
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-input:focus {
    border-color: #ff5a00;
    outline: none;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

#clear-filters {
    padding: 8px 16px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

#clear-filters:hover {
    background: #e0e0e0;
}

/* Search Results */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 2px solid #f0f0f0;
}

.results-count {
    font-size: 16px;
    color: #666;
}

.results-count strong {
    color: #002147;
    font-weight: 700;
}

.view-toggle {
    display: flex;
    gap: 8px;
}

.view-toggle-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    border-color: #ff5a00;
    color: #ff5a00;
}

.view-toggle-btn.active {
    background: #ff5a00;
    color: #fff;
    border-color: #ff5a00;
}

/* College Results Grid */
.college-results-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.college-results-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.college-results-grid.list-view {
    grid-template-columns: 1fr;
}

.college-card-search {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.college-card-search:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.college-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.college-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.college-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 48px;
}

.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rating-badge i {
    color: #ffc107;
}

.college-info {
    padding: 20px;
}

.college-name {
    font-size: 18px;
    font-weight: 700;
    color: #002147;
    margin-bottom: 8px;
}

.college-location {
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.college-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.college-fees {
    background: #f0f8ff;
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    margin-bottom: 15px;
}

.college-fees strong {
    color: #ff5a00;
}

.college-actions {
    display: flex;
    gap: 10px;
}

.btn-outline {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #002147;
    color: #002147;
    background: transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-outline:hover {
    background: #002147;
    color: #fff;
}

.btn-primary {
    flex: 1;
    padding: 8px 16px;
    background: #ff5a00;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #e04f00;
}

.btn-sm {
    font-size: 13px;
}

/* List View Specific */
.list-view .college-card-search {
    display: flex;
}

.list-view .college-image {
    width: 250px;
    height: auto;
    min-height: 200px;
}

.list-view .college-info {
    flex: 1;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #d0d0d0;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    font-weight: 500;
}

.page-btn:hover {
    background: #f5f5f5;
    border-color: #ff5a00;
    color: #ff5a00;
}

.page-btn.active {
    background: #ff5a00;
    color: #fff;
    border-color: #ff5a00;
}

.page-dots {
    padding: 0 8px;
    color: #999;
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff5a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

/* Error State */
.search-error {
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.search-error i {
    font-size: 64px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .college-search-wrapper {
        padding: 20px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .college-results-grid.grid-view {
        grid-template-columns: 1fr;
    }

    .list-view .college-card-search {
        flex-direction: column;
    }

    .list-view .college-image {
        width: 100%;
    }

    .search-results-header {
        flex-direction: column;
        gap: 15px;
    }
}


/* Header Search Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
}

.autocomplete-group-label {
    padding: 10px 16px;
    background: #f8f9fa;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.autocomplete-item:last-of-type {
    border-bottom: 1px solid #e0e0e0;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.ac-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.ac-content {
    flex: 1;
    min-width: 0;
}

.ac-title {
    font-weight: 600;
    color: #002147;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-subtitle {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-view-all {
    display: block;
    padding: 14px 16px;
    text-align: center;
    background: #f8f9fa;
    color: #ff5a00;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 12px 12px;
    transition: all 0.2s;
}

.autocomplete-view-all:hover {
    background: #ff5a00;
    color: #fff;
}

.autocomplete-view-all i {
    margin-left: 6px;
    transition: transform 0.2s;
}

.autocomplete-view-all:hover i {
    transform: translateX(4px);
}

/* Mobile autocomplete adjustments */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 300px;
        border-radius: 8px;
    }

    .ac-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .autocomplete-item {
        padding: 10px 12px;
    }
}
