/* =========================================
   THEME VARIABLES (Consistent)
   ========================================= */
:root {
    --theme-bg-1: #f9fafb;
    --theme-bg-2: #e5e7eb;
    --card-bg: rgba(255, 255, 255, 0.9);
    --theme-border: #5E2A5D;
    --theme-text: #5E2A5D;
    --btn-bg: #5E2A5D;
    --btn-text: #ffffff;
    --btn-hover: #DCA427;
    --btn-hover-text: #111827;
    --star-color: #DCA427;
}

html.dark {
    --theme-bg-1: #2e004f;
    --theme-bg-2: #1a0030;
    --card-bg: rgba(255, 255, 255, 0.05);
    --theme-border: #FFD700;
    --theme-text: #FFD700;
    --btn-bg: #FFD700;
    --btn-text: #2e004f;
    --btn-hover: #ffffff;
    --btn-hover-text: #2e004f;
    --star-color: #FFD700;
}

body {
    background: linear-gradient(135deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 100%);
    font-family: 'Poppins', sans-serif;
    color: var(--theme-text);
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 15px;
}

.page-title {
    text-align: center;
    margin-bottom: 30px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--theme-text);
}

/* =========================================
   DYNAMIC FILTERS (NEW)
   ========================================= */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 10px 25px;
    background: var(--theme-bg-2);
    color: var(--theme-text);
    border: 2px solid var(--theme-border);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(94, 42, 93, 0.1); 
    transform: translateY(-2px);
}

html.dark .filter-btn:hover {
    background: rgba(255, 215, 0, 0.1);
}

.filter-btn.active {
    background: var(--btn-bg);
    color: var(--btn-text);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* =========================================
   COURSE GRID & CARDS
   ========================================= */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.course-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--theme-border);
    border-radius: 25px;
    overflow: hidden;
    transition: 0.4s ease;
    position: relative;
    /* --- NEW SIZES ADDED --- */
    width: 280px;
    height: 400px;
    margin: 0 auto; /* Grid me center me rakhne ke liye */
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.course-img-container {
    position: relative;
    /* --- HEIGHT CHANGED FROM 180px TO 280px --- */
    height: 280px;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.course-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(94, 42, 93, 0.5); 
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.4s;
}

.course-card:hover .img-overlay {
    opacity: 1;
}

.view-detail-btn {
    padding: 10px 20px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    border: 2px solid var(--theme-border);
    transition: 0.3s;
    cursor: pointer;
}

/* --- ADJUSTED COURSE CONTENT TO FILL REMAINING SPACE --- */
.course-content { 
    padding: 15px 20px; 
    text-align: center; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.course-name { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 5px; 
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Lamba naam 2 lines me fit ho jayega */
    -webkit-box-orient: vertical;
}

.star-rating { color: var(--star-color); margin-bottom: 10px; font-size: 13px; }

.join-btn {
    width: 100%;
    padding: 10px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

/* =========================================
   FIXED MODAL (POPUP) STYLING
   ========================================= */
#course-detail-overlay {
    position: fixed;
    inset: 0; 
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none; 
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.detail-container {
    background: var(--theme-bg-1);
    border: 3px solid var(--theme-border);
    width: 100%;
    max-width: 1000px; 
    max-height: 90vh; 
    border-radius: 25px;
    padding: 30px;
    position: relative;
    overflow-y: auto; 
    animation: modalFade 0.3s ease-out;
}

@keyframes modalFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-detail {
    position: sticky;
    top: -10px;
    float: right;
    font-size: 35px;
    color: var(--theme-text);
    cursor: pointer;
    z-index: 100;
    background: var(--theme-bg-1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.video-wrapper {
    width: 100%;
    max-width: 600px; 
    margin: 0 auto 20px;
}

.video-frame {
    width: 100%;
    aspect-ratio: 16 / 9; 
    border-radius: 15px;
    border: 2px solid var(--theme-border);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
}

.price-box {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    border: 2px solid var(--theme-border);
    text-align: left; 
    position: sticky;
    top: 0;
}

.fee-select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    margin: 5px 0 15px;
    border: 2px solid var(--theme-border);
    background: var(--theme-bg-2);
    color: var(--theme-text);
    font-family: inherit;
}

/* Course Summary New Bullet List Styling */
.summary-list {
    list-style-type: disc;
    padding-left: 20px;
    margin: 0;
    line-height: 2;
    font-size: 14px;
    color: var(--theme-text);
}

.summary-list li {
    margin-bottom: 5px;
}

.summary-list strong {
    color: var(--theme-border);
}

/* Payable Amount Styling */
.payable-amount-box {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed var(--theme-border);
}

.payable-amount-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--theme-text);
}

.payable-amount-val {
    font-size: 32px;
    font-weight: 900;
    color: var(--theme-border);
    margin: 5px 0 15px 0;
}

/* Review Area */
#review-area {
    background: rgba(0,0,0,0.03);
    padding: 15px;
    border-radius: 15px;
    margin-top: 15px;
}

/* Mobile Responsive Fixes */
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-container { padding: 15px; padding-top: 40px; }
    .page-title { font-size: 1.5rem; }
    .video-wrapper { max-width: 100%; }
    .close-detail { position: absolute; top: 10px; right: 10px; }
}

/* =========================================
   NEW: COURSE TYPE BADGE (WITH GLASSMORPHISM)
   ========================================= */
.course-type-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    
    /* --- Glass Effect --- */
    background: rgba(94, 42, 93, 0.65); /* Translucent Theme Purple */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3); /* Halka sa chamakdar border */
    
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    text-transform: capitalize;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* Dark Mode Tag Glass Effect */
html.dark .course-type-badge {
    background: rgba(255, 215, 0, 0.65); /* Translucent Theme Gold */
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* =========================================
   NEW: DYNAMIC PROFILE FIELDS
   ========================================= */
#dynamic-profile-fields {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--theme-border);
}

.profile-field-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.profile-field-group label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--theme-text);
}

.profile-input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid var(--theme-border);
    background: var(--theme-bg-1);
    color: var(--theme-text);
    font-family: inherit;
    font-size: 13px;
    box-sizing: border-box;
    transition: 0.3s;
}

.profile-input:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(94, 42, 93, 0.4);
}

/* Profile 100% Filled Success Message */
.profile-status-message {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid #27ae60;
    padding: 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    display: none;
}

html.dark .profile-status-message {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

/* Update Button */
.btn-update-profile {
    background: transparent;
    color: var(--theme-text);
    border: 1.5px solid var(--theme-border);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin: 10px auto 0;
    transition: all 0.3s ease;
}

.btn-update-profile:hover {
    background: var(--btn-bg);
    color: var(--btn-text);
}