/**
 * LearnDash Course Counter - Countdown Widget Styles
 */

.ldcc-countdown-container {
    direction: rtl;
    text-align: center;
    width: 100%;
}

.ldcc-countdown-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    direction: rtl;
    flex-direction: row-reverse;
    gap: 20px;
}

.ldcc-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    flex: 0 0 auto;
}

.ldcc-countdown-item .ldcc-countdown-cards-group {
    display: flex;
    direction: ltr;
    gap: 5px;
}

.ldcc-countdown-card {
    position: relative;
    background-color: #FFFFFF;
    border-radius: 12px;
    width: 88px;
    height: 88px;
    min-width: 88px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 4px solid #F7931E;
}

.ldcc-countdown-number {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ldcc-countdown-label {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 400;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    text-align: center;
    width: 100%;
    flex-basis: 100%;
}

/* Responsive design */
@media (max-width: 1024px) {
    .ldcc-countdown-card {
        width: 75px;
        height: 75px;
        min-width: 75px;
        border-radius: 10px;
        border-top-width: 3px;
    }
    
    .ldcc-countdown-number {
        font-size: 40px;
    }
    
    .ldcc-countdown-label {
        font-size: 15px;
    }
    
    .ldcc-countdown-wrapper {
        gap: 15px;
        flex-wrap: nowrap;
    }
    
    .ldcc-countdown-item .ldcc-countdown-cards-group {
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .ldcc-countdown-card {
        width: 65px;
        height: 65px;
        min-width: 65px;
        border-radius: 8px;
        border-top-width: 3px;
    }
    
    .ldcc-countdown-number {
        font-size: 34px;
    }
    
    .ldcc-countdown-label {
        font-size: 13px;
        margin-top: 8px;
    }
    
    .ldcc-countdown-wrapper {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .ldcc-countdown-item .ldcc-countdown-cards-group {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .ldcc-countdown-card {
        width: 55px;
        height: 55px;
        min-width: 55px;
        border-radius: 6px;
        border-top-width: 2px;
    }
    
    .ldcc-countdown-number {
        font-size: 28px;
    }
    
    .ldcc-countdown-label {
        font-size: 11px;
        margin-top: 6px;
    }
    
    .ldcc-countdown-wrapper {
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .ldcc-countdown-item .ldcc-countdown-cards-group {
        gap: 2px;
    }
    
    .ldcc-countdown-container {
        padding: 0 10px;
    }
}

@media (max-width: 360px) {
    .ldcc-countdown-card {
        width: 48px;
        height: 48px;
        min-width: 48px;
        border-radius: 5px;
        border-top-width: 2px;
    }
    
    .ldcc-countdown-number {
        font-size: 24px;
    }
    
    .ldcc-countdown-label {
        font-size: 10px;
        margin-top: 5px;
    }
    
    .ldcc-countdown-wrapper {
        gap: 3px;
        flex-wrap: wrap;
    }
    
    .ldcc-countdown-item .ldcc-countdown-cards-group {
        gap: 2px;
    }
}

/* Animation for number changes */
.ldcc-countdown-number {
    transition: transform 0.3s ease;
}

.ldcc-countdown-number.updating {
    transform: scale(1.1);
}

/* No date message */
.ldcc-countdown-no-date {
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

/* Lesson Title Widget Styles */
.ldcc-lesson-title-wrapper {
    direction: rtl;
}

.ldcc-lesson-title-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.ldcc-lesson-prefix {
    color: #666666;
    font-weight: 400;
}

.ldcc-lesson-title {
    color: #000000;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0;
}

.ldcc-lesson-title:hover {
    color: #F7931E;
}

.ldcc-lesson-no-course,
.ldcc-lesson-no-lesson {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
}

/* Lessons List Widget Styles */
.ldcc-lessons-list {
    direction: rtl;
}

.ldcc-lesson-item {
    background-color: #FFFFFF;
    border-top: 4px solid #F7931E;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ldcc-lesson-item:not(:last-child) {
    margin-bottom: 15px;
}

.ldcc-lesson-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Lesson Header (clickable part) */
.ldcc-lesson-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    cursor: pointer;
    gap: 20px;
}

/* Image for nearest lesson (left side) */
.ldcc-lesson-image-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
}

.ldcc-lesson-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Content */
.ldcc-lesson-main-content {
    flex: 1;
    min-width: 0;
}

.ldcc-lesson-subtitle {
    font-size: 12px;
    color: #999;
    margin-bottom: 5px;
    font-weight: 400;
}

.ldcc-lesson-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    margin-bottom: 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-align: right;
}

.ldcc-lesson-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #999;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.ldcc-lesson-lock-icon svg {
    width: 100%;
    height: 100%;
}

.ldcc-lesson-date {
    font-size: 14px;
    color: #666666;
    font-weight: 400;
}

/* Thumbnail Image */
.ldcc-lesson-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
}

.ldcc-lesson-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Expand Icon and Zoom Button */
.ldcc-lesson-expand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons Container */
.ldcc-lesson-buttons {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row-reverse;
}

.ldcc-expand-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ldcc-expand-icon:hover {
    background-color: #e0e0e0;
}

.ldcc-expand-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.ldcc-lesson-item.is-expanded .ldcc-expand-icon svg {
    transform: rotate(180deg);
}

/* Zoom Button (replaces expand icon for nearest lesson) */
.ldcc-lesson-zoom-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #F6AD55;
    color: #08295E;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: none;
    white-space: nowrap;
    position: relative;
}

.ldcc-lesson-zoom-button:hover {
    background-color: #ffffff;
    color: #08295E;
}

.ldcc-lesson-zoom-button.is-disabled {
    cursor: not-allowed;
    background-color: #d0d4dc;
    color: #7a889f;
    transform: none;
}

.ldcc-lesson-zoom-button.is-disabled:hover {
    background-color: #d0d4dc;
}

/* Tooltip styles for zoom button - using global tooltip styles */
.ldcc-lesson-zoom-button[data-ldcc-tooltip] {
    position: relative;
}

.ldcc-lesson-zoom-button svg {
    width: 16px;
    height: 16px;
}

/* Zoom Button - Blue Zoom Brand Color */
.ldcc-zoom-button {
    background-color: #2D8CFF !important;
    color: #FFFFFF !important;
}

.ldcc-zoom-button:hover {
    background-color: #1E6FD9 !important;
    color: #FFFFFF !important;
}

.ldcc-zoom-button.is-disabled {
    background-color: #d0d4dc !important;
    color: #7a889f !important;
}

.ldcc-zoom-button.is-disabled:hover {
    background-color: #d0d4dc !important;
}

/* Preparation Button - Keep Orange Style */
.ldcc-preparation-button {
    background-color: #F6AD55 !important;
    color: #08295E !important;
}

.ldcc-preparation-button:hover {
    background-color: #ffffff !important;
    color: #08295E !important;
}

.ldcc-preparation-button.is-disabled {
    background-color: #d0d4dc !important;
    color: #7a889f !important;
}

.ldcc-preparation-button.is-disabled:hover {
    background-color: #d0d4dc !important;
}

/* Nearest lesson - always expanded, no cursor on expand area */
.ldcc-lesson-item.is-nearest.is-expanded .ldcc-lesson-header {
    cursor: default;
}

.ldcc-lesson-item.is-nearest.is-expanded .ldcc-expand-icon {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Lessons with no content - no expand functionality */
.ldcc-lesson-item.no-expand .ldcc-lesson-header {
    cursor: default;
}

/* Expanded Content */
.ldcc-lesson-expanded-content {
    background-color: #fafafa;
    border-radius: 12px;
}

.ldcc-lesson-expanded-inner {
    padding: 30px;
}

/* Sessions Title */
.ldcc-sessions-title, h4.ldcc-sessions-title  {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1a1a1a;
    font-size: 18px;
    font-weight: 500;
}

/* Sessions List */
.ldcc-sessions-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ldcc-sessions-list li {
    margin-bottom: 15px;
    padding-right: 20px;
    line-height: 1.8;
    color: #333;
    font-size: 15px;
    position: relative;
}

.ldcc-sessions-list li:before {
    content: "•";
    position: absolute;
    right: 0;
    color: #F7931E;
    font-weight: bold;
    font-size: 18px;
}

.ldcc-sessions-list li:last-child {
    margin-bottom: 0;
}

/* Fallback for regular content */
.ldcc-lesson-expanded-inner h1,
.ldcc-lesson-expanded-inner h2,
.ldcc-lesson-expanded-inner h3,
.ldcc-lesson-expanded-inner h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.ldcc-lesson-expanded-inner p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.ldcc-lesson-expanded-inner ul,
.ldcc-lesson-expanded-inner ol {
    margin: 15px 0;
    padding-right: 20px;
}

.ldcc-lesson-expanded-inner li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* No Course/Lessons Messages */
.ldcc-lessons-no-course,
.ldcc-lessons-no-lessons {
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .ldcc-lesson-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 15px;
        flex-direction: column;
    }
    
    .ldcc-lesson-image-wrap {
        order: 1;
        width: 100px;
        height: 100px;
    }
    
    .ldcc-lesson-main-content {
        order: 2;
        width: 100%;
    }
    
    .ldcc-lesson-image {
        order: 3;
        width: 100px;
        height: 100px;
    }
    
    .ldcc-lesson-expand,
    .ldcc-lesson-buttons {
        order: 4;
        width: 100%;
        justify-content: center;
    }
    
    .ldcc-lesson-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .ldcc-lesson-zoom-button {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }
    
    .ldcc-lesson-title {
        font-size: 16px;
    }
    
    .ldcc-lesson-lock-icon {
        width: 16px;
        height: 16px;
    }
    
    .ldcc-lesson-date {
        font-size: 13px;
    }
    
    .ldcc-lesson-expanded-inner {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ldcc-lesson-header {
        padding: 12px;
        flex-direction: column;
    }
    
    .ldcc-lesson-title {
        font-size: 14px;
    }
    
    .ldcc-lesson-lock-icon {
        width: 14px;
        height: 14px;
    }
    
    .ldcc-lesson-date {
        font-size: 12px;
    }
    
    .ldcc-lesson-image-wrap {
        width: 80px;
        height: 80px;
    }
    
    .ldcc-lesson-image {
        width: 80px;
        height: 80px;
    }
    
    .ldcc-expand-icon {
        width: 28px;
        height: 28px;
    }
    
    .ldcc-lesson-zoom-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .ldcc-lesson-buttons {
        gap: 8px;
    }
    
    .ldcc-lesson-expanded-inner {
        padding: 15px;
    }
}

