/* =============================================
   TTCL Course Manager v2 - Card Styles
   ============================================= */

/* Grid */
.ttcl-courses-grid {
    display: grid;
    gap: 28px;
    padding: 10px 0;
}
.ttcl-cols-1 { grid-template-columns: repeat(1, 1fr); }
.ttcl-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ttcl-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ttcl-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Card */
.ttcl-course-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid #ebebeb;
}
.ttcl-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(91,43,226,0.13);
}

/* Image */
.ttcl-course-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}
.ttcl-course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.ttcl-course-card:hover .ttcl-course-image img {
    transform: scale(1.04);
}

/* Body */
.ttcl-course-body {
    padding: 20px 18px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

/* Title */
.ttcl-course-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 10px;
    line-height: 1.5;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Price */
.ttcl-course-price {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 16px;
}

/* Buttons wrapper */
.ttcl-course-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

/* Base button */
.ttcl-btn {
    display: block;
    width: 100%;
    padding: 11px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
    transition: opacity 0.2s ease, transform 0.15s ease;
    border: none;
    line-height: 1.4;
    box-sizing: border-box;
}
.ttcl-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    text-decoration: none !important;
}

/* Order Now */
.ttcl-btn-order {
    background: #5b2be2 !important;
    color: #ffffff !important;
}

/* View Syllabus */
.ttcl-btn-syllabus {
    background: #ffffff !important;
    color: #5b2be2 !important;
    border: 2px solid #5b2be2 !important;
}
.ttcl-btn-syllabus:hover {
    background: #f3eeff !important;
    color: #5b2be2 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Tablet: use ttcl-tablet-cols-* classes */
    .ttcl-tablet-cols-1 { grid-template-columns: repeat(1, 1fr) !important; }
    .ttcl-tablet-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .ttcl-tablet-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }

    /* Fallback for old markup without tablet class */
    .ttcl-courses-grid:not([class*="ttcl-tablet-cols-"]).ttcl-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .ttcl-courses-grid:not([class*="ttcl-tablet-cols-"]).ttcl-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .ttcl-cols-4,
    .ttcl-cols-3,
    .ttcl-cols-2 { grid-template-columns: 1fr; }
    .ttcl-tablet-cols-1,
    .ttcl-tablet-cols-2,
    .ttcl-tablet-cols-3 { grid-template-columns: 1fr !important; }
}
