/**
 * WooCommerce iSpring Integration - My Courses CSS
 *
 * Styles for the My Courses tab in the WooCommerce My Account area.
 */

/* Tabs */
.woo-is-courses-tabs {
    margin-bottom: 30px;
}

.woo-is-courses-tabs .tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    flex-wrap: wrap;
}

.woo-is-courses-tabs .tabs li {
    margin: 0 4px 0 0;
    padding: 0;
}

.woo-is-courses-tabs .tabs li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    background-color: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    transition: all 0.2s ease;
}

.woo-is-courses-tabs .tabs li.active a,
.woo-is-courses-tabs .tabs li a:hover {
    background-color: #fff;
    color: #000;
    border-bottom-color: #fff;
}

/* Course Grid */
.woo-is-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .woo-is-courses-grid {
        grid-template-columns: 1fr;
    }
}

/* Course Card */
.course-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.course-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #0073aa;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-card:hover::after {
    opacity: 1;
}

.course-card.status-completed::after {
    background: #4caf50;
    opacity: 1;
}

.course-card.status-in-progress::after {
    background: #ffa000;
    opacity: 1;
}

/* Course Header */
.course-header {
    background-color: #f8f8f8;
    padding: 15px;
    border-bottom: 1px solid #efefef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-title {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    flex: 1;
}

.course-status {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

.course-not-started .course-status {
    background-color: #f0f0f0;
    color: #777;
}

.course-in-progress .course-status {
    background-color: #e6f7ff;
    color: #0086c9;
}

.course-completed .course-status {
    background-color: #e7f7ed;
    color: #46b450;
}

.course-status:hover {
    transform: translateY(-2px);
}

/* Course Body */
.course-body {
    padding: 15px;
    flex: 1;
}

.course-description {
    color: #666;
    margin-bottom: 15px;
    max-height: 80px;
    overflow: hidden;
    position: relative;
    line-height: 1.6;
}

.course-description:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
}

/* Progress Bar */
.course-progress {
    margin-bottom: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 13px;
    color: #555;
}

.progress-bar {
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease-in-out;
}

.course-not-started .progress-bar span {
    background-color: #ccc;
}

.course-in-progress .progress-bar span {
    background-color: #0086c9;
}

.course-completed .progress-bar span {
    background-color: #46b450;
}

/* Course Info */
.course-info {
    margin-top: 15px;
    border-top: 1px solid #efefef;
    padding-top: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.course-card:hover .course-info {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.06);
}

.info-item {
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.info-item .label {
    font-weight: 600;
    color: #555;
}

/* Course Footer */
.course-footer {
    padding: 15px;
    border-top: 1px solid #efefef;
    display: flex;
    justify-content: flex-end;
}

.course-footer .button {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
}

/* Status-based Card Styling */
.course-not-started {
    border-top: 4px solid #ccc;
}

.course-in-progress {
    border-top: 4px solid #0086c9;
}

.course-completed {
    border-top: 4px solid #46b450;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .course-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .course-status {
        margin-top: 10px;
    }
    
    .woo-is-courses-tabs .tabs {
        flex-direction: column;
    }
    
    .woo-is-courses-tabs .tabs li {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .woo-is-courses-tabs .tabs li a {
        border-radius: 5px;
        border: 1px solid #e5e5e5;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Additional styling for My Courses page */
.woo-is-my-courses {
    margin: 20px 0;
    max-width: 1200px;
    animation: fadeIn 0.5s ease-out;
}

/* Empty state message */
.woo-is-no-courses-message {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
    color: #666;
    font-size: 16px;
}

/* Course launch button enhancements */
.view-course-btn {
    position: relative;
    overflow: hidden;
}

.view-course-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: left 0.8s ease-in-out;
}

.view-course-btn:hover::before {
    left: 100%;
}

/* Enhanced tab transitions */
.woo-is-courses-tabs .tab {
    transition: all 0.3s ease;
}

/* Print-friendly styles */
@media print {
    .woo-is-courses-tabs,
    .course-actions {
        display: none;
    }
    
    .woo-is-courses-grid {
        display: block;
    }
    
    .course-card {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
}

/* Focus enhancements for accessibility */
.tab:focus,
.view-course-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Loading state for course grid */
.woo-is-courses-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 1;
}

.woo-is-courses-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
} 