/**
 * Component Styles — BEM naming convention.
 * Converted from: React Tailwind utilities to vanilla CSS.
 *
 * @package Muzamna_LMS
 */

/* ==========================================================================
   Site Header
   Converted from: src/components/MainHeader.tsx
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--color-border);
    background: hsla(0, 0%, 100%, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dark .site-header {
    background: hsla(260, 18%, 14%, 0.8);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.site-header__logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
    background: hsla(285, 40%, 35%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.site-header__logo-text {
    display: none;
}

@media (min-width: 640px) {
    .site-header__logo-text {
        display: block;
    }
}

.site-header__title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-foreground);
    line-height: 1.2;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .site-header__nav {
        gap: 0.5rem;
    }
}

.site-header__nav-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-muted-foreground);
    text-decoration: none;
    transition: all var(--transition-fast);
}

@media (min-width: 768px) {
    .site-header__nav-item {
        padding: 0.5rem 1rem;
    }
}

.site-header__nav-item:hover {
    color: var(--color-foreground);
    background: var(--color-secondary);
}

.site-header__nav-item--active {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: 0 4px 6px -1px hsla(285, 40%, 35%, 0.2);
}

.site-header__nav-item--active:hover {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
}

.site-header__nav-item--destructive {
    color: var(--color-destructive);
}

.site-header__nav-item--destructive:hover {
    background: hsla(0, 84%, 60%, 0.1);
    color: var(--color-destructive);
}

.site-header__nav-label {
    display: none;
}

@media (min-width: 768px) {
    .site-header__nav-label {
        display: inline;
    }
}

/* ==========================================================================
   Theme Toggle
   ========================================================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-xl);
    color: var(--color-muted-foreground);
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--color-foreground);
    background: var(--color-secondary);
}

.theme-toggle__icon--moon {
    display: none;
}

.dark .theme-toggle__icon--sun {
    display: none;
}

.dark .theme-toggle__icon--moon {
    display: flex;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--color-border);
    background: hsla(0, 0%, 100%, 0.5);
}

.dark .site-footer {
    background: hsla(260, 18%, 14%, 0.5);
}

.site-footer__inner {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.site-footer__row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .site-footer__row {
        flex-direction: row;
    }
}

.site-footer__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer__logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-xl);
    background: hsla(285, 40%, 35%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.site-footer__title {
    font-weight: 700;
    color: var(--color-foreground);
}

.site-footer__copy {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-2xl);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.5;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-primary-foreground);
    box-shadow: 0 4px 6px -1px hsla(285, 40%, 35%, 0.2);
}

.btn--primary:hover {
    opacity: 0.9;
}

.btn--accent {
    background: var(--color-accent);
    color: var(--color-accent-foreground);
    box-shadow: 0 4px 6px -1px hsla(320, 60%, 55%, 0.2);
}

.btn--accent:hover {
    opacity: 0.9;
}

.btn--secondary {
    background: var(--color-secondary);
    color: var(--color-secondary-foreground);
}

.btn--secondary:hover {
    background: hsla(210, 20%, 97%, 0.8);
}

.btn--ghost {
    background: transparent;
    color: var(--color-foreground);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-secondary);
}

.btn--glass {
    background: hsla(0, 0%, 100%, 0.1);
    border: 1px solid hsla(0, 0%, 100%, 0.2);
    backdrop-filter: blur(12px);
    color: var(--color-primary-foreground);
}

.btn--glass:hover {
    background: hsla(0, 0%, 100%, 0.15);
}

.btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-xl);
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn--full {
    width: 100%;
}

.btn--disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading spinner inside button */
.btn__spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid hsla(0, 0%, 100%, 0.3);
    border-top-color: var(--color-primary-foreground);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.5;
}

.badge--emerald {
    background: hsla(142, 76%, 36%, 0.9);
    color: #fff;
}

.badge--amber {
    background: hsla(38, 92%, 50%, 0.9);
    color: #fff;
}

.badge--rose {
    background: hsla(350, 89%, 60%, 0.9);
    color: #fff;
}

.badge--blue {
    background: hsla(217, 91%, 60%, 0.1);
    color: hsl(217, 91%, 45%);
}

.dark .badge--blue {
    background: hsla(217, 91%, 60%, 0.15);
    color: hsl(217, 91%, 65%);
}

.badge--default {
    background: var(--color-secondary);
    color: var(--color-secondary-foreground);
}

.badge--primary {
    background: hsla(285, 40%, 35%, 0.1);
    color: var(--color-primary);
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    border-color: hsla(285, 40%, 35%, 0.2);
}

.card--clickable {
    cursor: pointer;
}

.card--clickable:hover {
    transform: translateY(-4px);
}

.card__thumbnail {
    position: relative;
    height: 12rem;
    overflow: hidden;
}

.card__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card--clickable:hover .card__thumbnail img {
    transform: scale(1.05);
}

.card__body {
    padding: 1.25rem;
}

.card__category {
    display: block;
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    margin-bottom: 0.5rem;
}

.card__title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.card--clickable:hover .card__title,
.card__title a:hover {
    color: var(--color-primary);
}

.card__description {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    margin-bottom: 1rem;
}

.card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.card__price {
    font-weight: 700;
    color: var(--color-foreground);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card__price .icon {
    color: var(--color-accent);
}

/* ==========================================================================
   Meta Item
   ========================================================================== */

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ==========================================================================
   Star Rating
   ========================================================================== */

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}

.star-rating__star {
    color: var(--color-border);
}

.star-rating__star--filled {
    color: hsl(43, 96%, 56%);
    fill: hsl(43, 96%, 56%);
}

.star-rating__value {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-foreground);
    margin-inline-start: 0.25rem;
}

.star-rating__count {
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.form-field {
    margin-bottom: 1.25rem;
}

.form-field__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 0.5rem;
}

.form-field__label .icon {
    color: var(--color-muted-foreground);
}

.form-field__input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    background: var(--color-background);
    border: 1px solid var(--color-border);
    color: var(--color-foreground);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.form-field__input::placeholder {
    color: var(--color-muted-foreground);
}

.form-field__input:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsla(285, 40%, 35%, 0.5);
}

.form-field__input:disabled {
    background: var(--color-muted);
    color: var(--color-muted-foreground);
    cursor: not-allowed;
}

.form-field__hint {
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    margin-top: 0.25rem;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    border-bottom: 1px solid var(--color-border);
    background: hsla(0, 0%, 100%, 0.5);
}

.dark .breadcrumbs {
    background: hsla(260, 18%, 14%, 0.5);
}

.breadcrumbs__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
}

.breadcrumbs__link {
    color: var(--color-muted-foreground);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumbs__link:hover {
    color: var(--color-foreground);
}

.breadcrumbs__separator {
    color: var(--color-border);
}

.breadcrumbs__current {
    color: var(--color-foreground);
    font-weight: 700;
}

/* ==========================================================================
   Icon Utility
   ========================================================================== */

.icon {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
