.aaba-schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

/* Service cards will reuse aaba-school-card styles */
.aaba-school-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #fff;
    transition: all 0.3s ease;
}

.aaba-school-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.aaba-school-logo {
    margin-bottom: 15px;
    text-align: center;
}

.aaba-school-logo img {
    max-height: 80px;
    max-width: 100%;
    height: auto;
}

.aaba-school-meta {
    margin: 15px 0;
    font-size: 0.9em;
}

.aaba-school-meta strong {
    display: inline-block;
    min-width: 120px;
}

.aaba-school-meta p:nth-last-child(1),
.aaba-school-meta p:nth-last-child(2) {
    background-color: #f8f9fa;
    padding: 5px;
    border-radius: 3px;
}

.aaba-deadline-countdown {
    color: #d63638;
    font-weight: bold;
}

.aaba-item-actions { /* Renamed from aaba-school-actions to be generic for schools & services */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aaba-school-link {
    display: block;
    text-align: center;
    padding: 8px;
    background: #2271b1;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.aaba-school-link:hover {
    background: #135e96;
}

/* Template Selector Styles */
.aaba-template-selector-wrap {
    margin-bottom: 5px;
    text-align: left;
}

.aaba-template-selector-wrap label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

.aaba-promo-template-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 0.9em;
    cursor: pointer;
}

.aaba-promo-template-select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
}


.aaba-generate-creative {
    padding: 8px;
    background: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.aaba-generate-creative:hover {
    background: #e0e0e0;
}

.aaba-creative-output {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

.aaba-creative-content {
    /* If you wrapped everything in this, you can add styles here */
}

.aaba-creative-textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.aaba-copy-creative {
    padding: 8px 15px;
    background: #28a745;
    color: white;
    border: 1px solid #218838;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

.aaba-copy-creative:hover {
    background: #218838;
}

.aaba-copy-creative.copied {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.aaba-no-schools, .aaba-no-services {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Styles for Promo Link Input */
.aaba-promo-link-input-wrap {
    margin-bottom: 10px;
    text-align: left;
}

.aaba-promo-link-input-wrap label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
}

.aaba-promo-link-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

.aaba-promo-link-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
}

/* Styles for Share Area and Buttons */
.aaba-share-area {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.aaba-share-label {
    font-weight: bold;
    font-size: 0.9em;
    color: #555;
    flex-shrink: 0;
}

.aaba-share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    flex-grow: 1;
}

.aaba-share-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.aaba-share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.aaba-share-button.whatsapp {
    background-color: #25D366;
}
.aaba-share-button.facebook {
    background-color: #1877F2;
}
.aaba-share-button.twitter { /* X */
    background-color: #000000;
}
.aaba-share-button.telegram {
    background-color: #0088CC;
}

/* Styles for Promotional Banners Section */
.aaba-promotional-banners {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

.aaba-promotional-banners h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #333;
    text-align: center;
}

.aaba-banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    justify-items: center;
}

.aaba-banner-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    padding: 5px;
    border-radius: 5px;
    background-color: #fcfcfc;
    text-align: center;
}

.aaba-banner-item img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
    margin-bottom: 5px;
}

.aaba-download-banner {
    display: block;
    padding: 5px 8px;
    background-color: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.85em;
    margin-top: auto;
}

.aaba-download-banner:hover {
    background-color: #005a87;
}

/* NEW: Frontend Filters Styles */
.aaba-schools-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background-color: #f0f0f1;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-end; /* Align buttons and inputs at the bottom */
}

.aaba-filter-item {
    display: flex;
    flex-direction: column;
    flex: 1; /* Allows items to grow and shrink */
    min-width: 150px; /* Minimum width for each filter item */
}

.aaba-filter-item label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
    font-size: 0.9em;
}

.aaba-filter-select,
.aaba-filter-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9em;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.aaba-filter-select:focus,
.aaba-filter-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
}

.aaba-filter-actions {
    display: flex;
    gap: 10px;
    min-width: 200px; /* Ensure buttons don't get too small */
}

.aaba-filter-actions .button {
    flex: 1; /* Make buttons take equal space */
    padding: 8px 15px;
    font-size: 0.9em;
    height: auto; /* Allow padding to define height */
    line-height: normal; /* Override default WordPress button line-height */
}

/* Loading state for the grid */
#aaba-schools-grid-container.aaba-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none; /* Disable interaction during loading */
}

#aaba-schools-grid-container.aaba-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media (max-width: 768px) {
    .aaba-schools-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .aaba-filter-item {
        min-width: unset; /* Remove min-width on small screens */
        width: 100%;
    }
    .aaba-filter-actions {
        width: 100%;
    }
}


@media (max-width: 600px) {
    .aaba-schools-grid {
        grid-template-columns: 1fr;
    }
    .aaba-share-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .aaba-share-label {
        width: 100%;
        text-align: center;
    }
    .aaba-share-buttons {
        width: 100%;
        justify-content: center;
    }
    .aaba-banner-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}