/**
 * College Users Display Styles
 */

.cud-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cud-container h2 {
    color: #2e3192;
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}

.cud-container p {
    color: #666;
    text-align: center;
    margin-bottom: 25px;
    font-size: 16px;
}

/* Form styles */
.cud-form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 15px;
    justify-content: center;
}

.cud-form-group {
    flex: 0 0 400px;
    max-width: 400px;
}

.cud-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 15px;
}

.cud-form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    color: #333;
}

.cud-form-group select:focus {
    border-color: #2e3192;
    outline: none;
    box-shadow: 0 2px 8px rgba(46, 49, 146, 0.15);
}

/* Results heading */
#cud-results h3 {
    color: #2e3192;
    font-size: 22px;
    margin: 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 500;
}

/* User cards grid layout */
.cud-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* User card styles */
.cud-user-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    overflow: visible; /* Changed from hidden to visible */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    margin-top: 60px; /* Added margin to make room for the photo */
}

.cud-user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.cud-user-header {
    background-color: #2e3192;
    color: white;
    padding: 20px;
    padding-top: 60px;
    text-align: center;
    position: relative;
    border-radius: 12px 12px 0 0;
}

.cud-user-photo-container {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background-color: #f5f5f5;
    z-index: 2;
}

.cud-profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block; /* Ensures the image is properly displayed */
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .cud-users-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .cud-user-card {
        margin-top: 50px; /* Adjusted for mobile */
    }
    
    .cud-user-photo-container {
        width: 80px;
        height: 80px;
        top: -40px; /* Adjusted position for mobile */
    }
    
    .cud-container h2 {
        font-size: 22px;
    }
}

@media screen and (max-width: 576px) {
    .cud-form-group {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .cud-users-grid {
        grid-template-columns: 1fr;
    }
    
    .cud-user-header {
        padding: 15px;
        padding-top: 50px; /* Ensure enough space for the photo */
    }
    
    .cud-user-details {
        padding: 15px;
    }
    
    .cud-user-photo-container {
        width: 70px; /* Smaller on very small screens */
        height: 70px;
        top: -35px;
    }
}

.cud-user-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.cud-user-gender {
    font-size: 14px;
    opacity: 0.9;
}

.cud-user-details {
    padding: 20px;
}

.cud-detail-item {
    margin-bottom: 15px;
}

.cud-detail-label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
    margin-bottom: 5px;
    display: block;
}

.cud-detail-value {
    color: #333;
    font-size: 15px;
}

/* Badge styling for travel modes and days */
.cud-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px;
    margin-bottom: 5px;
    background-color: #e8eaf6;
    color: #3949ab;
}

/* Loading spinner */
.cud-loading-container {
    text-align: center;
    padding: 40px;
}

.cud-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2e3192;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: cud-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.cud-loading-text {
    color: #666;
    font-size: 16px;
}

@keyframes cud-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error styles */
.cud-error-container {
    background-color: #fff8f8;
    border-left: 4px solid #ff5252;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cud-error-container p {
    color: #d32f2f;
    margin: 0;
    text-align: left;
}

/* Search bar styles */
.cud-search-container {
    margin-bottom: 25px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cud-search-input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    color: #333;
}

.cud-search-input:focus {
    border-color: #2e3192;
    outline: none;
    box-shadow: 0 2px 8px rgba(46, 49, 146, 0.15);
}

.cud-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 18px;
}

.cud-search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 18px;
    cursor: pointer;
    display: none;
}

.cud-search-clear:hover {
    color: #d32f2f;
}

.cud-no-results {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

/* Highlight matched text */
.cud-highlight {
    background-color: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}