/* =========================================================
   HSE Moodle Connector — Frontend Styles
   ========================================================= */

/* Notices */
.hse-mc-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 16px 0;
    font-size: 14px;
}
.hse-mc-notice--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}
.hse-mc-notice--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}
.hse-mc-notice--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Courses Grid */
.hse-mc-courses__grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .hse-mc-courses__grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hse-mc-courses__grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Course Card */
.hse-mc-course-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.hse-mc-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.hse-mc-course-card__image {
    height: 180px;
    overflow: hidden;
    background: #f3f4f6;
}

.hse-mc-course-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hse-mc-course-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hse-mc-course-card__placeholder-icon {
    font-size: 48px;
}

.hse-mc-course-card__content {
    padding: 16px;
    flex: 1;
}

.hse-mc-course-card__title {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.hse-mc-course-card__title a {
    color: #1f2937;
    text-decoration: none;
}

.hse-mc-course-card__title a:hover {
    color: #4f46e5;
}

.hse-mc-course-card__shortname {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.hse-mc-course-card__summary {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 8px 0;
}

.hse-mc-course-card__meta {
    margin-top: 8px;
    font-size: 13px;
    color: #9ca3af;
}

.hse-mc-course-card__actions {
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.hse-mc-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.hse-mc-btn--small {
    padding: 6px 12px;
    font-size: 13px;
}

.hse-mc-btn--primary,
.hse-mc-btn--enrol {
    background: #4f46e5;
    color: #ffffff;
}

.hse-mc-btn--primary:hover,
.hse-mc-btn--enrol:hover {
    background: #4338ca;
    color: #ffffff;
}

.hse-mc-btn--view {
    background: #f3f4f6;
    color: #374151;
}

.hse-mc-btn--view:hover {
    background: #e5e7eb;
    color: #111827;
}

.hse-mc-btn--login {
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
}

.hse-mc-btn--login:hover {
    background: #fde68a;
}

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

.hse-mc-btn--loading {
    pointer-events: none;
    position: relative;
}

.hse-mc-btn--success {
    background: #10b981 !important;
    color: #ffffff !important;
}

/* List Style */
.hse-mc-courses__list {
    margin: 24px 0;
}

.hse-mc-course-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #ffffff;
    transition: background 0.2s;
}

.hse-mc-course-list-item:hover {
    background: #f9fafb;
}

.hse-mc-course-list-item__info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.hse-mc-course-list-item__info h3 small {
    color: #9ca3af;
    font-weight: 400;
}

.hse-mc-course-list-item__info p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.hse-mc-course-list-item__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Compact List */
.hse-mc-courses__compact {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.hse-mc-courses__compact li {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.hse-mc-courses__compact li:last-child {
    border-bottom: none;
}

.hse-mc-courses__compact a {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
}

.hse-mc-courses__compact a:hover {
    text-decoration: underline;
}

/* Progress Bar */
.hse-mc-progress {
    background: #e5e7eb;
    border-radius: 999px;
    height: 20px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.hse-mc-progress__bar {
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.hse-mc-progress__text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

/* Registration Form */
.hse-mc-registration,
.hse-mc-enrollment {
    max-width: 700px;
    margin: 24px auto;
}

.hse-mc-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .hse-mc-form__row {
        grid-template-columns: 1fr;
    }
}

.hse-mc-form__field {
    margin-bottom: 16px;
}

.hse-mc-form__field label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #374151;
    font-size: 14px;
}

.hse-mc-form__field input,
.hse-mc-form__field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

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

.hse-mc-form__submit {
    margin-top: 24px;
}

.hse-mc-form__submit .hse-mc-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.hse-mc-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.hse-mc-message--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.hse-mc-message--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Categories */
.hse-mc-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.hse-mc-category-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.2s;
}

.hse-mc-category-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hse-mc-category-card h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #1f2937;
}

.hse-mc-category-card p {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 12px 0;
}

.hse-mc-category-card__count {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

/* My Courses */
.hse-mc-course-card--enrolled {
    border-left: 4px solid #10b981;
}

