/* =================================================================
   COURSES PAGE - UNIFIED STYLES
   Modern Course Card Design + Legacy Compatibility
   ================================================================= */

/* =================================================================
   MODERN COURSE CARD DESIGN
   ================================================================= */

/* Course Card Container */
.course-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.course-card:hover {
    transform: translateY(-8px);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3), 
                0 0 40px rgba(118, 75, 162, 0.2);
}

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

/* Course Badges */
.course-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    padding: 24px 20px 16px 0px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%);
    min-height: 60px;
    align-items: flex-start;
    justify-content: flex-start;
}

.course-badges .badge {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Course Content */
.course-content {
    flex: 1;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
	background: var(--secondary-bg);
}

/* Title Row with Bookmark */
.course-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.course-title-row .course-title {
    flex: 1;
    min-height: auto;
}

/* Bookmark button */
.bookmark-btn {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 0.35rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.bookmark-btn:hover {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
    transform: translateY(-1px);
}

.bookmark-btn.bookmarked {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.12);
}

.bookmark-btn .heart-icon {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.bookmark-btn:hover .heart-icon {
    color: #ff6b6b;
}

.bookmark-btn.bookmarked .heart-icon {
    fill: #ff6b6b;
    color: #ff6b6b;
    animation: heartbeat 0.3s ease;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.toast-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8rem;
}

/* Info Row */
.course-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 4px 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.info-text {
    font-weight: 500;
    white-space: nowrap;
}

/* Description */
.course-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Footer Info */
.course-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.course-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.star-icon {
    font-size: 1rem;
    line-height: 1;
}

.rating-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.rating-count {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.course-platform {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    white-space: nowrap;
}

/* Course Actions */
.course-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-course-primary,
.btn-course-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-course-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-course-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #7589f1 0%, #8558b0 100%);
}

.btn-course-primary:active {
    transform: translateY(0);
}

.btn-course-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    padding: 12px 16px;
}

.btn-course-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-course-primary .btn-icon,
.btn-course-secondary .btn-icon {
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.btn-course-primary:hover .btn-icon {
    transform: translateX(2px);
}

.btn-course-secondary:hover .btn-icon {
    transform: translateX(3px);
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Stagger animation for multiple cards */
.course-card:nth-child(1) { animation-delay: 0.05s; }
.course-card:nth-child(2) { animation-delay: 0.1s; }
.course-card:nth-child(3) { animation-delay: 0.15s; }
.course-card:nth-child(4) { animation-delay: 0.2s; }
.course-card:nth-child(5) { animation-delay: 0.25s; }
.course-card:nth-child(6) { animation-delay: 0.3s; }

/* =================================================================
   LEGACY COMPATIBILITY STYLES
   (Keep for backward compatibility with old card structure)
   ================================================================= */

/* Course Meta Section */
.course-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

/* Language Icons Container */
.course-languages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.language-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.2s ease;
    cursor: help;
}

.language-icon:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.15);
}

.language-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

.language-icon .language-text {
    font-size: 0.65rem;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.language-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6b7280;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Platform Badge */
.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.platform-badge:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

/* Title Row Adjustments */
.tool-card-body .title-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.tool-card-body .title-row .tool-name {
    margin: 0;
    flex: 1;
    min-width: 0;
}

/* Remove old tag styles for courses page */
.courses-page .tool-tags {
    display: none;
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */

@media (max-width: 768px) {
    .course-card {
        border-radius: 16px;
    }
    
    .course-content {
        padding: 20px 16px;
        gap: 14px;
    }
    
    .course-title {
        font-size: 1.125rem;
    }
    
    .course-info-row {
        gap: 8px;
    }
    
    .info-item {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
    
    .course-description {
        font-size: 0.85rem;
    }
    
    .course-actions {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px;
    }
    
    .btn-course-primary,
    .btn-course-secondary {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .language-icon {
        width: 26px;
        height: 26px;
    }
    
    .language-icon img {
        width: 18px;
        height: 18px;
    }
    
    .course-meta {
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .course-badges {
        padding: 12px 5px 16px;
        min-height: 48px;
    }
    
    .course-badges .badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .course-title {
        font-size: 1rem;
    }
    
    .course-info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-item {
        width: 100%;
    }
    
    .course-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* =================================================================
   DARK MODE SUPPORT
   ================================================================= */

@media (prefers-color-scheme: dark) {
    .course-card {
        background: linear-gradient(135deg, rgba(20, 20, 30, 0.6) 0%, rgba(15, 15, 25, 0.8) 100%);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .course-card:hover {
        background: linear-gradient(135deg, rgba(25, 25, 35, 0.7) 0%, rgba(20, 20, 30, 0.9) 100%);
        border-color: rgba(102, 126, 234, 0.5);
    }
    
    .course-badges {
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.3) 100%);
    }
    
    .info-item {
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 255, 255, 0.15);
    }
    
    .course-actions {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .language-icon {
        background: rgba(139, 92, 246, 0.1);
        border-color: rgba(139, 92, 246, 0.2);
    }
    
    .language-icon:hover {
        background: rgba(139, 92, 246, 0.2);
        border-color: rgba(139, 92, 246, 0.3);
    }
    
    .language-icon .language-text {
        color: #a78bfa;
    }
    
    .language-more {
        background: rgba(156, 163, 175, 0.15);
        border-color: rgba(156, 163, 175, 0.25);
        color: #9ca3af;
    }
    
    .platform-badge {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.25);
        color: #a78bfa;
    }
    
    .platform-badge:hover {
        background: rgba(139, 92, 246, 0.25);
        border-color: rgba(139, 92, 246, 0.35);
    }
}
