/**
 * RTO LMS Connect - Frontend Styles
 */

/* Notice */
.rto-lms-notice {
    padding: 15px 20px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 0 6px 6px 0;
    color: #666;
}

/* Buttons */
.rto-lms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.rto-lms-btn-primary {
    background: #2563eb;
    color: #fff;
}

.rto-lms-btn-primary:hover {
    background: #1d4ed8;
    color: #fff;
}

.rto-lms-btn-secondary {
    background: transparent;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.rto-lms-btn-secondary:hover {
    background: #2563eb;
    color: #fff;
}

.rto-lms-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.rto-lms-btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

/* Course Cards */
.rto-lms-courses {
    display: grid;
    gap: 20px;
}

.rto-lms-grid {
    grid-template-columns: repeat(var(--columns, 3), 1fr);
}

.rto-lms-list {
    grid-template-columns: 1fr;
}

.rto-lms-course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.rto-lms-course-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.rto-lms-course-card .course-code {
    display: inline-block;
    padding: 4px 10px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 11px;
    font-weight: 600;
    font-family: ui-monospace, monospace;
    border-radius: 4px;
    margin-bottom: 10px;
    align-self: flex-start;
}

.course-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    /* Limit title length */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-description {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 12px;
    flex-grow: 1;
    /* Limit description */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.course-duration {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #6b7280;
}

.course-price {
    font-weight: 700;
    color: #059669;
    font-size: 14px;
}

/* Course Table Layout */
.rto-lms-courses-table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.rto-lms-courses-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 500px;
}

.rto-lms-courses-table thead {
    background: #1e3a5f;
    color: #fff;
}

.rto-lms-courses-table th {
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rto-lms-courses-table th:first-child {
    text-align: left;
}

.rto-lms-courses-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
    vertical-align: middle;
    text-align: center;
}

.rto-lms-courses-table td:first-child {
    text-align: left;
}

.rto-lms-courses-table tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

.rto-lms-courses-table tbody tr:nth-child(even) {
    background: #e9ecef;
}

.rto-lms-courses-table tbody tr:hover {
    background: #dee2e6;
}

.rto-lms-courses-table .course-code-cell {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.rto-lms-courses-table .course-name-cell {
    text-align: left;
}

.rto-lms-courses-table .course-name-cell strong {
    display: block;
    color: #111827;
    margin-bottom: 4px;
}

.rto-lms-courses-table .course-desc-snippet {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.rto-lms-courses-table .course-price-cell {
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}

.rto-lms-courses-table .course-duration-cell {
    white-space: nowrap;
}

.rto-lms-courses-table .course-action-cell {
    text-align: center;
    white-space: nowrap;
}

/* Instances Table */
.rto-lms-instances {
    margin: 20px 0;
}

.rto-lms-instances-title {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.rto-lms-instances-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rto-lms-instances-table thead {
    background: #1e3a5f;
    color: #fff;
}

.rto-lms-instances-table th {
    padding: 14px 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rto-lms-instances-table th:first-child {
    text-align: left;
}

.rto-lms-instances-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #374151;
    vertical-align: middle;
    text-align: center;
}

.rto-lms-instances-table td:first-child {
    text-align: left;
}

.rto-lms-instances-table tbody tr:nth-child(odd) {
    background: #f8f9fa;
}

.rto-lms-instances-table tbody tr:nth-child(even) {
    background: #e9ecef;
}

.rto-lms-instances-table tbody tr:hover {
    background: #dee2e6;
}

.rto-lms-instances-table .instance-name {
    font-weight: 500;
    color: #333;
    max-width: 300px;
}

.rto-lms-instances-table .instance-date {
    white-space: nowrap;
}

.rto-lms-instances-table .instance-time {
    white-space: nowrap;
}

.rto-lms-instances-table .instance-price {
    font-weight: 600;
    white-space: nowrap;
}

.rto-lms-instances-table .instance-action {
    text-align: center;
    white-space: nowrap;
}

/* Enrol Button - Styled as proper button */
.rto-lms-btn-enrol {
    display: inline-block;
    padding: 10px 20px;
    background: #6b8cae;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 100px;
}

.rto-lms-btn-enrol:hover {
    background: #5a7a9a;
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Spots Badge */
.spots-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.spots-available {
    background: #d1fae5;
    color: #065f46;
}

.spots-limited {
    background: #fef3c7;
    color: #92400e;
}

.spots-full {
    background: #fee2e2;
    color: #991b1b;
}

/* Course Details */
.rto-lms-course-details {
    max-width: 800px;
}

.rto-lms-course-details h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #111827;
}

.rto-lms-course-details > .course-code {
    margin-bottom: 30px;
}

.course-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e5e7eb;
}

.course-section:last-child {
    border-bottom: none;
}

.course-section h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #111827;
}

.course-overview {
    color: #4b5563;
    line-height: 1.7;
}

.course-section .course-price {
    font-size: 32px;
    font-weight: 700;
    color: #059669;
}

/* Responsive */
@media (max-width: 1024px) {
    .rto-lms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .rto-lms-grid {
        grid-template-columns: 1fr;
    }
    
    .rto-lms-workshops.rto-lms-grid {
        grid-template-columns: 1fr;
    }
    
    .rto-lms-instances-table {
        display: block;
        overflow-x: auto;
    }
    
    .rto-lms-instances-table th,
    .rto-lms-instances-table td {
        white-space: nowrap;
    }
    
    .rto-lms-course-card {
        padding: 16px;
    }
    
    .course-title {
        font-size: 15px;
    }
}

/* ===========================================
   Book Now Table (matches aXcelerate widget)
   =========================================== */
.rto-lms-book-now {
    margin: 30px 0;
}

.rto-lms-book-now-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.rto-lms-book-now-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.rto-lms-book-now-table thead {
    background: #e8ecef;
}

.rto-lms-book-now-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.rto-lms-book-now-table tbody tr {
    background: #f2f4f5;
    transition: background 0.2s;
}

.rto-lms-book-now-table tbody tr:nth-child(even) {
    background: #e8ecef;
}

.rto-lms-book-now-table tbody tr:hover {
    background: #dce1e5;
}

.rto-lms-book-now-table td {
    padding: 16px;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.rto-lms-book-now-table .workshop-name {
    font-weight: 500;
    color: #333;
    max-width: 300px;
}

.rto-lms-book-now-table .workshop-price {
    font-weight: 700;
    color: #333;
}

.rto-lms-book-now-table .workshop-action {
    text-align: center;
    width: 100px;
}

.rto-lms-btn-book {
    display: inline-block;
    padding: 8px 20px;
    background: #6b8cae;
    color: #fff !important;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.rto-lms-btn-book:hover {
    background: #5a7a9a;
    color: #fff !important;
}

/* ===========================================
   Workshops Grid/Cards
   =========================================== */
.rto-lms-workshops {
    display: grid;
    gap: 20px;
}

.rto-lms-workshops.rto-lms-grid {
    grid-template-columns: repeat(var(--columns, 3), 1fr);
}

.rto-lms-workshops.rto-lms-list {
    grid-template-columns: 1fr;
}

.rto-lms-workshop-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.rto-lms-workshop-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.workshop-date-badge {
    flex-shrink: 0;
    width: 60px;
    height: 70px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.workshop-date-badge .day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.workshop-date-badge .month {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
}

.workshop-content {
    flex: 1;
    min-width: 0;
}

.workshop-title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.workshop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.workshop-meta .meta-item {
    font-size: 13px;
    color: #6b7280;
}

.workshop-meta .meta-item.price {
    font-weight: 700;
    color: #059669;
}

.workshop-meta .meta-item.spots {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.workshop-meta .meta-item.spots.available {
    background: #d1fae5;
    color: #065f46;
}

.workshop-meta .meta-item.spots.limited {
    background: #fef3c7;
    color: #92400e;
}

.workshop-meta .meta-item.spots.full {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .rto-lms-workshops.rto-lms-grid {
        grid-template-columns: 1fr;
    }
    
    .rto-lms-workshop-card {
        flex-direction: column;
        text-align: center;
    }
    
    .workshop-meta {
        justify-content: center;
    }
    
    .rto-lms-book-now-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===========================================
   Enquiry Form
   =========================================== */
.rto-lms-enquiry-form {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.rto-lms-enquiry-title {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.rto-lms-enquiry-subtitle {
    margin: 0 0 20px;
    color: #6b7280;
    font-size: 14px;
}

.rto-lms-enquiry-course {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
}

.rto-lms-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rto-lms-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rto-lms-form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.rto-lms-form-field label .required {
    color: #dc2626;
}

.rto-lms-form-field input[type="text"],
.rto-lms-form-field input[type="email"],
.rto-lms-form-field input[type="tel"],
.rto-lms-form-field textarea {
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.rto-lms-form-field input:focus,
.rto-lms-form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.rto-lms-form-field textarea {
    resize: vertical;
    min-height: 100px;
}

.rto-lms-form-submit {
    margin-top: 10px;
}

.rto-lms-form-submit button {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.rto-lms-form-submit button:hover {
    background: #1d4ed8;
}

.rto-lms-form-submit button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.rto-lms-form-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.rto-lms-form-message .error {
    color: #dc2626;
}

.rto-lms-form-message .success {
    color: #059669;
}

.rto-lms-enquiry-success {
    text-align: center;
    padding: 40px 20px;
}

.rto-lms-enquiry-success .success-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: #d1fae5;
    color: #059669;
    font-size: 30px;
    line-height: 60px;
    border-radius: 50%;
}

.rto-lms-enquiry-success p {
    font-size: 18px;
    color: #374151;
    margin: 0;
}
