/**
 * Elementor Widgets CSS for LearnDash Iranian Addons
 * 
 * @package LearnDash_Iranian_Addons
 * @version 1.0.0
 */

/* ==========================================================================
   Course Grid Widget Styles
   ========================================================================== */

.ld-course-grid {
    display: grid;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.ld-course-grid.columns-1 {
    grid-template-columns: 1fr;
}

.ld-course-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ld-course-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ld-course-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ld-course-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.ld-course-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.ld-course-image {
    position: relative;
    overflow: hidden;
}

.ld-course-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ld-course-card:hover .ld-course-image img {
    transform: scale(1.05);
}

.ld-course-placeholder {
    height: 200px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

.ld-course-content {
    padding: 20px;
}

.ld-course-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.ld-course-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ld-course-title a:hover {
    color: #3498db;
}

.ld-course-pricing {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ld-original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.ld-sale-price {
    color: #e74c3c;
    font-size: 18px;
    font-weight: 600;
}

.ld-course-price {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.ld-discount-badge {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.ld-stock-info {
    margin: 10px 0;
}

.ld-stock-available {
    color: #27ae60;
    font-size: 13px;
    font-weight: 500;
}

.ld-stock-sold-out {
    color: #e74c3c;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.ld-course-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 15px 0;
}

.ld-course-button {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.ld-course-button:hover {
    background: #2980b9;
    color: white;
}

/* ==========================================================================
   Course Pricing Widget Styles
   ========================================================================== */

.ld-pricing-container {
    background: #ffffff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.ld-pricing-display {
    margin-bottom: 20px;
}

.ld-price-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.ld-regular-price,
.ld-sale-price {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.ld-original-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
}

.ld-sale-price {
    color: #e74c3c;
}

/* Strikethrough class for regular price when there's a discount */
.ld-strikethrough {
    text-decoration: line-through;
    color: #999;
}

/* Currency symbol styling */
.ld-currency-symbol {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    /* Add any specific styling for currency symbol here */
}

/* Normal price styling for non-discounted courses */
.ld-normal-price {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
}

/* Grid context - smaller normal price */
.ld-course-pricing .ld-normal-price {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
}

.ld-enrollment-button {
    display: inline-block;
    background: #27ae60;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 200px;
}

.ld-enrollment-button:hover {
    background: #219a52;
    transform: translateY(-2px);
    color: white;
}

.ld-enrollment-button.enrolled {
    background: #3498db;
}

.ld-enrollment-button.enrolled:hover {
    background: #2980b9;
}

.ld-enrollment-button.sold-out {
    background: #e74c3c;
    cursor: not-allowed;
}

.ld-price-error {
    color: #e74c3c;
    font-style: italic;
}

/* ==========================================================================
   Course Enrollment Widget Styles
   ========================================================================== */

.ld-enrollment-widget {
    /* Removed default styling to allow custom theme styles */
    /* background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;*/
}

.ld-course-info {
    text-align: center;
    margin-bottom: 25px;
}

.ld-course-info h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #2c3e50;
}

.ld-course-thumbnail {
    margin: 15px 0;
}

.ld-course-thumbnail img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

.ld-course-excerpt {
    color: #666;
    line-height: 1.6;
    margin: 15px 0;
}

.ld-pricing-info {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.ld-enrollment-form {
    text-align: center;
    margin-top: 25px;
}

.ld-enrollment-form.ld-sold-out {
    background: #ffeaea;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 20px;
}

.ld-stock-message {
    color: #e74c3c;
    font-weight: 600;
    margin: 0;
}

.ld-enrollment-submit {
    background: #27ae60;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.ld-enrollment-submit:hover {
    background: #219a52;
    transform: translateY(-2px);
}

.ld-login-required {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
}

.ld-login-required p {
    margin: 0 0 10px 0;
    color: #856404;
}

.ld-login-required a {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
}

.ld-enrollment-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.ld-enrollment-success p {
    margin: 0 0 15px 0;
    color: #155724;
}

.ld-continue-learning {
    background: #27ae60;
    color: white;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.ld-continue-learning:hover {
    background: #219a52;
    color: white;
}

/* ==========================================================================
   Course Stock Display Widget Styles
   ========================================================================== */

.ld-stock-display {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ld-stock-display.ld-stock-low {
    border-left: 4px solid #f39c12;
}

.ld-stock-display.ld-stock-sold-out {
    border-left: 4px solid #e74c3c;
}

.ld-stock-unlimited {
    border-left: 4px solid #27ae60;
}

.ld-stock-error {
    border-left: 4px solid #e74c3c;
    background: #ffeaea;
}

/* Simple Display */
.ld-stock-simple {
    text-align: center;
}

.ld-stock-remaining {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.ld-stock-details {
    color: #666;
    font-size: 14px;
}

.ld-stock-sold-out-text {
    color: #e74c3c;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Progress Display */
.ld-stock-progress {
    text-align: center;
}

.ld-stock-progress-bar {
    width: 100%;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ld-stock-progress-fill {
    height: 100%;
    background: #3498db;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.ld-stock-progress.ld-stock-low .ld-stock-progress-fill {
    background: #f39c12;
}

.ld-stock-progress.ld-stock-sold-out .ld-stock-progress-fill {
    background: #e74c3c;
}

.ld-stock-progress-text {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

/* Counter Display */
.ld-stock-counter {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.ld-stock-counter-item {
    flex: 1;
}

.ld-stock-counter-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.ld-stock-counter-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

/* Badge Display */
.ld-stock-badge {
    text-align: center;
}

.ld-stock-badge-item {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.ld-badge-available {
    background: #d4edda;
    color: #155724;
}

.ld-badge-low-stock {
    background: #fff3cd;
    color: #856404;
}

.ld-badge-sold-out {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ld-course-grid.columns-2,
    .ld-course-grid.columns-3,
    .ld-course-grid.columns-4,
    .ld-course-grid.columns-6 {
        grid-template-columns: 1fr;
    }
    
    .ld-course-card {
        margin-bottom: 20px;
    }
    
    .ld-pricing-container,
    .ld-enrollment-widget {
        /* removed default responsive padding/margin */
        /* margin: 0 10px;
        padding: 20px;*/
    }
    
    .ld-stock-counter {
        flex-direction: column;
        gap: 15px;
    }
    
    .ld-price-display {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .ld-course-content {
        padding: 15px;
    }
    
    .ld-course-title {
        font-size: 16px;
    }
    
    .ld-enrollment-button,
    .ld-enrollment-submit {
        width: 100%;
        padding: 12px 20px;
    }
    
    .ld-stock-counter-number {
        font-size: 20px;
    }
} 