/* Frontend Styles for Modulix Manager */

/* Class Information Display */
.modulix-class-info {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.modulix-class-info h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.class-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item strong {
    color: #333;
    margin-bottom: 5px;
}

.info-item span {
    color: #666;
}

.availability.available {
    color: #28a745;
    font-weight: bold;
}

.availability.full {
    color: #dc3545;
    font-weight: bold;
}

.additional-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* Class List */
.modulix-class-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.class-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.class-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.class-image {
    position: relative;
    overflow: hidden;
}

.class-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.class-content {
    padding: 20px;
}

.class-title {
    margin: 0 0 10px 0;
}

.class-title a {
    color: #333;
    text-decoration: none;
}

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

.class-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.class-schedule {
    color: #666;
}

.class-price {
    font-weight: bold;
    color: #0073aa;
}

.class-availability {
    margin-bottom: 15px;
    font-size: 14px;
}

.class-availability .available {
    color: #28a745;
    font-weight: bold;
}

.class-availability .full {
    color: #dc3545;
    font-weight: bold;
}

.class-actions {
    text-align: center;
}

.class-actions .button {
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.class-actions .button:hover {
    background: #005a87;
    color: #fff;
}

/* Child Management */
.modulix-children-management {
    margin: 20px 0;
}

.children-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.children-header h3 {
    margin: 0;
}

.children-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.student-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}

.student-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.student-age {
    color: #666;
    margin-bottom: 10px;
}

.student-allergies {
    margin-bottom: 10px;
    font-size: 14px;
}

.student-allergies strong {
    color: #333;
}

.epipen-required {
    color: #dc3545;
    font-weight: bold;
}

.student-enrollments {
    margin-bottom: 15px;
    font-size: 14px;
}

.student-enrollments ul {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.student-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.student-actions .button {
    padding: 5px 15px;
    font-size: 12px;
}

.no-children {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Modal Styles */
.modulix-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h4 {
    margin: 0;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
}

/* Child Selection at Checkout */
.modulix-student-selection {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.modulix-student-selection h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.class-child-selection {
    margin-bottom: 15px;
}

.class-child-selection h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.class-child-selection select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.no-children-notice {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.no-children-notice .button {
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .class-info-grid {
        grid-template-columns: 1fr;
    }
    
    .modulix-class-list {
        grid-template-columns: 1fr;
    }
    
    .children-list {
        grid-template-columns: 1fr;
    }
    
    .children-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .class-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Loading States */
.modulix-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.modulix-loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styles */
.modulix-child-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.modulix-child-form .form-group {
    margin-bottom: 15px;
}

.modulix-child-form .form-group.half {
    flex: 1;
}

.modulix-child-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.modulix-child-form input,
.modulix-child-form textarea,
.modulix-child-form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modulix-child-form input:focus,
.modulix-child-form textarea:focus,
.modulix-child-form select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.modulix-child-form .required {
    color: #dc3545;
}

.modulix-child-form .form-actions {
    margin-top: 20px;
    text-align: right;
}

.modulix-child-form .form-actions button {
    margin-left: 10px;
}
