/**
 * WooCommerce Dive Courses Frontend CSS
 */

/* Course Product Information */
.course-info-section {
    margin: 25px 0;
    padding: 25px;
    background: #ffffff;
    border: 2px solid #dc2626;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.course-quick-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.course-info-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.course-info-label {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.course-info-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1em;
}

/* Difficulty levels */
.difficulty-beginner { color: #059669 !important; }
.difficulty-intermediate { color: #d97706 !important; }
.difficulty-advanced { color: #dc2626 !important; }
.difficulty-expert { color: #7c2d12 !important; }

/* Course details accordion */
.course-details-accordion {
    border-top: 2px solid #e5e7eb;
    padding-top: 25px;
}

.course-detail-section {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.course-detail-section summary {
    padding: 18px 24px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    color: #1f2937;
    list-style: none;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.course-detail-section summary::-webkit-details-marker {
    display: none;
}

.course-detail-section summary::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: #dc2626;
    transition: transform 0.2s ease;
}

.course-detail-section[open] summary::after {
    transform: rotate(45deg);
}

.course-detail-section summary:hover {
    background: #f3f4f6;
}

.course-detail-section[open] summary {
    background: #dc2626;
    color: white;
}

.course-detail-section[open] summary::after {
    color: white;
}

.course-detail-content {
    padding: 24px;
    background: #fdfdfd;
    border-top: 1px solid #e5e7eb;
    line-height: 1.6;
}

/* Course enrollment status */
.course-enrollment-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 1rem 0;
}

.course-enrollment-status.enrolled {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.course-enrollment-status.pending {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.course-enrollment-status.completed {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.course-enrollment-status.not-enrolled {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Course prerequisites */
.course-prerequisites {
    margin: 20px 0;
    padding: 20px;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
}

.course-prerequisites h4 {
    color: #92400e;
    margin-bottom: 10px;
    font-weight: 700;
}

.course-prerequisites ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.course-prerequisites li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #92400e;
}

.course-prerequisites li::before {
    content: '⚠️';
    font-size: 14px;
}

/* Course progress */
.course-progress {
    margin: 20px 0;
    padding: 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.course-progress-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0;
}

.course-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #047857);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.course-progress-text {
    font-size: 0.875rem;
    color: #166534;
    font-weight: 600;
    text-align: center;
}

/* Course materials */
.course-materials {
    margin: 20px 0;
}

.course-materials h4 {
    color: #1f2937;
    margin-bottom: 15px;
    font-weight: 700;
}

.course-material-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.course-material-item:hover {
    background: #f3f4f6;
}

.course-material-icon {
    width: 24px;
    height: 24px;
    color: #dc2626;
}

.course-material-info {
    flex: 1;
}

.course-material-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2px;
}

.course-material-description {
    font-size: 0.875rem;
    color: #6b7280;
}

.course-material-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.course-material-status.available {
    background: #f0fdf4;
    color: #166534;
}

.course-material-status.locked {
    background: #fef2f2;
    color: #dc2626;
}

/* My Account Course Pages */
.woocommerce-MyAccount-content .course-dashboard {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.course-dashboard-header {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #ffffff;
    padding: 2rem;
    text-align: center;
}

.course-dashboard-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.course-dashboard-subtitle {
    opacity: 0.9;
    font-size: 1.125rem;
}

.course-dashboard-content {
    padding: 2rem;
}

.course-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.course-stat {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.course-stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: #dc2626;
    display: block;
}

.course-stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .course-info-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .course-quick-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .course-detail-section summary {
        padding: 15px 18px;
        font-size: 0.95em;
    }
    
    .course-detail-content {
        padding: 18px;
    }
    
    .course-dashboard-header {
        padding: 1.5rem;
    }
    
    .course-dashboard-title {
        font-size: 1.5rem;
    }
    
    .course-dashboard-content {
        padding: 1.5rem;
    }
    
    .course-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .course-info-item {
        padding: 12px;
    }
    
    .course-material-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .course-dashboard-header {
        padding: 1rem;
    }
    
    .course-dashboard-content {
        padding: 1rem;
    }
}

/* Loading States */
.course-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.course-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error States */
.course-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

/* Success States */
.course-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}