/**
 * Activities Table - Mobile Styles
 * Div-based mobile card design from Figma (node 332-317)
 * 
 * @package Activities_Table
 */

/* Desktop Only - Hide mobile cards on desktop */
@media screen and (min-width: 981px) {
    .mobile-only {
        display: none !important;
    }
    
    .desktop-only {
        display: block;
    }

    .table-container {
        overflow-x: auto;
    }

    .activities-table {
        min-width: 1200px;
    }
}

/* Mobile Styles */
@media screen and (max-width: 980px) {
    /* Hide desktop table, show mobile cards */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block;
    }

    /* Search Box */
    .controls-row {
        margin-bottom: 20px;
    }

    .search-box {
        width: 100%;
        max-width: 100%;
    }

    .search-box input {
        height: 53px;
        font-size: 18px;
        padding: 12px 50px 12px 16px;
    }

    /* Filter Section - Mobile Layout */
    .filter-section {
        margin-bottom: 32px;
    }


    /* Hide filter dropdowns on mobile */
    .filter-dropdowns {
        display: none;
    }

    /* Mobile Filter Button */
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 4px 20px;
        border: 1px solid #283565;
        border-radius: 8px;
        background-color: white;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 17px;
        line-height: 30px;
        color: #283565;
        cursor: pointer;
    }

    /* Results Count and Filter Button Container */
    .results-and-filter-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 58px;
    }

    .results-count {
        font-size: 17px;
        line-height: 30px;
        text-align: right;
        margin: 0;
        flex: 1;
    }

    /* Cards Container */
    .cards-container {
        width: 100%;
    }

    /* Cards Header */
    .cards-header {
        background-color: #283565;
        height: 50px;
        border-radius: 8px 8px 0 0;
        padding: 12px;
        display: flex;
        align-items: center;
    }

    .cards-header-text {
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 17px;
        font-weight: 600;
        line-height: 25.698px;
        color: white;
        text-align: right;
    }

    /* Cards List */
    .cards-list {
        width: 100%;
    }

    /* Activity Card */
    .activity-card {
        display: flex;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        background-color: white;
        align-items: stretch;
    }

    .activity-card.card-alt {
        background-color: #f8fcff;
    }

    /* Card Toggle (Right Side) */
    .card-toggle {
        width: 56px;
        min-width: 56px;
        max-width: 56px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 12px 0;
    }

    .accordion-toggle {
        cursor: pointer;
        margin-top: 3px;
    }

    .activity-card.expanded .accordion-toggle svg {
        transform: rotate(45deg);
    }

    .accordion-toggle svg {
        width: 20px;
        height: 20px;
        background-color: #283565;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1.481px;
        transition: transform 0.3s ease;
    }

    /* Card Content (Left Side) */
    .card-content {
        display: flex;
        flex-direction: column;
        width: calc(100% - 56px);
        max-width: 297px;
        padding: 12px 0 18px 0;
    }

    /* Activity Name */
    .card-name {
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 17px;
        font-weight: 700;
        line-height: 25.698px;
        color: #283565;
        text-align: right;
        margin-bottom: 11px;
    }

    /* Health Domain Badges */
    .card-badges {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 14px;
    }

    .card-badges .badge {
        display: inline-block;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 14px;
        line-height: 20.558px;
        height: 28.331px;
        padding: 4px 8px;
        margin: 0;
        border-radius: 10.279px;
    }

    /* Collapsed Info (Duration + Class inline) */
    .card-collapsed-info {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .activity-card.expanded .card-collapsed-info {
        display: none;
    }

    .card-class,
    .card-duration {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 16px;
        line-height: 22px;
        color: #283565;
        text-align: right;
    }

    .card-class {
        margin-left: 8px;
    }

    /* Icons for Collapsed State */
    .card-class::before,
    .card-duration::before {
        content: '';
        display: inline-block;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        flex-shrink: 0;
    }

    .card-duration::before {
        background-image: url('/wp-content/uploads/2025/11/sand-clock.png');
        width: 13px;
        height: 19px;
    }

    .card-class::before {
        background-image: url('/wp-content/uploads/2025/11/study-hat.png');
        width: 23px;
        height: 13px;
    }

    /* Expanded Content - Hidden by default */
    .card-expanded-content {
        display: none;
        flex-direction: column;
        gap: 0;
    }

    .activity-card.expanded .card-expanded-content {
        display: flex;
    }

    /* Activity Goal - Expanded */
    .card-goal {
        display: flex;
        width: 280px;
        max-width: 280px;
        padding: 8px 0;
        gap: 8px;
        align-items: flex-start;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 16px;
        line-height: 22px;
        color: #283565;
        text-align: right;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        word-wrap: break-word;
    }

    /* Recommended Timing - Expanded */
    .card-timing {
        display: flex;
        width: 280px;
        max-width: 280px;
        gap: 8px;
        padding: 8px 0;
        align-items: flex-start;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 16px;
        line-height: 22px;
        color: #283565;
        text-align: right;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        word-wrap: break-word;
    }

    /* Duration - Expanded */
    .card-duration-expanded {
        display: flex;
        width: 280px;
        max-width: 280px;
        padding: 8px 0;
        gap: 8px;
        align-items: center;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 16px;
        line-height: 22px;
        color: #283565;
        text-align: right;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* Class - Expanded */
    .card-class-expanded {
        display: flex;
        width: 280px;
        max-width: 280px;
        padding: 8px 0;
        gap: 8px;
        align-items: center;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 16px;
        line-height: 22px;
        color: #283565;
        text-align: right;
    }

    .card-mobile-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 23px;
        height: auto;
    }

    /* Details Button */
    .card-actions {
        display: flex;
        width: 280px;
        max-width: 280px;
        padding: 12px 0 0 0;
        justify-content: center;
    }

    .card-actions .details-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 280px;
        height: 42px;
        gap: 10px;
        border: 1px solid #40cecf;
        border-radius: 12px;
        background-color: transparent;
        color: #40cecf;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 17px;
        font-weight: 500;
        line-height: 32.933px;
        text-decoration: none;
        cursor: pointer;
    }

    .card-actions .details-link svg {
        width: 21.403px;
        height: 21.403px;
        transform: rotate(180deg);
    }

    /* No Activities Message */
    .no-activities {
        text-align: center;
        padding: 40px 20px;
        font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
        font-size: 18px;
        color: #283565;
    }

    /* Pagination */
    .pagination {
        flex-direction: column-reverse;
        gap: 20px;
        padding: 20px 0;
        margin-top: 20px;
    }

    .pagination-info {
        text-align: center;
        width: 100%;
        font-size: 16px;
    }

    .pagination-actions {
        width: 100%;
        justify-content: center;
        display: flex;
        gap: 10px;
    }

    .pagination-btn {
        flex: 1;
        max-width: 150px;
        font-size: 16px;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 480px) {

    .search-box input {
        font-size: 16px;
        height: 48px;
    }

    .results-count,
    .mobile-filter-btn {
        font-size: 16px;
    }

    .card-name {
        font-size: 16px;
    }

    .card-badges .badge {
        font-size: 13px;
    }

    .card-class,
    .card-duration,
    .card-goal,
    .card-timing,
    .card-duration-expanded,
    .card-class-expanded {
        font-size: 15px;
    }

    .card-actions .details-link {
        font-size: 16px;
        height: 40px;
    }

    .pagination-btn {
        font-size: 15px;
        padding: 8px 14px;
    }

    .card-content {
        width: calc(90% - 56px);
        max-width: calc(90% - 56px);
    }

    .card-goal,
    .card-timing,
    .card-duration-expanded,
    .card-class-expanded,
    .card-actions {
        width: 100%;
        max-width: 100%;
    }

    .card-actions .details-link {
        width: 100%;
    }
}

/* Mobile Filter Overlay Styles */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.mobile-filter-overlay.active {
    display: block;
}

/* Overlay Backdrop */
.overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-overlay.active .overlay-backdrop {
    opacity: 1;
}

/* Overlay Sheet */
.overlay-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background-color: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0px -104px 29px 0px rgba(135,135,135,0),
                0px -66px 27px 0px rgba(135,135,135,0.01),
                0px -37px 22px 0px rgba(135,135,135,0.03),
                0px -17px 17px 0px rgba(135,135,135,0.06),
                0px -4px 9px 0px rgba(135,135,135,0.06);
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-filter-overlay.active .overlay-sheet {
    transform: translateY(0);
}

/* Dragging state - disable transition for smooth following */
.overlay-sheet.dragging {
    transition: none;
}

/* Overlay Handle Container */
.overlay-handle-container {
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
    padding-top: 12px;
    z-index: 10;
    background-color: white;
}

.overlay-handle-container:active {
    cursor: grabbing;
}

/* Overlay Handle (Visual) */
.overlay-handle {
    width: 30px;
    height: 4px;
    background-color: #d9d9d9;
    border-radius: 8px;
    pointer-events: none;
}

/* Multi-Screen System */
.overlay-screen {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    background-color: white;
}

/* Main Screen - starts visible */
.overlay-main-screen.active {
    transform: translateX(0);
    z-index: 2;
}

.overlay-main-screen:not(.active) {
    transform: translateX(100%);
    z-index: 1;
}

/* Timing Screen - starts hidden to the right (RTL) */
.overlay-timing-screen {
    transform: translateX(-100%);
    z-index: 1;
}

.overlay-timing-screen.active {
    transform: translateX(0);
    z-index: 2;
}

/* Overlay Content */
.overlay-content {
    padding: 0 20px 48px;
    flex: 1;
    overflow-y: auto;
    height: 100%;
}

.overlay-title {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 500;
    font-size: 17px;
    line-height: 25.698px;
    color: #283565;
    text-align: right;
    margin: 0 0 20px 0;
}

/* Filter Block */
.filter-block {
    margin-bottom: 20px;
}

.filter-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-block-title {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 500;
    font-size: 16px;
    color: #283565;
    margin: 0;
}

.filter-clear-btn {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 16px;
    color: #283565;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Health Domain Badges */
.filter-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: flex-start;
}

.filter-badge {
    height: 28.331px;
    padding: 4px 10px;
    border-radius: 10px;
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 18px;
    line-height: 20.558px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-badge.selected {
    border-color: #0052b4;
}

/* Class Badges */
.filter-class-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-class-badge {
    width: 52px;
    height: 32px;
    padding: 6px 13px;
    background-color: #f2f4f7;
    border: 2px solid transparent;
    border-radius: 16px;
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #4b4b4b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-class-badge.selected {
    border-color: #40cecf;
}

/* Duration Slider */
.filter-slider-container {
    width: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
}

.duration-slider {
    width: 100%;
    height: 6px;
    border-radius: 20px;
    background: #f2f4f7;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.duration-slider::-webkit-slider-track {
    width: 100%;
    height: 6px;
    border-radius: 20px;
    background: linear-gradient(to left, #f2f4f7 var(--slider-progress, 0%), #283565 var(--slider-progress, 0%));
}

.duration-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 20px;
    background: #f2f4f7;
}

.duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e9effe;
    border: 2px solid #40cecf;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.duration-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #40cecf;
    border: 2px solid #e9effe;
    cursor: pointer;
}

.duration-slider::-moz-range-progress {
    background-color: #283565;
    height: 6px;
    border-radius: 20px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.slider-value,
.slider-max {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 17px;
    color: #283565;
}

.slider-max {
    color: #d0d5dd;
}

/* Filter Divider */
.filter-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

/* Filter Navigation Row (for clickable filter that opens new screen) */
.filter-nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-nav-row:hover {
    background-color: rgba(40, 53, 101, 0.05);
}

.filter-nav-row .filter-block-title {
    flex: 1;
    text-align: right;
    margin: 0;
}

.filter-nav-row .nav-row-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
}

.filter-nav-row .nav-row-left svg {
    width: 11px;
    height: 19px;
}

/* Timing Screen Styles */
.timing-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin-bottom: 16px;
}

.timing-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
}

.timing-back-btn svg {
    width: 8px;
    height: 16px;
}

.timing-screen-title {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 500;
    font-size: 17px;
    line-height: 25.698px;
    color: #283565;
    text-align: center;
    flex: 1;
    margin: 0;
}

.timing-clear-btn {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 16px;
    color: #283565;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.timing-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

/* Timing Options List */
.timing-options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.timing-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
}

.timing-option-label input[type="checkbox"] {
    display: none;
}

.timing-text {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    color: #4b4b4b;
    flex: 1;
    text-align: right;
}

.timing-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d5dd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.timing-option-label input[type="checkbox"]:checked ~ .timing-checkbox-custom {
    background-color: #40cecf;
    border-color: #40cecf;
}

.timing-option-label input[type="checkbox"]:checked ~ .timing-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5.5px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.timing-option-label input[type="checkbox"]:checked ~ .timing-text {
    color: #283565;
}

/* Goal Screen Styles */
.goal-screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin-bottom: 16px;
}

.goal-back-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
}

.goal-back-btn svg {
    width: 8px;
    height: 16px;
}

.goal-screen-title {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 500;
    font-size: 17px;
    line-height: 25.698px;
    color: #283565;
    text-align: center;
    flex: 1;
    margin: 0;
}

.goal-clear-btn {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 16px;
    color: #283565;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.goal-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

/* Goal Options List */
.goal-options-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
}

.goal-option-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
}

.goal-option-label input[type="checkbox"] {
    display: none;
}

.goal-text {
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    color: #4b4b4b;
    flex: 1;
    text-align: right;
}

.goal-checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d0d5dd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.goal-option-label input[type="checkbox"]:checked + .goal-checkbox-custom {
    background-color: #40cecf;
    border-color: #40cecf;
}

.goal-option-label input[type="checkbox"]:checked + .goal-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5.5px;
    width: 4px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.goal-option-label input[type="checkbox"]:checked ~ .goal-text {
    color: #283565;
}

/* Goal Screen Transitions */
.overlay-goal-screen {
    transform: translateX(-100%);
    z-index: 1;
}

.overlay-goal-screen.active {
    transform: translateX(0);
    z-index: 2;
}

/* Action Buttons */
.overlay-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.overlay-apply-btn,
.overlay-clear-all-btn {
    flex: 1;
    height: 46px;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Heebo-New',Helvetica,Arial,Lucida,sans-serif !important;
    font-weight: 500;
    font-size: 17px;
    line-height: 19.034px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.overlay-apply-btn {
    background-color: #283565;
    color: white;
    border: none;
}

.overlay-apply-btn:hover {
    background-color: #1f2a4d;
}

.overlay-clear-all-btn {
    background-color: white;
    color: #283565;
    border: 1px solid black;
}

.overlay-clear-all-btn:hover {
    background-color: #f8f8f8;
}

/* Disable body scroll when overlay is open */
body.overlay-open {
    overflow: hidden;
}
