/* CP School Plugin Styles v1.3 */

/* Documents Grid */
.cps-documents-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
    font-family: Arial, sans-serif;
}
@media (min-width: 1024px) {
    .cps-documents-grid { grid-template-columns: repeat(4, 1fr); }
}

.cps-document-card {
    background: #f1f8fe;
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cps-document-title { color: #116089; font-size: 18px; margin: 15px 0; font-weight: 600; }
.cps-document-meta { font-size: 14px; color: #555; margin-bottom: 20px; }
.cps-download-link { 
    color: #116089; 
    text-decoration: none; 
    font-weight: bold; 
    border-bottom: 2px solid #116089; 
    padding-bottom: 2px;
}

/* Calendar Styles */
.cps-calendar-wrapper { margin: 40px 0; }
.cps-calendar-controls { text-align: center; margin-bottom: 25px; }
@media (min-width: 1024px) {
    .cps-calendar-controls { display: none !important; } /* Hide dropdown on desktop */
}
.cps-calendar-controls select {
    padding: 10px 20px;
    border: 2px solid #116089;
    border-radius: 8px;
    color: #116089;
    font-weight: bold;
}

.cps-calendar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 1024px) {
    .cps-calendar-grid { grid-template-columns: repeat(3, 1fr); } /* 3 in a row on desktop */
}

.cps-month-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.cps-month-header {
    background: #116089;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cps-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 4px;
}
.cps-label { font-weight: bold; font-size: 12px; color: #777; margin-bottom: 10px; }
.cps-days-grid .day {
    padding: 8px 0;
    font-size: 13px;
    border-radius: 4px;
}
.cps-days-grid .empty { background: transparent; }

.cps-event-list {
    margin-top: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}
.cps-event-list .event {
    font-size: 13px;
    margin-bottom: 10px;
}
/* Grade Filter Buttons */
.cps-grade-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.cps-grade-btn {
    text-decoration: none;
    padding: 12px 30px;
    border: 1px solid #116089;
    border-radius: 8px;
    color: #116089;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    background: #eef8ff; /* Light blue background for inactive */
    display: inline-block;
}
.cps-grade-btn:hover {
    background: #ddeadb;
    border-color: #0d4d6e;
}
.cps-grade-btn.is-active {
    background: #116089; /* Solid blue for active */
    color: #fff;
    border-color: #116089;
}

/* Responsive Grid for Calendar */
@media (max-width: 1024px) {
    .cps-grade-filter { gap: 10px; }
    .cps-grade-btn { padding: 8px 15px; font-size: 14px; }
}

/* Gallery Styles */
.cps-gallery-container {
    margin: 40px 0;
    font-family: inherit;
}
.cps-gallery-search {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}
.cps-gallery-search-inner {
    position: relative;
    width: 100%;
    max-width: 450px;
    min-width: 300px;
}
.cps-gallery-search-inner input,
.cps-gallery-search-inner input[type="text"] {
    width: 100%;
    padding: 10px 15px !important;
    padding-right: 40px !important;
    border: 1px solid #c7d8e2; /* Softer light blue/gray border */
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;
    color: #4a4a4a;
}
.cps-gallery-search-inner input::placeholder {
    color: #4a4a4a; /* Darker placeholder to match image */
}
.cps-gallery-search-inner .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #555;
    pointer-events: none;
}
.cps-gallery-title {
    text-align: center;
    font-size: 26px;
    font-weight: bold;
    color: #4a4a4a;
    margin-bottom: 20px;
}
.cps-gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.cps-gallery-filter-btn {
    padding: 6px 24px;
    border: 1px solid #7a9eb3; /* Lighter borders like in screenshot */
    background: #fff;
    color: #4f5a63; /* Match screenshot font color */
    border-radius: 20px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}
.cps-gallery-filter-btn:hover {
    background: #f4f8fb;
    border-color: #4a7c9d;
}
.cps-gallery-filter-btn.active {
    background: #116089;
    color: #fff;
    border-color: #116089;
}
.cps-gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 768px) {
    .cps-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .cps-gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
.cps-gallery-item {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: block; 
    min-width: 0;
}
.cps-gallery-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    background: #f5f5f5;
}
.cps-gallery-img-wrapper img, .cps-gallery-no-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cps-gallery-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}
.cps-gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    padding: 20px 15px 15px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cps-gallery-item:hover .cps-gallery-item-overlay {
    opacity: 1;
}
.cps-gallery-item-title {
    font-weight: bold;
    font-size: 16px;
    display: block;
}
