/*
 * College Query System Styles
 * Responsive, modern design compatible with Astra and Elementor
 */

/* ========================================
   College List Grid
   ======================================== */
.college-list-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.college-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

/* Grid Layouts */
.college-grid-1 {
    grid-template-columns: 1fr;
}

.college-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.college-grid-3 {
    grid-template-columns: repeat(4, 1fr);
}

.college-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========================================
   College Card Styles
   ======================================== */
.college-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.college-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* College Image */
.college-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f5f5f5;
}

.college-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.college-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.college-card:hover .college-thumbnail {
    transform: scale(1.05);
}

/* College Content */
.college-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.college-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.college-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.college-title a:hover {
    color: #0073aa;
}

.college-description {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.college-description p:last-child {
    margin-bottom: 0;
}

/* College Action Button */
.college-action {
    margin-top: auto;
}

.college-query-btn {
    display: inline-block;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.college-query-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.college-query-btn:active {
    transform: translateY(0);
}

/* ========================================
   Popup Modal Styles
   ======================================== */
.college-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.college-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.college-popup-container {
    background: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.college-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 28px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.college-popup-close:hover {
    background: #e74c3c;
    color: #ffffff;
    transform: rotate(90deg);
}

.college-popup-content {
    padding: 40px;
}

.popup-title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 0 0 30px 0;
    text-align: center;
}

/* ========================================
   Contact Form 7 Styling
   ======================================== */
.popup-form-wrapper .wpcf7 {
    margin: 0;
}

.popup-form-wrapper .wpcf7-form {
    
}

.query-form-wrapper{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
    column-gap: 20px;
}

.popup-form-wrapper .wpcf7-form p {
    margin: 0;
}

/* Full width fields (Message and Submit) */
.popup-form-wrapper .wpcf7-form p:nth-last-child(1),
.popup-form-wrapper .wpcf7-form p:nth-last-child(2) {
    grid-column: 1 / -1;
}

/* Form rows */
.popup-form-wrapper .form-row {
    display: flex;
    flex-direction: column;
}
.popup-form-wrapper .wpcf7-form label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.popup-form-wrapper .wpcf7-form input[type="text"],
.popup-form-wrapper .wpcf7-form input[type="email"],
.popup-form-wrapper .wpcf7-form input[type="tel"],
.popup-form-wrapper .wpcf7-form select,
.popup-form-wrapper .wpcf7-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.popup-form-wrapper .wpcf7-form input:focus,
.popup-form-wrapper .wpcf7-form select:focus,
.popup-form-wrapper .wpcf7-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.popup-form-wrapper .wpcf7-form textarea {
    min-height: 120px;
    resize: vertical;
}

.popup-form-wrapper .wpcf7-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
}

.popup-form-wrapper .wpcf7-form input[type="submit"] {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.popup-form-wrapper .wpcf7-form input[type="submit"]:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.popup-form-wrapper .wpcf7-form input[type="submit"]:active {
    transform: translateY(0);
}

/* CF7 Response Messages */
.popup-form-wrapper .wpcf7-response-output {
    margin: 20px 0 0 0;
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.popup-form-wrapper .wpcf7-mail-sent-ok {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.popup-form-wrapper .wpcf7-validation-errors,
.popup-form-wrapper .wpcf7-mail-sent-ng {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.popup-form-wrapper .wpcf7-spam-blocked {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.popup-form-wrapper .wpcf7-not-valid-tip {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* CF7 Checkbox Styling */
.popup-form-wrapper .wpcf7-checkbox,
.popup-form-wrapper .wpcf7-radio {
    margin-top: 10px;
}

.popup-form-wrapper .wpcf7-list-item {
    display: block;
    margin: 10px 0;
    padding: 8px 0;
}

.popup-form-wrapper .wpcf7-checkbox input[type="checkbox"],
.popup-form-wrapper .wpcf7-radio input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

.popup-form-wrapper .wpcf7-list-item-label {
    cursor: pointer;
    font-weight: 400;
    color: #333;
    font-size: 15px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.5;
}

.popup-form-wrapper .wpcf7-list-item-label:hover {
    color: #667eea;
}

/* Checkbox/Radio checked state */
.popup-form-wrapper .wpcf7-checkbox input[type="checkbox"]:checked + .wpcf7-list-item-label,
.popup-form-wrapper .wpcf7-radio input[type="radio"]:checked + .wpcf7-list-item-label {
    color: #667eea;
    font-weight: 500;
}

/* Small helper text under checkboxes */
.popup-form-wrapper small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* CF7 Spinner */
.popup-form-wrapper .wpcf7-spinner {
    margin: 0;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.popup-form-wrapper .wpcf7-submit-wrapper {
    position: relative;
}

/* ========================================
   Flamingo Submissions Table
   ======================================== */
.flamingo-submissions-wrapper {
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.flamingo-submissions-wrapper h2 {
    margin: 0 0 25px 0;
    font-size: 26px;
    color: #333;
}

.submissions-table-wrapper {
    overflow-x: auto;
}

.flamingo-submissions-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.flamingo-submissions-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.flamingo-submissions-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flamingo-submissions-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.flamingo-submissions-table tbody tr:hover {
    background: #f9f9f9;
}

.flamingo-submissions-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   No Colleges Found Message
   ======================================== */
.no-colleges-found {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #999;
    background: #f9f9f9;
    border-radius: 12px;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 991px) {
    .college-grid-3,
    .college-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .college-popup-content {
        padding: 30px;
    }
    
    .popup-title {
        font-size: 24px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .college-grid-2,
    .college-grid-3,
    .college-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .college-list-wrapper {
        padding: 15px 0;
    }
    
    .college-grid {
        gap: 20px;
    }
    
    .college-content {
        padding: 20px;
    }
    
    .college-title {
        font-size: 20px;
    }
    
    .college-description {
        font-size: 14px;
    }
    
    .college-popup-overlay {
        padding: 10px;
    }
    
    .college-popup-content {
        padding: 25px 20px;
    }
    
    .popup-title {
        font-size: 22px;
        margin-bottom: 25px;
    }
    
    .college-popup-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
    
    .popup-form-wrapper .wpcf7-form input[type="text"],
    .popup-form-wrapper .wpcf7-form input[type="email"],
    .popup-form-wrapper .wpcf7-form input[type="tel"],
    .popup-form-wrapper .wpcf7-form select,
    .popup-form-wrapper .wpcf7-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Switch to single column on mobile */
    .popup-form-wrapper .wpcf7-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .popup-form-wrapper .wpcf7-form p:nth-last-child(1),
    .popup-form-wrapper .wpcf7-form p:nth-last-child(2) {
        grid-column: 1;
    }
    
    .flamingo-submissions-table {
        font-size: 12px;
    }
    
    .flamingo-submissions-table th,
    .flamingo-submissions-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .college-query-btn,
    .popup-form-wrapper .wpcf7-form input[type="submit"] {
        font-size: 14px;
        padding: 12px 24px;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.college-query-btn:focus-visible,
.college-popup-close:focus-visible,
.popup-form-wrapper .wpcf7-form input[type="submit"]:focus-visible {
    outline: 3px solid #667eea;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
