/**
 * Matsh Course Scheduler - Frontend Styles
 */

/* ===== CSS Variables ===== */
:root {
    --matsh-primary: #00a8a8;
    --matsh-primary-dark: #008b8b;
    --matsh-secondary: #f5a623;
    --matsh-secondary-dark: #e09000;
    --matsh-text: #333333;
    --matsh-text-light: #666666;
    --matsh-text-muted: #999999;
    --matsh-bg-light: #f8f9fa;
    --matsh-bg-gray: #e9ecef;
    --matsh-border: #dee2e6;
    --matsh-white: #ffffff;
    --matsh-success: #28a745;
    --matsh-danger: #dc3545;
    --matsh-warning: #ffc107;
    --matsh-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --matsh-shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --matsh-radius: 8px;
    --matsh-radius-sm: 4px;
    --matsh-transition: all 0.3s ease;
}

/* ===== General Styles ===== */
.matsh-upcoming-schedules,
.matsh-courses-calendar,
.matsh-registration-page,
.matsh-course-search {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--matsh-text);
    line-height: 1.6;
}

/* ===== Buttons ===== */
.matsh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: var(--matsh-radius-sm);
    cursor: pointer;
    transition: var(--matsh-transition);
    gap: 8px;
}

.matsh-btn-primary {
    background: var(--matsh-primary);
    color: var(--matsh-white);
}

.matsh-btn-primary:hover {
    background: var(--matsh-primary-dark);
    color: var(--matsh-white);
    transform: translateY(-2px);
    box-shadow: var(--matsh-shadow);
}

.matsh-btn-secondary {
    background: var(--matsh-bg-gray);
    color: var(--matsh-text);
}

.matsh-btn-secondary:hover {
    background: var(--matsh-border);
}

.matsh-btn-outline {
    background: transparent;
    color: var(--matsh-primary);
    border: 2px solid var(--matsh-primary);
}

.matsh-btn-outline:hover {
    background: var(--matsh-primary);
    color: var(--matsh-white);
}

.matsh-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.matsh-btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.matsh-btn-block {
    width: 100%;
}

.matsh-btn-full {
    background: var(--matsh-text-muted);
    color: var(--matsh-white);
    cursor: not-allowed;
}

.matsh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Form Elements ===== */
.matsh-input,
.matsh-select,
.matsh-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid var(--matsh-border);
    border-radius: var(--matsh-radius-sm);
    background: var(--matsh-white);
    transition: var(--matsh-transition);
}

.matsh-input:focus,
.matsh-select:focus,
.matsh-textarea:focus {
    outline: none;
    border-color: var(--matsh-primary);
    box-shadow: 0 0 0 3px rgba(0, 168, 168, 0.1);
}

.matsh-textarea {
    resize: vertical;
    min-height: 100px;
}

.matsh-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--matsh-text-muted);
}

.matsh-required {
    color: var(--matsh-danger);
}

/* ===== Upcoming Schedules ===== */
.matsh-upcoming-schedules {
    margin: 40px 0;
    padding: 30px;
    background: var(--matsh-bg-light);
    border-radius: var(--matsh-radius);
}

.matsh-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 700;
    color: var(--matsh-text);
}

.matsh-section-title i {
    color: var(--matsh-primary);
}

.matsh-schedules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.matsh-schedule-card {
    background: var(--matsh-white);
    border-radius: var(--matsh-radius);
    box-shadow: var(--matsh-shadow);
    overflow: hidden;
    transition: var(--matsh-transition);
}

.matsh-schedule-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--matsh-shadow-hover);
}

.matsh-schedule-full {
    opacity: 0.7;
}

.matsh-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--matsh-primary) 0%, var(--matsh-primary-dark) 100%);
    color: var(--matsh-white);
}

.matsh-schedule-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.matsh-spots-warning {
    padding: 4px 10px;
    background: var(--matsh-warning);
    color: var(--matsh-text);
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.matsh-schedule-body {
    padding: 20px;
}

.matsh-course-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--matsh-text);
}

.matsh-schedule-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matsh-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.matsh-detail-label {
    font-size: 12px;
    color: var(--matsh-text-muted);
}

.matsh-detail-value {
    font-size: 14px;
    color: var(--matsh-text);
}

.matsh-detail-sub {
    font-size: 12px;
    color: var(--matsh-text-light);
}

.matsh-price-item {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--matsh-border);
}

.matsh-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--matsh-primary);
}

.matsh-schedule-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--matsh-border);
}

.matsh-schedule-footer .matsh-btn {
    width: 100%;
}

.matsh-search-more {
    margin-top: 24px;
    text-align: center;
}

.matsh-no-schedules {
    text-align: center;
    padding: 40px 20px;
}

.matsh-no-schedules-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.matsh-no-schedules h4 {
    margin-bottom: 8px;
    color: var(--matsh-text);
}

.matsh-no-schedules p {
    color: var(--matsh-text-light);
    margin-bottom: 20px;
}

/* ===== Courses Calendar ===== */
.matsh-courses-calendar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.matsh-calendar-header {
    text-align: center;
    margin-bottom: 40px;
}

.matsh-page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--matsh-text);
    margin-bottom: 8px;
}

.matsh-page-subtitle {
    font-size: 16px;
    color: var(--matsh-text-light);
}

.matsh-filter-section {
    background: var(--matsh-bg-light);
    padding: 24px;
    border-radius: var(--matsh-radius);
    margin-bottom: 24px;
}

.matsh-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.matsh-filter-row:last-child {
    margin-bottom: 0;
}

.matsh-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.matsh-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--matsh-text);
}

.matsh-filter-search {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
}

.matsh-filter-search .matsh-input {
    flex: 1;
}

.matsh-results-info {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--matsh-text-light);
}

.matsh-schedules-table-wrapper {
    background: var(--matsh-white);
    border-radius: var(--matsh-radius);
    box-shadow: var(--matsh-shadow);
    overflow: hidden;
}

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

.matsh-schedules-table th {
    padding: 16px;
    background: var(--matsh-primary);
    color: var(--matsh-white);
    font-weight: 600;
    text-align: left;
    font-size: 14px;
}

.matsh-schedules-table td {
    padding: 16px;
    border-bottom: 1px solid var(--matsh-border);
    font-size: 14px;
}

.matsh-schedules-table tr:hover {
    background: var(--matsh-bg-light);
}

.matsh-col-date {
    white-space: nowrap;
}

.matsh-date-main {
    font-weight: 600;
    color: var(--matsh-text);
}

.matsh-date-end {
    font-size: 12px;
    color: var(--matsh-text-muted);
}

.matsh-course-link {
    color: var(--matsh-primary);
    font-weight: 600;
    text-decoration: none;
}

.matsh-course-link:hover {
    text-decoration: underline;
}

.matsh-venue-main {
    font-weight: 500;
}

.matsh-venue-sub {
    font-size: 12px;
    color: var(--matsh-text-muted);
}

.matsh-price {
    font-weight: 700;
    color: var(--matsh-primary);
}

.matsh-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.matsh-badge-full {
    background: var(--matsh-text-muted);
    color: var(--matsh-white);
}

.matsh-spots-tag {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--matsh-danger);
}

.matsh-no-results {
    text-align: center;
    padding: 40px;
    color: var(--matsh-text-muted);
}

.matsh-load-more {
    text-align: center;
    margin-top: 24px;
}

/* ===== Registration Form ===== */
.matsh-registration-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.matsh-registration-header {
    text-align: center;
    margin-bottom: 40px;
}

.matsh-registration-wrapper {
    display: grid;
    gap: 30px;
}

.matsh-course-summary {
    margin-bottom: 20px;
}

.matsh-summary-card {
    background: linear-gradient(135deg, var(--matsh-primary) 0%, var(--matsh-primary-dark) 100%);
    color: var(--matsh-white);
    padding: 24px;
    border-radius: var(--matsh-radius);
}

.matsh-summary-card h4 {
    margin: 0 0 16px;
    font-size: 18px;
}

.matsh-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.matsh-summary-item:last-child {
    border-bottom: none;
}

.matsh-summary-label {
    opacity: 0.9;
}

.matsh-summary-value {
    font-weight: 600;
}

.matsh-summary-price {
    font-size: 18px;
}

.matsh-form {
    background: var(--matsh-white);
    padding: 30px;
    border-radius: var(--matsh-radius);
    box-shadow: var(--matsh-shadow);
}

.matsh-form-section {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--matsh-border);
}

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

.matsh-form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--matsh-text);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--matsh-primary);
}

.matsh-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.matsh-form-row:last-child {
    margin-bottom: 0;
}

.matsh-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.matsh-form-group-full {
    grid-column: 1 / -1;
}

.matsh-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--matsh-text);
}

.matsh-schedule-preview {
    margin-top: 16px;
    padding: 16px;
    background: var(--matsh-bg-light);
    border-radius: var(--matsh-radius);
    border-left: 4px solid var(--matsh-primary);
}

.matsh-form-terms {
    margin-bottom: 20px;
}

.matsh-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
}

.matsh-checkbox-label input {
    margin-top: 3px;
}

.matsh-form-submit {
    text-align: center;
}

.matsh-form-message {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--matsh-radius);
}

.matsh-form-message.success {
    background: #d4edda;
    color: #155724;
}

.matsh-form-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ===== Course Search Widget ===== */
.matsh-course-search {
    background: var(--matsh-bg-light);
    padding: 24px;
    border-radius: var(--matsh-radius);
}

.matsh-search-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--matsh-text);
}

.matsh-search-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Modal ===== */
.matsh-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.matsh-modal-content {
    background: var(--matsh-white);
    padding: 32px;
    border-radius: var(--matsh-radius);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.matsh-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--matsh-text-muted);
}

.matsh-modal-close:hover {
    color: var(--matsh-text);
}

.matsh-success-modal .matsh-modal-content {
    text-align: center;
}

.matsh-success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: var(--matsh-success);
    color: var(--matsh-white);
    font-size: 32px;
    line-height: 60px;
    border-radius: 50%;
}

.matsh-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .matsh-schedules-grid {
        grid-template-columns: 1fr;
    }
    
    .matsh-filter-row {
        grid-template-columns: 1fr;
    }
    
    .matsh-filter-search {
        flex-direction: column;
    }
    
    .matsh-schedules-table {
        font-size: 12px;
    }
    
    .matsh-schedules-table th,
    .matsh-schedules-table td {
        padding: 10px;
    }
    
    .matsh-form-row {
        grid-template-columns: 1fr;
    }
    
    .matsh-page-title {
        font-size: 28px;
    }
    
    .matsh-modal-actions {
        flex-direction: column;
    }
}

/* ===== Animation ===== */
@keyframes matsh-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.matsh-schedule-card {
    animation: matsh-fade-in 0.3s ease;
}
