/* Ask Anything Feature Styles */

.ask-anything-button {
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
    font-weight: 600;
    padding: 12px 24px;
    margin-top: 10px;
}

.ask-anything-button:hover {
    background-color: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Dialog styles */
.ask-anything-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    width: 100%;
    max-width: 800px; /* Increased from 600px to 800px */
}

.ask-anything-dialog .title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ask-anything-dialog .title-bar h2 {
    margin: 0;
    font-size: 1.8rem; /* Increased from 1.5rem to 1.8rem */
    color: white;
}

.ask-anything-dialog .close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ask-anything-dialog .close-btn:hover {
    color: #fff;
}

.ask-anything-dialog .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.ask-anything-dialog .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: white;
}

.ask-anything-dialog .form-group textarea {
    width: 100%;
    padding: 12px; /* Increased from 10px to 12px */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    min-height: 120px; /* Increased from 100px to 120px */
    resize: vertical;
}

.ask-anything-dialog .submit-btn {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 10px;
}

.ask-anything-dialog .submit-btn:hover {
    background-color: #8e44ad;
}

/* Loading spinner */
.ask-anything-dialog .spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    display: none;
}

/* Configuration cards */
.ask-anything-results {
    display: none;
    margin-top: 20px;
    width: 100%;
}

.ask-anything-results .card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around; /* Changed to space-around for even distribution */
    gap: 8px; /* Reduced from 10px to 8px */
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.ask-anything-results .learning-card {
    flex: 0 0 calc(33.333% - 8px); /* Adjusted to match the new gap */
    max-width: calc(33.333% - 8px); /* Ensure cards don't grow beyond their allocated space */
    margin-bottom: 8px; /* Reduced from 10px to 8px */
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-sizing: border-box; /* Include padding and border in the element's width and height */
}

/* Media queries for responsive layout */
@media (max-width: 768px) {
    .ask-anything-dialog {
        width: 95%;
        max-width: 95%;
        padding: 20px;
    }
    
    .ask-anything-dialog .title-bar h2 {
        font-size: 1.5rem;
    }
    
    .ask-anything-dialog .form-group textarea {
        min-height: 100px;
    }
    
    .ask-anything-results .learning-card {
        flex: 0 0 calc(50% - 4px); /* Adjusted to match the new 8px gap */
        max-width: calc(50% - 4px); /* Ensure cards don't grow beyond their allocated space */
    }
    
    .ask-anything-dialog .submit-btn {
        padding: 10px 15px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .ask-anything-dialog {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        border-radius: 0;
    }
    
    .ask-anything-dialog .title-bar {
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
    
    .ask-anything-dialog .title-bar h2 {
        font-size: 1.3rem;
    }
    
    .ask-anything-dialog .form-group label {
        font-size: 14px;
    }
    
    .ask-anything-dialog .form-group textarea {
        padding: 8px;
        font-size: 14px;
        min-height: 80px;
    }
    
    .ask-anything-dialog .submit-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .ask-anything-results .learning-card {
        flex: 0 0 100%; /* Full width on mobile */
        max-width: 100%;
    }
    
    .ask-anything-results .card-header {
        padding: 6px;
    }
    
    .ask-anything-results .card-body {
        padding: 6px;
    }
    
    .ask-anything-results .card-footer {
        padding: 6px;
    }
    
    .ask-anything-results .launch-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .ask-anything-results .back-btn {
        padding: 5px 10px;
        font-size: 12px;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .ask-anything-dialog .title-bar h2 {
        font-size: 1.2rem;
    }
    
    .ask-anything-dialog .submit-btn {
        width: 100%;
    }
}

.ask-anything-results .learning-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ask-anything-results .card-header {
    background-color: #9b59b6;
    color: white;
    padding: 8px; /* Further reduced from 10px to 8px */
}

.ask-anything-results .card-header h3 {
    margin: 0;
    font-size: 14px; /* Further reduced from 16px to 14px */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ask-anything-results .card-body {
    padding: 8px; /* Further reduced from 10px to 8px */
    color: white;
}

.ask-anything-results .card-description {
    color: #ddd;
    margin-bottom: 0; /* Removed bottom margin since we no longer have meta items */
    line-height: 1.2; /* Further reduced from 1.3 to 1.2 */
    font-size: 11px; /* Further reduced from 12px to 11px */
    /* Limit description to 3 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 40px; /* Reduced from 62px to 40px for more compact cards */
}

/* Hide meta items section */
.ask-anything-results .card-meta {
    display: none;
}

.ask-anything-results .meta-item {
    display: none;
}

.ask-anything-results .card-footer {
    padding: 6px 8px; /* Further reduced from 10px to 6px vertical, 8px horizontal */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.ask-anything-results .launch-btn {
    background-color: #9b59b6;
    color: white;
    border: none;
    padding: 6px 12px; /* Reduced from 10px 20px to 6px 12px */
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px; /* Reduced from 15px to 12px */
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.ask-anything-results .launch-btn:hover {
    background-color: #8e44ad;
}

/* Back button */
.ask-anything-results .back-btn {
    background-color: #7f8c8d;
    color: white;
    border: none;
    padding: 6px 12px; /* Reduced to match launch button */
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px; /* Reduced to match launch button */
    transition: background-color 0.3s;
    margin-top: 20px;
}

.ask-anything-results .back-btn:hover {
    background-color: #6c7a7d;
}
