/* General Wrapper */
.gqg-quiz-explorer-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Search Form Styling */
.gqg-search-form-container {
    margin-bottom: 30px;
/*    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%); /* Brighter background */
    background: #e3f2fd;
	padding: 25px 30px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(34, 113, 177, 0.15); /* More prominent shadow */
    border-left: 5px solid #f0b849; /* Emphasize search form */
    transition: all 0.3s ease; /* Smooth transition for hover effects */
}

.gqg-search-form-container:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 12px 25px rgba(34, 113, 177, 0.25); /* Enhanced shadow on hover */
}

.gqg-search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.gqg-search-input {
    flex-grow: 1;
    padding: 15px 20px; /* Larger padding */
    border: 2px solid #e2e8f0;
    border-radius: 10px; /* More rounded */
    font-size: 18px; /* Larger font */
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1), inset 0 10px 30px rgba(0,0,0,0.05); /* Subtle inner shadow + raised effect */
}

.gqg-search-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.15); /* Larger focus shadow */
}

.gqg-search-button {
    padding: 15px 30px; /* Larger padding */
    background: linear-gradient(135deg, #2271b1 0%, #1e5a8e 100%); /* Gradient background */
    color: #fff;
    border: none;
    border-radius: 10px; /* More rounded */
    font-size: 18px; /* Larger font */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(34, 113, 177, 0.2); /* Button shadow */
}

.gqg-search-button:hover {
    background: linear-gradient(135deg, #1e5a8e 0%, #135079 100%);
    transform: translateY(-2px); /* Lift effect */
    box-shadow: 0 6px 18px rgba(34, 113, 177, 0.35); /* Larger shadow on hover */
}

/* Navigation Group Styling */
.gqg-nav-group-frontend {
    background: #e3f2fd;
    border: 1px solid #e5e5e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 10px;
}

.gqg-group-title {
    font-size: 18px;
    font-weight: 500;
    color: #1a202c;
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

/* Display Type: Cards */
.gqg-display-cards .gqg-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gqg-display-cards .gqg-nav-item-frontend {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Smaller padding */
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    background: #ffffff; /* White background */
    text-align: center;
    border-left: 5px solid; /* For dynamic colors */
}

/* Dynamic colors for card items */
.gqg-display-cards .gqg-nav-item-frontend:nth-child(4n+1) { border-left-color: #2271b1; } /* Blue */
.gqg-display-cards .gqg-nav-item-frontend:nth-child(4n+2) { border-left-color: #28a745; } /* Green */
.gqg-display-cards .gqg-nav-item-frontend:nth-child(4n+3) { border-left-color: #f0b849; } /* Orange */
.gqg-display-cards .gqg-nav-item-frontend:nth-child(4n+4) { border-left-color: #8c8f94; } /* Gray */


.gqg-display-cards .gqg-nav-item-frontend:hover {
    border-color: #2271b1;
    box-shadow: 0 6px 20px rgba(34, 113, 177, 0.15);
    transform: translateY(-4px);
    background: #e6f7ff; /* Brighter light blue on hover */
}

.gqg-display-cards .gqg-nav-item-frontend .dashicons {
    font-size: 16px; /* Smaller font size */
    width: 36px;
    height: 36px;
    color: #2271b1;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.gqg-display-cards .gqg-nav-item-frontend:hover .dashicons {
    color: #135079;
}

.gqg-display-cards .gqg-item-label {
    font-size: 16px; /* Smaller font size */
    font-weight: 600;
    line-height: 1.3;
}

/* Display Type: List (3-column layout) */
.gqg-display-list .gqg-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 3 columns, responsive */
    gap: 15px; /* Adjusted gap */
    list-style: none;
    margin: 0;
    padding: 0;
}

.gqg-display-list .gqg-nav-item-frontend {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background: #ffffff; /* White background */
    transition: all 0.3s ease;
    border-left: 5px solid; /* For dynamic colors */
}

/* Dynamic colors for list items */
.gqg-display-list .gqg-nav-item-frontend:nth-child(4n+1) { border-left-color: #2271b1; } /* Blue */
.gqg-display-list .gqg-nav-item-frontend:nth-child(4n+2) { border-left-color: #28a745; } /* Green */
.gqg-display-list .gqg-nav-item-frontend:nth-child(4n+3) { border-left-color: #f0b849; } /* Orange */
.gqg-display-list .gqg-nav-item-frontend:nth-child(4n+4) { border-left-color: #8c8f94; } /* Gray */


.gqg-display-list .gqg-nav-item-frontend:hover {
    background: #e6f7ff; /* Brighter light blue on hover */
    border-color: #a7d1f7;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.gqg-display-list .gqg-nav-item-frontend .dashicons {
    font-size: 18px;
    width: 24px;
    height: 24px;
    color: #0073aa;
    margin-right: 10px;
    flex-shrink: 0;
}

.gqg-display-list .gqg-item-label {
    font-size: 16px;
    font-weight: 500;
    flex-grow: 1;
}

/* Empty State */
.gqg-quiz-explorer-empty {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 40px auto;
    max-width: 800px;
    border-radius: 8px;
    color: #856404;
    font-size: 16px;
    text-align: center;
}

.gqg-quiz-explorer-empty a {
    color: #0073aa;
    text-decoration: underline;
}

/* NEW: Latest Posts Groups Container */
.gqg-latest-posts-groups-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Enforce 2-column layout for groups */
    gap: 30px; /* Gap between groups */
    margin-top: 30px;
}

/* Specific styling for individual latest posts group within the container */
.gqg-latest-posts-groups-container .gqg-latest-posts-section {
    margin-bottom: 0; /* Remove individual margin as container handles spacing */
    border-left: 5px solid #28a745; /* Green border for latest posts */
}

.gqg-latest-posts-groups-container .gqg-latest-posts-section .gqg-group-title {
    color: #065f46; /* Darker green title */
}

/* Enforce 2-column layout for latest posts grid on desktop */
.gqg-latest-posts-groups-container .gqg-latest-posts-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 15px; /* Adjusted gap for 2 columns */
}

.gqg-latest-post-item {
    border-color: #d1fae5; /* Lighter green border for individual items */
    align-items: flex-start; /* Align items to start for image + text */
    padding: 10px; /* Adjusted padding for smaller items */
    background: #f0fdf4; /* Light green background */
}

.gqg-latest-post-item:hover {
    border-color: #28a745; /* Darker green on hover */
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
    background: #e6faed; /* Slightly darker green on hover */
}

.gqg-latest-post-item .dashicons {
    color: #28a745; /* Green icon */
    margin-right: 10px; /* Adjust margin */
    margin-top: 5px; /* Align with text */
}

/* Styling for post thumbnails in latest posts */
.gqg-latest-post-thumbnail {
    width: 60px; /* Smaller fixed width */
    height: 60px; /* Smaller fixed height */
    object-fit: cover; /* Cover the area */
    border-radius: 8px; /* Rounded corners */
    margin-right: 10px; /* Space between image and text */
    flex-shrink: 0; /* Prevent image from shrinking */
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.gqg-latest-post-item .gqg-item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gqg-latest-post-item .gqg-item-label {
    font-size: 14px; /* Smaller title font size */
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 3px; /* Adjusted margin */
}

.gqg-latest-post-item .gqg-item-date {
    font-size: 12px; /* Smaller date font size */
    color: #718096;
}

/* NEW: Styles for custom image/icon in navigation items */
.gqg-nav-item-image {
    max-width: 40px; /* Adjust size as needed */
    max-height: 40px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 5px;
}

.gqg-display-list .gqg-nav-item-image {
    margin-right: 15px;
    margin-bottom: 0;
}

/* NEW: Child category indicator */
.gqg-child-indicator {
    margin-left: auto; /* Push to the right */
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* NEW: Modal styles (re-using existing modal classes from admin-style.css or teacher-dashboard.css) */
/* Ensure these are defined or copied from existing modal styles if not globally available */
.gqg-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gqg-modal-overlay[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.gqg-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 80vh; /* Limit height */
    overflow-y: auto; /* Enable scrolling */
}

.gqg-modal-overlay[style*="display: flex"] .gqg-modal-content {
    transform: translateY(0);
}

.gqg-modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    color: #23282d;
}

.gqg-modal-content p {
    margin-bottom: 15px;
    color: #555;
}

.gqg-modal-actions {
    margin-top: 25px;
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.gqg-modal-actions .button {
    padding: 10px 20px;
    font-size: 14px;
}

.gqg-navigation-list { /* Re-using existing list style for modal content */
    list-style: none;
    margin: 0;
    padding: 0;
}

.gqg-navigation-list li {
    margin-bottom: 10px;
}

.gqg-navigation-list li a {
    display: block;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #2271b1;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.gqg-navigation-list li a:hover {
    background: #e3f2fd;
    color: #135079;
    border-color: #2271b1;
    transform: translateX(5px);
}

.gqg-error-message {
    color: #dc3545;
    font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .gqg-quiz-explorer-wrapper {
        margin: 20px auto;
        padding: 0 15px;
    }

    .gqg-search-form-container {
        padding: 20px;
    }

    .gqg-search-form {
        flex-direction: column;
    }

    .gqg-search-input,
    .gqg-search-button {
        width: 100%;
        font-size: 16px;
        padding: 12px 15px;
    }

    .gqg-nav-group-frontend {
        padding: 20px;
    }

    .gqg-group-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .gqg-display-cards .gqg-group-items {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .gqg-display-cards .gqg-nav-item-frontend {
        padding: 20px;
    }

    .gqg-display-cards .gqg-nav-item-frontend .dashicons {
        font-size: 36px;
        width: 36px;
        height: 36px;
        margin-bottom: 10px;
    }

    .gqg-display-cards .gqg-item-label {
        font-size: 16px;
    }

    .gqg-display-list .gqg-group-items {
        grid-template-columns: 1fr; /* Stack items on small screens */
        gap: 10px;
    }

    .gqg-latest-posts-groups-container {
        grid-template-columns: 1fr; /* Stack groups on smaller screens */
    }

    .gqg-latest-posts-groups-container .gqg-latest-posts-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }

    .gqg-display-list .gqg-nav-item-frontend {
        padding: 12px 15px;
    }

    .gqg-display-list .gqg-nav-item-frontend .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
        margin-right: 10px;
    }

    .gqg-latest-post-item .gqg-latest-post-thumbnail {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }

    .gqg-latest-post-item .gqg-item-content {
        flex-grow: 1; /* Allow content to take available space */
    }

    .gqg-latest-post-item .gqg-item-label {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .gqg-display-cards .gqg-group-items {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
    }
    .gqg-modal-content {
        padding: 20px;
        width: 95%;
    }
    .gqg-modal-content h2 {
        font-size: 20px;
    }
    .gqg-modal-actions {
        flex-direction: column;
        gap: 8px;
    }
    .gqg-modal-actions .button {
        width: 100%;
    }
}