/**
 * WPSchoolManager Public/Frontend Styles
 * Modern, responsive design for public-facing components
 */

/* Global Public Styles */
.wpschoolmanager-public {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #374151;
}

.wpschoolmanager-public * {
    box-sizing: border-box;
}

/* Container */
.wpschoolmanager-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Cards */
.wpschoolmanager-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.1);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.wpschoolmanager-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.wpschoolmanager-card h3 {
    margin: 0 0 16px;
    color: #1f2937;
    font-size: 1.25em;
    font-weight: 600;
}

/* Student Portal */
.student-portal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

.portal-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.portal-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.portal-section i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.9;
}

.portal-section h4 {
    margin: 0 0 8px;
    font-size: 1.2em;
}

.portal-section p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95em;
}

/* Forms */
.wpschoolmanager-form {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 24px 0;
}

.wpschoolmanager-form h3 {
    margin: 0 0 24px;
    color: #1f2937;
    text-align: center;
    font-size: 1.5em;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
}

/* Buttons */
.wpschoolmanager-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wpschoolmanager-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.wpschoolmanager-btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Tables */
.wpschoolmanager-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 24px 0;
}

.wpschoolmanager-table table {
    width: 100%;
    border-collapse: collapse;
}

.wpschoolmanager-table th {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
}

.wpschoolmanager-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.wpschoolmanager-table tr:hover {
    background: #f9fafb;
}

.wpschoolmanager-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

/* Fee Payment Form */
.fee-payment-form {
    max-width: 600px;
    margin: 0 auto;
}

.fee-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid #4f46e5;
}

.fee-summary h4 {
    margin: 0 0 12px;
    color: #1f2937;
}

.fee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.fee-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1em;
    color: #4f46e5;
}

/* Library Search */
.library-search {
    max-width: 800px;
    margin: 0 auto;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
}

.search-results {
    display: grid;
    gap: 16px;
}

.book-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
}

.book-cover {
    width: 60px;
    height: 80px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.book-details h5 {
    margin: 0 0 4px;
    color: #1f2937;
    font-size: 1.1em;
}

.book-details .author {
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.book-details .availability {
    font-size: 0.85em;
    font-weight: 500;
}

.available {
    color: #059669;
}

.unavailable {
    color: #dc2626;
}

/* Events List */
.events-list {
    display: grid;
    gap: 20px;
}

.event-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #4f46e5;
}

.event-date {
    text-align: center;
    min-width: 80px;
}

.event-date .day {
    font-size: 1.8em;
    font-weight: 700;
    color: #4f46e5;
    line-height: 1;
}

.event-date .month {
    font-size: 0.9em;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-details h4 {
    margin: 0 0 8px;
    color: #1f2937;
}

.event-details .event-time {
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.event-details .event-description {
    color: #374151;
    font-size: 0.95em;
    line-height: 1.5;
}

/* Admission Form */
.admission-form {
    max-width: 800px;
    margin: 0 auto;
}

.admission-form .form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f3f4f6;
}

.admission-form .form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.admission-form .section-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4f46e5;
}

/* Loading Animation */
.wpschoolmanager-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success and Error Messages */
.wpschoolmanager-notice {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.notice-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.notice-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.no-data i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-data h4 {
    margin: 0 0 8px;
    color: #374151;
}

.no-data p {
    margin: 0;
    font-size: 0.95em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpschoolmanager-container {
        padding: 0 16px;
    }
    
    .student-portal {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .book-item {
        flex-direction: column;
        text-align: center;
    }
    
    .book-cover {
        align-self: center;
    }
    
    .event-item {
        flex-direction: column;
        text-align: center;
    }
    
    .event-date {
        align-self: center;
    }
    
    .wpschoolmanager-card {
        padding: 20px;
    }
    
    .wpschoolmanager-form {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .wpschoolmanager-card {
        padding: 16px;
    }
    
    .wpschoolmanager-form {
        padding: 20px;
    }
    
    .portal-section {
        padding: 20px;
    }
    
    .portal-section i {
        font-size: 36px;
    }
    
    .wpschoolmanager-table th,
    .wpschoolmanager-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wpschoolmanager-public {
        color: #e5e7eb;
    }
    
    .wpschoolmanager-card,
    .wpschoolmanager-form,
    .wpschoolmanager-table {
        background: #1f2937;
        border-color: #374151;
    }
    
    .wpschoolmanager-card h3 {
        color: #f9fafb;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .form-group label {
        color: #d1d5db;
    }
    
    .book-item,
    .event-item {
        background: #1f2937;
        border-color: #374151;
    }
}