/**
 * Popup Styles for Course Recommendation
 */

/* Overlay */
.tcr-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tcr-popup-overlay.tcr-show {
    opacity: 1;
}

/* Popup Container */
.tcr-popup-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.tcr-popup-overlay.tcr-show .tcr-popup-container {
    transform: scale(1);
}

/* Close Button */
.tcr-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    z-index: 10;
    transition: color 0.2s ease;
}

.tcr-popup-close:hover {
    color: #000;
}

.tcr-popup-close span {
    display: block;
}

/* Popup Content */
.tcr-popup-content {
    padding: 40px 30px 30px;
}

.tcr-popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.tcr-popup-header h2 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #1a1a1a;
    font-weight: 700;
}

.tcr-popup-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Popup Body */
.tcr-popup-body {
    margin-bottom: 30px;
}

.tcr-popup-body h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    text-align: center;
}

/* Recommended Course */
.tcr-recommended-course {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: flex-start;
}

.tcr-course-thumbnail {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    background: #e9ecef;
}

.tcr-course-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.tcr-course-info h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.4;
}

.tcr-coupon-code {
    margin: 8px 0 10px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px dashed #ffc107;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.tcr-coupon-label {
    color: #856404;
    margin-right: 5px;
    font-weight: 400;
}

.tcr-coupon-code strong {
    color: #856404;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tcr-coupon-description {
    display: block;
    color: #856404;
    font-size: 13px;
    margin-top: 4px;
    font-weight: normal;
}

.tcr-course-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* Popup Footer */
.tcr-popup-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.tcr-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.tcr-btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.tcr-btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.tcr-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.tcr-btn-secondary:hover {
    background: #d1d5db;
}

/* Loading State */
.tcr-popup-loading {
    padding: 60px 30px;
    text-align: center;
}

.tcr-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: tcr-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.tcr-popup-loading p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Error State */
.tcr-popup-error {
    padding: 60px 30px;
    text-align: center;
}

.tcr-popup-error p {
    margin: 0 0 20px;
    color: #dc2626;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 640px) {
    .tcr-popup-overlay {
        padding: 10px;
    }
    
    .tcr-popup-content {
        padding: 30px 20px 20px;
    }
    
    .tcr-popup-header h2 {
        font-size: 24px;
    }
    
    .tcr-recommended-course {
        flex-direction: column;
        gap: 15px;
    }
    
    .tcr-course-thumbnail {
        width: 100%;
        height: 180px;
    }
    
    .tcr-popup-footer {
        flex-direction: column;
    }
    
    .tcr-btn {
        width: 100%;
    }
}

/* Animation for better UX */
@keyframes tcr-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tcr-popup-content > * {
    animation: tcr-fadeIn 0.4s ease forwards;
}

.tcr-popup-header {
    animation-delay: 0.1s;
}

.tcr-popup-body {
    animation-delay: 0.2s;
}

.tcr-popup-footer {
    animation-delay: 0.3s;
}