
/* ========================================
   MODERN COURSE CARD DESIGN
   ======================================== */

.modern-course-card {
    position: relative;
    overflow: visible;
    background: transparent;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.modern-course-card:hover {
    transform: translateY(-5px);
}

.modern-course-card:hover .course-details-container {
    box-shadow: -12px 12px 30px rgba(0, 0, 0, 0.2), 3px 0 8px rgba(0, 0, 0, 0.08);
}

/* Course Image Container */
.course-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    width: 100%;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.course-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-image-fallback > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Image Overlay */
.course-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Hover Effects */
.modern-course-card:hover .course-image {
    transform: scale(1.1);
    filter: contrast(1.2) brightness(1.1);
}

.modern-course-card:hover .course-image-overlay {
    opacity: 1;
}

.modern-course-card:hover .course-image-fallback > div {
    transform: scale(1.05);
    filter: contrast(1.2) brightness(1.1);
}

/* Course Details Container (Overlapping) */
.course-details-container {
    position: relative;
    background: #fff;
    margin-top: -30px;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
    padding: 2rem;
    z-index: 2;
    border-radius: 6px;
    box-shadow: -8px 8px 20px rgba(0, 0, 0, 0.15), 2px 0 5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Status Badge */
.course-status-badge {
    position: absolute;
    top: -15px;
    right: 1.5rem;
    z-index: 3;
}

.course-status-badge .badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Course Header */
.course-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-start;
}

.course-grade-badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
}

.course-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 1rem 0;
    line-height: 1.3;
    text-align: start;
}

/* Divider Styling */
.divider-2 {
    height: 3px;
    width: 60px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-radius: 2px;
    margin: 0.75rem 0 1rem 0;
    transition: all 0.3s ease;
}

.modern-course-card:hover .divider-2 {
    width: 80px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

/* First Row: Two Column Layout */
.course-first-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

/* Right Column: Description (3/5 width) */
.course-description-column {
    flex: 0 0 60%;
    min-width: 0;
    padding-right: 1rem;
}

.course-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: start;
}

/* Full description for course detail page */
.course-description-full {
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: start;
}

.course-purchase-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-right: 3px solid #007bff;
}

.course-purchase-info small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.course-purchase-info .material-symbols-outlined {
    font-size: 1rem;
}

/* Course Stats */
.course-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #495057;
}

.stat-item .material-symbols-outlined {
    font-size: 1rem;
    color: #007bff;
}

/* Left Column: Actions (2/5 width) */
.course-actions-column {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
}

/* Utility Classes */
.font-smaller {
    font-size: 0.875rem;
}

.font-w-bold {
    font-weight: 600;
}

.w-full {
    width: 100%;
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-col-reverse {
    flex-direction: column-reverse;
}

.flex-row {
    flex-direction: row;
}

.flex-center-both {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-center-y {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.shrink-0 {
    flex-shrink: 0;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* Spacing utilities */
.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

.space-y-reverse > * + * {
    margin-top: 0;
    margin-bottom: 1rem;
}

.space-x-1 > * + * {
    margin-right: 0.25rem;
}

.space-x-2 > * + * {
    margin-right: 0.5rem;
}

.space-x-4 > * + * {
    margin-right: 1rem;
}

.space-x-reverse > * + * {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* Background and text utilities */
.bg-teal-500 {
    background-color: #14b8a6;
}

.text-slate-100 {
    color: #f1f5f9;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.flex-1 {
    flex: 1;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.rounded-sm {
    border-radius: 0.125rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.bg-primary-container {
    background-color: rgba(255, 255, 255, 0.2);
}

.clr-text-primary {
    color: #ffffff;
}

.clr-text-secondary {
    color: #6b7280;
}

.smooth {
    transition: all 0.3s ease;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-px {
    padding-top: 1px;
    padding-bottom: 1px;
}

/* Price section styling */
.bg-teal-500 {
    font-size: 0.875rem;
    font-weight: 600;
}

.bg-primary-container {
    font-size: 1rem;
    font-weight: 700;
}

.transform {
    transform: translateZ(0);
}

.-translate-y-px {
    transform: translateY(-1px);
}

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:flex-row {
        flex-direction: row;
    }

    .sm\:space-y-0 > * + * {
        margin-top: 0;
    }

    .sm\:space-x-1 > * + * {
        margin-right: 0.25rem;
    }

    .sm\:space-x-4 > * + * {
        margin-right: 1rem;
    }

    .sm\:space-x-reverse > * + * {
        margin-right: 0;
        margin-left: 0.25rem;
    }

    .sm\:justify-end {
        justify-content: flex-end;
    }

    .sm\:items-start {
        align-items: flex-start;
    }
}

.course-action-btn {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px; /* Full rounded */
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.course-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-action-btn .material-symbols-outlined {
    font-size: 1rem;
}

/* Primary Action Button (Subscribe/Purchase) */
.course-action-btn.btn-primary,
.course-action-btn.purchase-btn {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: white;
    border: none;
}

.course-action-btn.btn-primary:hover,
.course-action-btn.purchase-btn:hover {
    background: linear-gradient(135deg, #0d9488, #0284c7);
    color: white;
}

/* Secondary Action Button (View Course) */
.course-action-btn.btn-info,
.course-action-btn.btn-success {
    background: transparent;
    color: #14b8a6;
    border: 2px solid #14b8a6;
}

.course-action-btn.btn-info:hover,
.course-action-btn.btn-success:hover {
    background: #14b8a6;
    color: white;
    border-color: #14b8a6;
}

/* Disabled/Expired Button */
.course-action-btn.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.course-action-btn.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* Payment Method Selection */
.payment-method-selection {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.payment-method-title {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.payment-method-selection .form-check {
    margin-bottom: 0.5rem;
}

.payment-method-selection .form-check-label {
    font-size: 0.8rem;
    color: #495057;
}

.balance-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8d7da;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
}

/* Coupon Section */
.coupon-section {
    margin-bottom: 0.75rem;
}

.coupon-section .input-group {
    border-radius: 10px;
    overflow: hidden;
}

.coupon-input {
    border: 1px solid #dee2e6;
    font-size: 0.8rem;
}

.coupon-result {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: 5px;
}

/* Second Row: Course Information */
.course-second-row {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
}

/* Third Row: Created and Updated Dates */
.course-third-row {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.course-info-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.course-info-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.course-info-item .material-symbols-outlined {
    font-size: 1.25rem;
    color: #007bff;
    flex-shrink: 0;
}

.price-info .material-symbols-outlined {
    color: #28a745;
}

.date-info .material-symbols-outlined {
    color: #6f42c1;
}

.update-info .material-symbols-outlined {
    color: #fd7e14;
}

.duration-info .material-symbols-outlined {
    color: #20c997;
}

.purchase-info .material-symbols-outlined {
    color: #28a745;
}

.expiry-info .material-symbols-outlined {
    color: #dc3545;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.info-label {
    font-size: 0.625rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 0.75rem;
    color: #2c3e50;
    font-weight: 600;
    word-break: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .course-first-row {
        flex-direction: column;
        gap: 1rem;
    }

    .course-description-column {
        padding-right: 0;
    }

    .course-actions-column {
        flex: none;
        width: 100%;
        min-width: auto;
    }

    .course-stats {
        grid-template-columns: 1fr;
    }

    .course-details-container {
        margin-top: -20px;
        padding: 1rem;
    }

    .course-image-container {
        height: 200px;
        width: 100%;
    }

    .course-image,
    .course-image-fallback {
        width: 100%;
        margin-left: -1.5rem;
    }



    .course-second-row,
    .course-third-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .course-info-item {
        padding: 0.6rem;
    }
}

@media (max-width: 576px) {
    .modern-course-card {
        margin-bottom: 1.5rem;
    }

    .course-image-container {
        height: 180px;
        width: 100%;
    }

    .course-image-overlay {
        left: -1rem;
        right: -1rem;
    }

    .course-details-container {
        padding: 0.75rem;
    }

    .course-title {
        font-size: 1.1rem;
    }

    .course-action-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .course-second-row {
        gap: 0.5rem;
    }

    .course-info-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .course-info-item .material-symbols-outlined {
        font-size: 1.2rem;
    }

    .info-label {
        font-size: 0.7rem;
    }

    .info-value {
        font-size: 0.8rem;
    }
}

/* ========================================
   BACK BUTTON STYLES - GLOBAL
   ======================================== */

/* Back button styles for consistent navigation */
.back-btn {
    color: #007bff;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.back-btn:hover {
    color: #0056b3;
    transform: translateY(-1px);
}

/* ========================================
   COURSE LOCKING STYLES
   ======================================== */

/* Locked course card styling */
.course-locked {
    opacity: 0.7;
    position: relative;
}

.course-locked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 193, 7, 0.1);
    border: 2px dashed #ffc107;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1;
}

/* Locked item card styling */
.item-card.locked {
    opacity: 0.6;
    background-color: #f8f9fa;
    border-left: 4px solid #ffc107;
    cursor: not-allowed;
}

.item-card.locked:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-card.locked .material-symbols-outlined {
    color: #6c757d;
}

/* Lock reason text styling */
.lock-reason {
    font-size: 0.75rem;
    color: #856404;
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

/* ========================================
   QUESTION REORDERING STYLES
   ======================================== */

/* Move up/down buttons styling */
.move-up-btn, .move-down-btn {
    width: 40px;
    height: 32px;
    padding: 0;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.move-up-btn:hover:not(:disabled), .move-down-btn:hover:not(:disabled) {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
    transform: translateY(-1px);
}

.move-up-btn:disabled, .move-down-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Question card transition for smooth movement */
.question-card {
    transition: background-color 0.5s ease;
}

/* Reorder handle styling improvements */
.reorder-handle .btn-group {
    gap: 2px;
}

.drag-handle {
    padding: 8px;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.drag-handle:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Discount Price Styles for Course Cards */
.discount-price-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.discount-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #dc3545, #e91e63);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.discount-price-badge {
    background: linear-gradient(135deg, #dc3545, #e91e63);
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    transition: all 0.3s ease;
}

.discount-price-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}

.discount-price-badge .material-symbols-outlined {
    font-size: 16px;
}

.original-price-crossed {
    font-size: 0.75rem;
    color: #6c757d;
    text-decoration: line-through;
    margin-top: 4px;
    opacity: 0.8;
}

/* Regular price badge */
.regular-price-badge {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(32, 201, 151, 0.3);
}

/* Utility classes for flexbox (Bootstrap-compatible) */
.d-flex-column {
    display: flex;
    flex-direction: column;
}

.align-items-end {
    align-items: flex-end;
}

.position-relative {
    position: relative;
}

.text-white {
    color: white !important;
}

.font-weight-bold {
    font-weight: bold !important;
}

.text-decoration-line-through {
    text-decoration: line-through !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Course card enhancements for discount display */
.course-card .discount-price-container {
    min-width: 120px;
}

.course-card .discount-badge {
    white-space: nowrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .discount-price-badge,
    .regular-price-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .discount-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }

    .original-price-crossed {
        font-size: 0.65rem;
    }
}
