/**
 * Study Skills Integration - Enhanced CSS
 * Modern, intuitive styling for Study Skills recommendations
 * 
 * @version 1.0.0
 * @date 2026-02-17
 */

/* Study Skills Card */
.study-skills-card {
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.study-skills-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Sidebar Card - Enhanced */
.study-skills-sidebar-card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

/* Study Skills Header */
.study-skills-header {
    background: #ffffff;
    color: #1e293b;
    padding: 1rem;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.study-skills-header h6 {
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    color: #1e293b !important; /* Force dark color in header */
}

.study-skills-header small {
    font-size: 0.75rem;
    opacity: 0.95;
    color: #64748b; /* Force muted color for subtitle */
}

/* Gradient Header (legacy support) */
.bg-gradient-purple {
    background: linear-gradient(135deg, #12807C 0%, #4DB6AC 100%);
}

/* Study Skills Intro */
.study-skills-intro {
    background: linear-gradient(to bottom, #E0F2F1, #ffffff);
    border-bottom: 1px solid #E0F2F1;
}

.study-skills-intro small {
    line-height: 1.5;
    display: block;
}

.study-skills-intro .la-lightbulb {
    font-size: 0.9rem;
}

/* List Items */
.study-skills-card .list-group-item {
    border: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.study-skills-card .list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.study-skills-card .list-group-item:hover .la-arrow-right {
    transform: translateX(4px);
    transition: transform 0.2s ease;
}

/* Badges */
.study-skills-card .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Study Skills Items */
.study-skills-item {
    color: #2d3748;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f4;
    position: relative;
    padding: 0.5rem 0; /* Added vertical padding to the item itself */
}

.study-skills-item:last-child {
    border-bottom: none;
}

.study-skills-item:hover {
    background: linear-gradient(to right, #E0F2F1, #ffffff);
}

.study-skills-item:hover .study-skills-arrow {
    transform: translateX(4px);
    color: #12807C;
}

/* Study Skills Icon Wrapper */
.study-skills-icon-wrapper {
    width: 40px; /* Increased size slightly */
    height: 40px; /* Increased size slightly */
    border-radius: 10px; /* Adjusted radius */
    background: #E0F2F1; /* Lighter background */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem; /* Larger icon */
    color: #12807C; /* Slightly darker purple for contrast */
    margin-right: 1.5rem !important; /* Force larger margin (24px) */
}

/* Study Skills Title */
.study-skills-title {
    font-size: 0.95rem; /* Slightly larger */
    color: #1a202c;
    line-height: 1.4;
    font-weight: 700; /* Bolder */
    margin-bottom: 0.25rem;
}

/* Study Skills Meta */
.study-skills-meta {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    align-items: center;
}

/* Study Skills Arrow */
.study-skills-arrow {
    font-size: 0.75rem;
    color: #cbd5e0;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

/* Study Skills Footer */
.study-skills-footer {
    background: #f8fafc;
    border-top: 1px solid #f0f0f4;
}

/* Compact List (legacy support) */
.compact-study-skills {
    font-size: 0.9rem;
}

.compact-study-skills a {
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.compact-study-skills a:hover {
    background-color: #f0f0f0;
}

/* Difficulty Colors */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

/* Progress Indicators */
.badge.bg-primary {
    background-color: #12807C !important;
}

/* Card Footer */
.study-skills-card .card-footer {
    border-top: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
}

/* Category Icons */
.study-skills-card h6 i {
    opacity: 0.7;
}

/* Toggle Button */
.study-skills-card #toggle-study-skills {
    border: none;
    padding: 0.25rem 0.5rem;
    transition: all 0.2s;
}

.study-skills-card #toggle-study-skills:hover {
    transform: scale(1.1);
}

/* Inline Alert Style */
.alert-info.study-skills-alert {
    border-left: 4px solid #12807C;
    background: linear-gradient(to right, rgba(18, 128, 124, 0.05), rgba(18, 128, 124, 0.02));
}

.alert-info.study-skills-alert .la-brain {
    color: #12807C;
}

/* Responsive */
@media (max-width: 768px) {
    .study-skills-card .list-group-item {
        padding: 0.75rem 0.5rem;
    }
    
    .study-skills-card h5 {
        font-size: 1rem;
    }
    
    .study-skills-card .badge {
        font-size: 0.65rem;
    }
    
    /* Sidebar card responsive */
    .study-skills-sidebar-card .study-skills-item {
        padding: 0.75rem !important;
    }
    
    .study-skills-icon-wrapper {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .study-skills-title {
        font-size: 0.8rem;
    }
    
    .study-skills-header h6 {
        font-size: 0.85rem;
    }
    
    .study-skills-intro {
        padding: 0.5rem 0.75rem !important;
    }
    
    .study-skills-intro small {
        font-size: 0.7rem;
    }
}

/* Dashboard Widget */
.rounded-circle.bg-gradient-purple {
    background: linear-gradient(135deg, #12807C 0%, #4DB6AC 100%);
}

/* Animation for appearance */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.study-skills-card {
    animation: slideInUp 0.5s ease-out;
}

/* Hover effects for module links */
.study-skills-card .fw-bold {
    color: #212529;
    transition: color 0.2s;
}

.study-skills-card .list-group-item:hover .fw-bold {
    color: #12807C;
}

/* Category section separation */
.study-skills-card hr {
    margin: 0;
    opacity: 0.1;
}

.study-skills-card .p-3 {
    padding: 1.25rem !important;
}

/* Collapse transition */
#study-skills-content {
    transition: all 0.3s ease;
}

/* Icon colors */
.text-primary {
    color: #12807C !important;
}

/* Badge spacing */
.study-skills-card .badge + .badge {
    margin-left: 0.25rem;
}

/* ============================================================
   Workplace Skills sidebar card (lessons page)
   ============================================================ */
.workplace-skills-sidebar-card {
    --wp-pad-x: var(--space-4, 16px);
}

.workplace-skills-sidebar-card .wp-sidebar-header {
    padding: var(--space-4, 16px) var(--wp-pad-x) var(--space-3, 12px);
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.workplace-skills-sidebar-card .wp-sidebar-heading {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
}

.workplace-skills-sidebar-card .wp-sidebar-heading i {
    width: 34px;
    text-align: center;
    font-size: 1rem;
    color: var(--brand-primary, #12807C);
}

.workplace-skills-sidebar-card .wp-sidebar-heading h6 {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

.workplace-skills-sidebar-card .wp-sidebar-subtitle {
    margin-top: var(--space-1, 4px);
    font-size: 0.78rem;
    color: #64748b;
}

/* List rows */
.workplace-skills-sidebar-card .wp-sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    padding-right: var(--space-3, 12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-fast, 150ms) ease;
}

.workplace-skills-sidebar-card .wp-sidebar-item:hover {
    background-color: rgba(18, 128, 124, 0.06);
}

.workplace-skills-sidebar-card .wp-sidebar-link {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 12px) 0 var(--space-3, 12px) var(--wp-pad-x);
    color: inherit;
    text-decoration: none;
}

.workplace-skills-sidebar-card .wp-sidebar-link:focus-visible {
    outline: 2px solid var(--brand-tertiary, #4DB6AC);
    outline-offset: -2px;
    border-radius: 8px;
}

.workplace-skills-sidebar-card .wp-sidebar-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--wp-cat-color, #12807C);
    background: color-mix(in srgb, var(--wp-cat-color, #12807C) 14%, #ffffff);
}

.workplace-skills-sidebar-card .wp-sidebar-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workplace-skills-sidebar-card .wp-sidebar-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    min-width: 0;
}

.workplace-skills-sidebar-card .wp-sidebar-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1e293b;
}

.workplace-skills-sidebar-card .wp-sidebar-item:hover .wp-sidebar-title {
    color: var(--brand-primary, #12807C);
}

.workplace-skills-sidebar-card .wp-sidebar-category {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #64748b;
}

/* Soft-tinted status badges */
.workplace-skills-sidebar-card .wp-sidebar-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.workplace-skills-sidebar-card .wp-sidebar-badge--progress {
    background: rgba(18, 128, 124, 0.12);
    color: var(--brand-primary, #12807C);
}

.workplace-skills-sidebar-card .wp-sidebar-badge--done {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

/* Progress */
.workplace-skills-sidebar-card .wp-sidebar-progress {
    display: block;
    height: 4px;
    margin-top: var(--space-1, 4px);
    border-radius: var(--radius-full, 9999px);
    background: #e2e8f0;
    overflow: hidden;
}

.workplace-skills-sidebar-card .wp-sidebar-progress-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--wp-cat-color, #12807C);
}

/* Favourite (round icon action) */
.workplace-skills-sidebar-card .wp-sidebar-fav-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    transition: background-color var(--transition-fast, 150ms) ease;
}

.workplace-skills-sidebar-card .wp-sidebar-fav-btn:hover,
.workplace-skills-sidebar-card .wp-sidebar-fav-btn:focus-visible {
    background: rgba(18, 128, 124, 0.1);
    outline: none;
}

/* Footer */
.workplace-skills-sidebar-card .wp-sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-3, 12px) var(--wp-pad-x);
    background: #f8fafc;
    text-align: center;
}

.workplace-skills-sidebar-card .wp-sidebar-browse {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, 8px);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-primary, #12807C);
    text-decoration: none;
}

.workplace-skills-sidebar-card .wp-sidebar-browse:hover {
    text-decoration: underline;
}

.workplace-skills-sidebar-card .wp-sidebar-more {
    font-size: 0.72rem;
    color: #64748b;
}

/* Accessibility modes */
body.dark-mode .workplace-skills-sidebar-card .wp-sidebar-title,
body.dark-mode .workplace-skills-sidebar-card .wp-sidebar-heading h6 {
    color: #f1f5f9;
}

body.dark-mode .workplace-skills-sidebar-card .wp-sidebar-footer {
    background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .workplace-skills-sidebar-card .wp-sidebar-progress {
    background: rgba(255, 255, 255, 0.15);
}

body.high-contrast .workplace-skills-sidebar-card .wp-sidebar-title,
body.high-contrast .workplace-skills-sidebar-card .wp-sidebar-category,
body.high-contrast .workplace-skills-sidebar-card .wp-sidebar-subtitle {
    color: #000;
}
