
/* Past Productions card layout for mobile */
@media (max-width: 1024px) {
    .past-productions-cards-container {
        display: flex;
        flex-direction: column;
        gap: var(--cp-spacing-medium);
        padding: var(--cp-spacing-medium);
    }

    .past-productions-card {
        background: var(--cp-gradient-subtle-blue);
        border: 1px solid #dde1e6;
        border-radius: 8px;
        padding: var(--cp-spacing-medium);
        box-shadow: 0 8px 24px rgba(203, 213, 225, 0.6), 0 4px 12px rgba(203, 213, 225, 0.4), 0 2px 4px rgba(203, 213, 225, 0.2);
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: var(--cp-spacing-medium);
        flex-direction: row !important;

    }

    .past-productions-card .card-content {
        flex: 1 !important;
        min-width: 0 !important; /* Allow text to shrink */
        display: flex !important;
        flex-direction: column !important;

    }

    .past-productions-card .production-title {
        margin: 0 0 var(--cp-spacing-xs) 0;
        font-size: 20px !important;
        color: var(--cp-mobile-bg-red);
        font-weight: bold;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .past-productions-card .production-dates {
        margin: 0 0 var(--cp-spacing-xs) 0;
        font-size: 16px !important;
        color: #333;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .past-productions-card .production-director {
        margin: 0;
        font-size: 14px !important;
        color: #666;
        font-weight: 500;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .production-icons-row {
        display: flex !important;
        gap: var(--cp-spacing-xs);
        flex-shrink: 0 !important;
        align-items: flex-start !important;
        flex-direction: column !important;

    }

    .production-icon {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: auto;
        min-width: 80px;
        height: 32px;
        border-radius: 6px;
        background: var(--cp-gradient-enhanced-gold);
        border: 1px solid #ffe082;
        transition: all 0.3s ease;
        flex-shrink: 0;
        text-decoration: none;
        color: #8b5a00;
        position: relative;
        padding: 0 var(--cp-spacing-small);
        gap: var(--cp-spacing-xs);
        box-shadow: 0 4px 12px rgba(255, 224, 130, 0.5), 0 2px 6px rgba(255, 224, 130, 0.4), 0 1px 3px rgba(255, 224, 130, 0.3);
    }

    .production-icon:hover {
        background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 50%, #ffe082 100%);
        color: #6d4200;
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(255, 224, 130, 0.6), 0 4px 12px rgba(255, 224, 130, 0.5), 0 2px 6px rgba(255, 224, 130, 0.4);
    }

    .production-icon-label {
        font-size: 11px;
        font-weight: 600;
        color: #600;
        white-space: nowrap;
    }

    /* CSS-based icons instead of images */
    .production-icon::before {
        content: '';
        display: block;
        width: 16px;
        height: 16px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        flex-shrink: 0;
    }

    /* Photos icon */
    .production-icon.photos::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
    }

    /* Poster icon */
    .production-icon.poster::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z'/%3E%3C/svg%3E");
    }

    /* Program icon */
    .production-icon.program::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    }

    /* Video icon */
    .production-icon.video::before {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E");
    }

    /* Fallback for existing images */
    .production-icon img {
        width: 16px !important;
        height: 16px !important;
        max-width: 16px !important;
        max-height: 16px !important;
        flex-shrink: 0;
    }
}

/* Medium screens - allow title wrapping */
@media (max-width: 768px) and (min-width: 481px) {
    .past-productions-card .production-title {
        white-space: normal;
        line-height: 1.3;
    }
}

/* Fallback for very small screens */
@media (max-width: 480px) {
    .past-productions-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .past-productions-card .production-title {
        white-space: normal;
        line-height: 1.3;
    }

    .past-productions-card .production-director {
        white-space: normal;
    }

    .past-productions-card .production-dates {
        white-space: normal;
    }

    .production-icons-row {
        align-self: center;
        /*margin-top: var(--cp-spacing-small);*/
    }
}

/* Alternative: Ultra-compact list layout */
.past-productions-cards-container.compact-list {
    gap: var(--cp-spacing-small);
    padding: 0; /*var(--cp-spacing-small);*/
}

.past-productions-cards-container.compact-list .past-productions-card {
    padding: var(--cp-spacing-small);
    border-radius: 4px;
    background: var(--cp-gradient-subtle-blue);
    border: 1px solid #dde1e6;
    border-left: 4px solid var(--cp-mobile-bg-red);
    box-shadow: 0 6px 16px rgba(203, 213, 225, 0.5), 0 3px 8px rgba(203, 213, 225, 0.3), 0 1px 3px rgba(203, 213, 225, 0.2);
}

.past-productions-cards-container.compact-list .past-productions-card .production-title {
    font-size: 18px;
    margin: 0 0 var(--cp-spacing-xs) 0;
}

.past-productions-cards-container.compact-list .past-productions-card .production-dates {
    font-size: 14px;
    margin: 0 0 var(--cp-spacing-xs) 0;
}

.past-productions-cards-container.compact-list .past-productions-card .production-director {
    font-size: 12px;
    margin: 0;
}

.past-productions-cards-container.compact-list .production-icons-row {
    gap: var(--cp-spacing-xs);
}

.past-productions-cards-container.compact-list .production-icon {
    width: auto;
    min-width: 70px;
    height: 28px;
    padding: 0 var(--cp-spacing-xs);
    background: var(--cp-gradient-enhanced-gold);
    border: 1px solid #ffe082;
    color: #8b5a00;
    box-shadow: 0 3px 10px rgba(255, 224, 130, 0.5), 0 2px 5px rgba(255, 224, 130, 0.4), 0 1px 3px rgba(255, 224, 130, 0.3);
}

.past-productions-cards-container.compact-list .production-icon::before {
    width: 16px;
    height: 16px;
}

.past-productions-cards-container.compact-list .production-icon-label {
    font-size: 12px;
}

.past-productions-cards-container.compact-list .production-icon img {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
}

/* ============================================================================
   DATATABLES CONTROLS STYLING
   ============================================================================ */

/* Past Productions wrapper for mobile */
.past-productions-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--cp-spacing-medium);
}

/* Hide cards when they don't match search (DataTables will handle this) */
.past-productions-wrapper .past-productions-card {
    transition: opacity 0.3s ease;
}

/* When DataTables hides rows, we need to hide corresponding cards */
.past-productions-wrapper .past-productions-card.hidden {
    display: none;
}

/* Ensure search-hidden cards are properly hidden */
.past-productions-wrapper .past-productions-card.cp-search-hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Custom search styling - inline layout */
.cp-custom-search {
    margin-bottom: var(--cp-spacing-medium);
    display: flex;
    align-items: center;
    gap: var(--cp-spacing-sm);
    position: relative;
}

.cp-custom-search label {
    /* Match committee form label styling */
    font-weight: 600;
    color: var(--cp-text-primary);
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cp-search-input {
    /* Enhanced prominent search input styling */
    width: 98% !important;
    padding: 12px 40px 12px 12px !important;
    border: 2px solid var(--cp-primary) !important;
    border-radius: 8px !important;
    font-size: 16px;
    font-weight: 500;
    background-color: #ffffff;
    color: var(--cp-text-primary);
    transition: all var(--cp-transition-fast);
    min-width: 200px;
    max-width: 400px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(129, 35, 18, 0.15), inset 0 1px 3px rgba(0,0,0,0.1) !important;
    position: relative;
}

.cp-search-input:focus {
    outline: none;
    border-color: var(--cp-primary) !important;
    box-shadow: 0 0 0 4px rgba(129, 35, 18, 0.2), 0 4px 12px rgba(129, 35, 18, 0.25), inset 0 1px 3px rgba(0,0,0,0.1) !important;
    transform: translateY(-1px);
}

/* X icon inside search input */
.cp-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    font-weight: normal;
    line-height: 1;
    padding: 0;
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--cp-transition-fast);
    z-index: 1000;
}

.cp-search-clear:hover {
    color: var(--cp-primary);
    background: rgba(129, 35, 18, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.cp-search-clear:focus {
    outline: none;
    background: var(--cp-primary-light);
    box-shadow: 0 0 0 3px rgba(129, 35, 18, 0.3);
}

/* Override mobile button styling for search clear button */
@media screen and (max-width: 767px) {
    .cp-search-clear {
        width: 20px !important;
        max-width: 20px !important;
        height: 20px !important;
        padding: 0 !important;
        font-size: 28px !important;
        margin-bottom: 0 !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 1000 !important;
    }
}

.cp-search-input::placeholder {
    color: var(--cp-text-muted);
}

/* No results message styling */
.cp-no-results {
    text-align: center;
    padding: var(--cp-spacing-xl);
    background-color: #f8f9fa;
    border-radius: var(--cp-radius-sm);
    border: 1px solid var(--cp-border-light);
    margin: var(--cp-spacing-medium) 0;
}

.cp-no-results-content p {
    margin: 0 0 var(--cp-spacing-md) 0;
    color: var(--cp-text-secondary);
    font-size: 16px;
}

.cp-clear-search {
    background-color: var(--cp-primary);
    color: white;
    border: none;
    border-radius: var(--cp-radius-sm);
    padding: var(--cp-spacing-sm) var(--cp-spacing-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--cp-transition-fast);
}

.cp-clear-search:hover {
    background-color: var(--cp-primary-hover);
}

/* Ensure DataTables controls are visible on mobile */
@media (max-width: 768px) {
    .past-productions-wrapper .dt-layout-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--cp-spacing-medium);
        padding: 0;
    }
    
    .past-productions-wrapper .dt-layout-cell {
        padding: 0;
    }
    
    /* Make DataTables table responsive on mobile */
    .tablepress {
        width: 100% !important;
        font-size: 14px;
    }
    
    .tablepress th,
    .tablepress td {
        padding: 8px 4px !important;
        font-size: 12px;
        word-wrap: break-word;
    }
    
    .tablepress th {
        background-color: var(--cp-primary);
        color: white;
        font-weight: 600;
    }
    
    .tablepress tbody tr:nth-child(even) {
        background-color: #f8f9fa;
    }
    
    .tablepress tbody tr:hover {
        background-color: #e9ecef;
    }
}

/* Hide the "entries per page" section completely */
.dt-length {
    display: none !important;
}

/* Style the search input to match CP design system */
.dt-search {
    margin: var(--cp-spacing-medium) 0;
    display: flex !important;
    align-items: center;
    gap: var(--cp-spacing-sm);
}

.dt-search label {
    font-weight: 600;
    color: var(--cp-text-primary);
    margin: 0;
    font-size: 14px;
}

.dt-search .dt-input {
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-radius-sm);
    padding: var(--cp-spacing-sm) var(--cp-spacing-md);
    font-size: 14px;
    background-color: #ffffff;
    color: var(--cp-text-primary);
    transition: border-color var(--cp-transition-fast);
    min-width: 200px;
    max-width: 300px;
}

.dt-search .dt-input:focus {
    outline: none;
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 2px rgba(129, 35, 18, 0.1);
}

.dt-search .dt-input::placeholder {
    color: var(--cp-text-muted);
}

/* Style the layout row to remove unwanted spacing */
.dt-layout-row {
    margin-bottom: var(--cp-spacing-md);
    padding: 0;
}

.dt-layout-cell {
    padding: 0;
}

/* ============================================================================
   MOBILE LIGHTBOX STYLES
   ============================================================================ */

/* Lightbox overlay */
.mobile-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* Lightbox close button */
.mobile-lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100001;
    transition: background-color 0.2s ease;
}

.mobile-lightbox-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Lightbox image container */
.mobile-lightbox-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Lightbox image */
.mobile-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Lightbox title */
.mobile-lightbox-title {
    color: white;
    margin: 15px 0 0 0;
    font-size: 16px;
    text-align: center;
    max-width: 100%;
}

/* Responsive adjustments for very small screens */
@media (max-width: 480px) {
    .mobile-lightbox-overlay {
        padding: 15px;
    }
    
    .mobile-lightbox-close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .mobile-lightbox-title {
        font-size: 14px;
        margin: 10px 0 0 0;
    }
}
