/*
 * Styles for Special Courses Page - V2
 * Using Iqra Wartqi Design System
*/

/* --- Page Setup --- */
.iw-special-courses-body {
    background: #f8f9fa;
}

.iw-special-courses-page {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.5) 0%, rgba(233, 236, 239, 0.5) 100%), 
                url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z" fill="%23234e52" fill-opacity="0.05" fill-rule="evenodd"/%3E%3C/svg%3E');
    padding: 0 0 40px; /* MODIFIED: Removed top padding */
}

.iw-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Page Header --- */
.iw-page-header {
    text-align: center;
    padding: 0 0 40px; /* CHANGED: Set top padding to 0 */
    margin: 0;
}

.iw-page-title {
    font-family: 'Philosopher', sans-serif;
    color: #234e52; /* Primary Color */
    font-size: 3.2rem;
    font-weight: 700;
    margin-top: 0; /* ADDED: Removes default H1 margin */
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    padding-top: 30px; /* ADDED: Gives space back inside the header */
}
.iw-page-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, #d4a373, #7f1102); /* Third & Secondary */
    border-radius: 2px;
}

.iw-page-subtitle {
    font-size: 1.2rem;
    color: #234e52;
    max-width: 600px;
    margin: 10px auto 0;
    line-height: 1.6;
}

/* --- CHANGE 3: Courses Grid (Responsive & Centered) --- */
.iw-courses-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: 1 column for small phones */
    gap: 30px;
    padding: 20px 0;
    justify-content: center; /* This centers the grid item(s) if there's space */
}
@media (min-width: 600px) {
    .iw-courses-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for tablets/large phones */
    }
}
@media (min-width: 992px) {
    .iw-courses-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for desktop */
    }
}

/* --- Course Card --- */
.iw-course-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(35, 78, 82, 0.08);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-top: 4px solid #d4a373; /* Third Color */
    display: flex;
    flex-direction: column;
}

.iw-course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 16px 35px rgba(35, 78, 82, 0.12);
}

/* --- CHANGE 2: Card Header & Image Styling --- */
.iw-card-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Ensures consistent image dimensions */
    overflow: hidden;
    background-color: #f0f2f5;
}

.iw-course-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the container without distortion */
    transition: transform 0.4s ease;
}

.iw-course-card:hover .iw-course-image {
    transform: scale(1.05);
}

.iw-course-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #234e52, #a3be8c);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
}
.iw-placeholder-icon {
    font-size: 4rem;
}

.iw-course-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #7f1102;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* --- Card Body --- */
.iw-card-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows footer to stick to the bottom */
}

.iw-course-title {
    font-family: 'Philosopher', sans-serif;
    color: #234e52;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

/* --- CHANGE 5: Meta Fields & Status Badge --- */
.iw-course-meta-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}
.iw-course-meta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #555;
}
.iw-meta-icon {
    margin-right: 8px;
    color: #d4a373;
}
.iw-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
}
.iw-status-badge .iw-meta-icon {
    color: white;
}
.iw-status-ongoing { background-color: #a3be8c; } /* Fourth color */
.iw-status-upcoming { background-color: #234e52; } /* Primary color */
.iw-status-completed { background-color: #718096; } /* Light Text color */

.iw-course-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 15px 0;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}
.iw-detail-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}
.iw-detail-icon {
    margin-right: 8px;
    color: #234e52;
    width: 16px;
    text-align: center;
}
.iw-detail-text {
    color: #333;
    font-weight: 500;
}
.iw-course-description {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
    margin-top: auto; /* Pushes itself down */
    padding-top: 15px; /* Space above description */
}

/* --- Card Footer --- */
.iw-card-footer {
    padding: 20px 25px;
    background: #fdfcfa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.iw-course-price {
    font-family: 'Philosopher', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #7f1102;
}
.iw-course-price .woocommerce-Price-amount {
    color: #7f1102 !important;
}

.iw-course-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.iw-btn {
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: 0.9rem;
    text-align: center;
    display: inline-block;
}
.iw-btn-primary {
    background: #234e52;
    color: white;
}
.iw-btn-primary:hover {
    background: #1a3c3f;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.iw-btn-outline {
    background: transparent;
    color: #234e52;
    border-color: #234e52;
}
.iw-btn-outline:hover {
    background: #234e52;
    color: white;
    transform: translateY(-3px);
}

/* Fallback message */
.iw-no-courses {
    text-align: center;
    grid-column: 1 / -1;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2rem;
    background: white;
    border-radius: 15px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
    .iw-course-details {
        grid-template-columns: 1fr;
    }
    .iw-card-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .iw-course-actions {
        justify-content: center;
    }
    .iw-btn {
        flex: 1;
        min-width: 150px;
    }
}
@media (max-width: 480px) {
    .iw-page-title { font-size: 2.5rem; }
    .iw-special-courses-page { padding: 0 0 40px; } /* Keep bottom padding */
    .iw-course-actions { flex-direction: column; }
}

