/**
 * Styles for the "Active Courses" Dashboard Tab
 * FINALIZED VERSION: Merges DAKHOOL.CSS styles for iw-course-card, meta, and buttons.
 * Primary Colour: #234e52 (Deep Teal)
 * Secondary Colour: #7f1102 (Deep Red/Maroon)
 * Third Colour: #d4a373 (Gold/Tan)
 * Fourth Colour: #a3be8c (Pale Green)
 */

/* --- GENERAL LAYOUT FIXES --- */
.iw-courses-grid {
    display: grid;
    /* Forces exactly two columns on larger screens */
    grid-template-columns: repeat(2, 1fr); 
    gap: 25px;
    margin-top: 30px;
}

/* --- DAKHOOL CARD STYLING (The Core Look) --- */

.iw-course-card {
    /* Base Card Styling - Match Dakhool enrollment card */
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e8ddd0;
}

.iw-course-card:before {
    /* Shadow shimmer effect on card */
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 40%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: rotate(30deg);
    transition: all 0.6s ease;
    z-index: 1;
}

.iw-course-card:hover:before {
    right: 120%;
}

.iw-course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.iw-course-thumbnail {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.iw-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.iw-course-card:hover .iw-course-thumbnail img {
    transform: scale(1.08);
}

/* --- BADGES (Live, Status) --- */

.live-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    background: rgba(127, 17, 2, 0.95); /* Secondary Colour */
    color: white;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.live-dot {
    width: 10px;
    height: 10px;
    background: #ff4d4d;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.iw-status-badge {
    /* Status Badge Style */
    position: absolute;
    top: 15px;
    left: 15px;
    background: #d4a373; /* Third Colour */
    color: white;
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    z-index: 2;
}

/* --- CONTENT AND META --- */

.iw-course-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.iw-course-instructor {
    color: #7f1102; /* Secondary Colour */
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.iw-course-title {
    font-size: 1.2rem;
    color: #234e52; /* Primary Colour */
    margin: 0 0 12px 0;
    font-weight: 800;
    line-height: 1.3;
    min-height: 60px; /* Ensures consistent alignment */
    flex-grow: 1;
}

.course-meta {
    /* Meta tags container from dakhool.css */
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
    border-top: 1px solid #eee; /* Added separator for style */
    padding-top: 10px;
}

.course-tag {
    /* Individual tags from dakhool.css */
    background: #f0f0f0;
    color: #234e52; /* Primary Colour */
    padding: 5px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- ACTIONS (Buttons) --- */

.iw-course-actions {
    /* Action container from dakhool.css */
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.iw-course-button {
    /* Base Button Styling (Dakhool style) */
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    border: none;
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.iw-course-button.islamic-btn.primary {
    /* Continue Learning button (Secondary Color - Red/Maroon) */
    background: linear-gradient(135deg, #7f1102 0%, #6a0e01 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(127, 17, 2, 0.25);
}

.iw-course-button.islamic-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(127, 17, 2, 0.35);
}

.iw-course-button.islamic-btn.reset {
    /* Details button (Tertiary Color - Gold/Tan) */
    background: linear-gradient(135deg, #d4a373 0%, #c2915e 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(212, 163, 115, 0.25);
    flex-basis: 45%;
}

.iw-course-button.islamic-btn.reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 163, 115, 0.35);
}


/* --- RESPONSIVE ADJUSTMENTS --- */

@media (max-width: 991px) {
    /* Tablet/Desktop: 2 columns */
    .iw-courses-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    /* Smaller Tablet/Large Mobile: 1 column */
    .iw-courses-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    /* Mobile stacked buttons */
    .iw-course-actions {
        flex-direction: column;
        gap: 8px;
    }
}
