/**
 * Elementor Widgets - Base Styles
 * 
 * Minimal default styles for Event Manager Elementor widgets
 * All styles are overridable through Elementor's style controls
 * 
 * Flexbox-based architecture for maximum flexibility
 */

/* Event Widget Container - Main Flex Container */
.bct-event-widget {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5em;
}

/* Event Container - Flex Item */
.bct-event-container {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
}

.bct-event-title {
    margin: 0 0 1em 0;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-event-description {
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.bct-event-description p {
    margin: 0 0 1em 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-event-description p:last-child {
    margin-bottom: 0;
}

.bct-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    margin-top: 1em;
}

.bct-event-meta > * {
    flex: 0 0 auto;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Schedules Wrapper - Flex Container */
.bct-schedules-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    flex: 1 1 auto;
    width: 100%;
}

/* Schedule Item - Flex Container AND Flex Item */
.bct-schedule-item {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0; /* Important: allows flex children to shrink below content size */
    padding: 1.5em;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
    box-sizing: border-box;
}

/* Schedule Header - Flex Container AND Flex Item */
.bct-schedule-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 1em;
    align-items: baseline;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.bct-schedule-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 0 0 auto;
}

.bct-schedule-time {
    margin: 0;
    font-size: 0.9em;
    color: #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 0 0 auto;
}

.bct-schedule-description {
    margin: 0;
    line-height: 1.5;
    flex: 1 1 100%;
}

.bct-schedule-description p {
    margin: 0 0 0.5em 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-schedule-description p:last-child {
    margin-bottom: 0;
}

/* Presentations Wrapper - Grid Layout BUT Flex Item */
.bct-presentations-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Default: 1 column, overridden by inline style */
    gap: 1em;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0; /* Critical: allows grid to shrink */
    max-width: 100%;
    margin-top: 1em;
    box-sizing: border-box;
}

/* Presentation Item - Grid Item AND Flex-aware */
.bct-presentation-item {
    display: flex;
    flex-direction: column;
    padding: 1em;
    border-left: 3px solid #007cba;
    background: #ffffff;
    min-width: 0; /* Important: allows text to wrap properly in grid */
    box-sizing: border-box;
}

.bct-presentation-title {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-presentation-description {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
    color: #333;
}

.bct-presentation-description p {
    margin: 0 0 0.5em 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-presentation-description p:last-child {
    margin-bottom: 0;
}

/* Empty States */
.bct-no-schedules,
.bct-no-presentations {
    margin: 1em 0;
    padding: 1em;
    background: #f0f0f0;
    border-radius: 4px;
    color: #666;
    font-style: italic;
}

/* Editor Placeholders */
.bct-event-widget-placeholder,
.bct-event-widget-error {
    padding: 2em;
    text-align: center;
    background: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 4px;
    color: #666;
}

.bct-event-widget-error {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bct-event-widget {
        gap: 1em;
    }
    
    .bct-event-title {
        font-size: 1.5em;
    }
    
    .bct-schedule-title {
        font-size: 1.25em;
    }
    
    .bct-presentation-title {
        font-size: 1em;
    }
    
    /* Stack event meta items vertically on mobile */
    .bct-event-meta {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .bct-event-meta > * {
        flex: 1 1 100%;
    }
    
    /* Schedule header - stack vertically on mobile */
    .bct-schedule-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
    
    .bct-schedule-title,
    .bct-schedule-time,
    .bct-schedule-description {
        flex: 1 1 100%;
        width: 100%;
    }
    
    /* Reduce padding on mobile */
    .bct-schedule-item {
        padding: 1em;
    }
    
    .bct-presentation-item {
        padding: 0.75em;
    }
    
    /* Force single column on mobile for presentations */
    .bct-presentations-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure text doesn't overflow on mobile */
    .bct-event-description,
    .bct-schedule-description,
    .bct-presentation-description {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

/* Print Styles */
@media print {
    .bct-event-widget {
        page-break-inside: avoid;
    }
    
    .bct-schedule-item {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   Speaker Display Widget Styles
   ============================================================================ */

/* Speaker Widget Container */
.bct-speaker-widget {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2em;
}

/* Speaker Profile Container */
.bct-speaker {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 100%;
}

/* Speaker Header - Photo + Info side-by-side */
.bct-speaker__header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5em;
    align-items: flex-start;
    margin-bottom: 1.5em;
}

/* Photo Container */
.bct-speaker__photo {
    flex: 0 0 auto;
    margin: 0;
}

.bct-speaker__photo img {
    display: block;
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

/* Speaker Info Container */
.bct-speaker__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.bct-speaker__name {
    margin: 0;
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-speaker__title {
    margin: 0;
    font-size: 1.1em;
    color: #666;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Social Icons */
.bct-speaker__social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.5em;
}

.bct-speaker__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bct-speaker__social a:hover {
    transform: translateY(-2px);
}

/* Bio */
.bct-speaker__bio {
    margin-top: 1em;
    line-height: 1.6;
}

.bct-speaker__bio p {
    margin: 0 0 1em 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bct-speaker__bio p:last-child {
    margin-bottom: 0;
}

/* Talks Section */
.bct-speaker-talks {
    display: flex;
    flex-direction: column;
    margin-top: 2em;
    padding-top: 2em;
    border-top: 2px solid #e0e0e0;
}

.bct-speaker-talks__title {
    margin: 0 0 1.5em 0;
    font-size: 1.75em;
    font-weight: 700;
    line-height: 1.2;
}

.bct-speaker-talks__grid {
    display: grid;
    gap: 20px;
}

.bct-speaker-talks__empty {
    padding: 1.5em;
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Schedule Card */
.bct-schedule-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bct-schedule-card__header {
    margin: 0;
    padding: 1em 1.25em;
    font-size: 1.25em;
    font-weight: 600;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.bct-schedule-card__presentations {
    padding: 1.25em;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

/* Presentation Row */
.bct-presentation-row {
    display: flex;
    flex-direction: row;
    gap: 1em;
    align-items: baseline;
    padding: 0.5em 0;
}

.bct-presentation-row__time {
    flex: 0 0 auto;
    font-weight: 600;
    font-family: monospace;
    font-size: 0.95em;
    color: #666;
}

.bct-presentation-row__title {
    flex: 1 1 auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Speaker Widget Error States */
.bct-speaker-widget__placeholder,
.bct-speaker-widget__error {
    padding: 2em;
    text-align: center;
    background: #f9f9f9;
    border: 2px dashed #ccc;
    border-radius: 4px;
    color: #666;
}

/* Responsive Adjustments for Speaker Widget */
@media (max-width: 768px) {
    .bct-speaker__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .bct-speaker__photo {
        margin-right: 0;
    }
    
    .bct-speaker__info {
        align-items: center;
    }
    
    .bct-speaker__social {
        justify-content: center;
    }
    
    .bct-speaker-talks__grid {
        grid-template-columns: 1fr !important;
    }
    
    .bct-schedule-card__presentations {
        padding: 1em;
    }
    
    .bct-presentation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25em;
    }
}

/* ===================================
   Ticket Attendee Assignment Widget
   =================================== */

.bct-ticket-assignment {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    width: 100%;
}

.bct-ticket-assignment__messages {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.bct-ticket-assignment__notice {
    padding: 1em 1.5em;
    border-radius: 4px;
    border: 1px solid;
}

.bct-ticket-assignment__notice--info {
    background-color: #e7f3ff;
    border-color: #2196F3;
    color: #0d47a1;
}

.bct-ticket-assignment__notice--success {
    background-color: #e8f5e9;
    border-color: #4CAF50;
    color: #1b5e20;
}

.bct-ticket-assignment__notice--warning {
    background-color: #fff3e0;
    border-color: #FF9800;
    color: #e65100;
}

.bct-ticket-assignment__notice--error {
    background-color: #ffebee;
    border-color: #f44336;
    color: #b71c1c;
}

.bct-ticket-assignment__notice p {
    margin: 0;
    line-height: 1.6;
}

.bct-ticket-assignment__list {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.bct-ticket-assignment__card {
    display: flex;
    flex-direction: column;
    gap: 1em;
    padding: 1.5em;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #ffffff;
    transition: box-shadow 0.3s ease;
}

.bct-ticket-assignment__card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bct-ticket-assignment__card--saved {
    border-color: #4CAF50;
    background-color: #f1f8f4;
}

.bct-ticket-assignment__card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    padding-bottom: 1em;
    border-bottom: 1px solid #e0e0e0;
}

.bct-ticket-assignment__heading {
    margin: 0;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.bct-ticket-assignment__order-number {
    margin: 0;
    font-size: 0.9em;
    color: #666;
}

.bct-ticket-assignment__form {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.bct-ticket-assignment__field {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.bct-ticket-assignment__label {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
}

.bct-ticket-assignment__required {
    color: #f44336;
}

.bct-ticket-assignment__input {
    padding: 0.75em 1em;
    font-size: 1em;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bct-ticket-assignment__input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.bct-ticket-assignment__input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.bct-ticket-assignment__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em 2em;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    background-color: #2196F3;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.bct-ticket-assignment__button:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
}

.bct-ticket-assignment__button:active {
    transform: translateY(0);
}

.bct-ticket-assignment__button:disabled {
    background-color: #bbb;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bct-ticket-assignment {
        gap: 1em;
    }
    
    .bct-ticket-assignment__card {
        padding: 1em;
        gap: 0.75em;
    }
    
    .bct-ticket-assignment__heading {
        font-size: 1.1em;
    }
    
    .bct-ticket-assignment__button {
        width: 100%;
    }
}

/* ================================================
   Program / Schedule Widget Styles
   ================================================ */

/* Program Widget Main Container */
.bct-program-widget {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5em;
}

.bct-program-container {
    display: flex;
    flex-direction: row;
    gap: 2em;
    width: 100%;
}

/* Filter Panel (Left Sidebar) */
.bct-program-filters {
    display: flex;
    flex-direction: column;
    flex: 0 0 280px;
    gap: 1.5em;
    padding: 1.5em;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    align-self: flex-start;
    position: sticky;
    top: 20px;
}

.bct-program-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.bct-program-filter label {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
}

.bct-program-search {
    padding: 0.75em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    width: 100%;
    box-sizing: border-box;
}

.bct-program-filter-select {
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    min-height: 100px;
    width: 100%;
    box-sizing: border-box;
}

.bct-program-filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.bct-program-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.35em 0.5em;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s ease;
}

.bct-program-filter-checkbox:hover {
    background: #f5f5f5;
}

.bct-program-filter-checkbox input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.bct-program-filter-checkbox span {
    font-size: 0.9em;
    color: #333;
    user-select: none;
}

.bct-program-filter-results {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    padding-top: 1em;
    border-top: 1px solid #ddd;
}

.bct-program-results-count {
    font-size: 0.9em;
    color: #666;
}

.bct-program-results-count strong {
    color: #333;
    font-weight: 700;
}

.bct-program-clear-filters {
    padding: 0.5em 1em;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.bct-program-clear-filters:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Program Content Area */
.bct-program-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.5em;
    min-width: 0;
}

/* Day Tabs */
.bct-program-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75em;
    margin-bottom: 1em;
}

.bct-program-tab {
    padding: 0.75em 1.5em;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bct-program-tab:hover {
    background: #e9e9e9;
    border-color: #999;
}

.bct-program-tab.active {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
}

/* Day Container */
.bct-program-days {
    display: flex;
    flex-direction: column;
    gap: 2em;
}

.bct-program-day {
    display: none;
    flex-direction: column;
    gap: 1.5em;
}

.bct-program-day.active {
    display: flex;
}

.bct-program-day__title {
    margin: 0;
    padding-bottom: 0.75em;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.75em;
    font-weight: 600;
    color: #333;
}

/* Program Items Container */
.bct-program-items {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.bct-program-item {
    display: flex;
    flex-direction: row;
    gap: 1.5em;
    align-items: flex-start;
}

.bct-program-item.hidden {
    display: none;
}

/* Time Column - Card Style */
.bct-program-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 90px;
    min-width: 90px;
    padding: 1em 0.75em;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    gap: 0.25em;
}

.bct-program-time__hour {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.bct-program-time__period {
    font-size: 0.85em;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Presentation Card */
.bct-program-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1em;
    padding: 1.5em;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.bct-program-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.bct-program-card__title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.bct-program-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    font-size: 0.9em;
    color: #666;
}

.bct-program-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

.bct-program-card__meta i {
    font-size: 1em;
}

.bct-program-card__description {
    line-height: 1.6;
    color: #555;
}

.bct-program-card__description p {
    margin: 0 0 0.75em 0;
}

.bct-program-card__description p:last-child {
    margin-bottom: 0;
}

/* Speakers Section */
.bct-program-card__speakers {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5em;
    margin-top: 0.5em;
    padding-top: 1em;
    border-top: 1px solid #f0f0f0;
}

.bct-program-speaker {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75em;
}

.bct-program-speaker__avatar {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
}

.bct-program-speaker__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bct-program-speaker__avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1.5em;
    font-weight: 700;
}

.bct-program-speaker__info {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.bct-program-speaker__name {
    font-weight: 600;
    font-size: 1em;
    color: #333;
}

.bct-program-speaker__title {
    font-size: 0.85em;
    color: #777;
    line-height: 1.3;
}

/* Placeholder/Error Messages */
.bct-program-widget-placeholder,
.bct-program-widget-error {
    padding: 2em;
    text-align: center;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    border-radius: 8px;
    color: #666;
}

.bct-program-widget-error {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 992px) {
    .bct-program-container {
        flex-direction: column;
    }
    
    .bct-program-filters {
        flex: 1;
        position: static;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .bct-program-item {
        flex-direction: column;
        gap: 0.75em;
    }
    
    .bct-program-time {
        flex-direction: row;
        width: auto;
        min-width: auto;
        padding: 0.5em 1em;
        gap: 0.5em;
    }
    
    .bct-program-time__hour {
        font-size: 1.25em;
    }
    
    .bct-program-time__period {
        font-size: 0.8em;
    }
    
    .bct-program-card {
        padding: 1em;
    }
    
    .bct-program-card__title {
        font-size: 1.15em;
    }
    
    .bct-program-card__speakers {
        gap: 1em;
    }
    
    .bct-program-tabs {
        gap: 0.5em;
    }
    
    .bct-program-tab {
        padding: 0.5em 1em;
        font-size: 0.9em;
    }
}

