/* ASAE Event Agenda Plugin Styles */

.asae-event-agenda {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Control Bar */
.asae-agenda-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

/* First Row: My Agenda (left) + Show Descriptions & Refresh (right) */
.asae-controls-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
}

.asae-secondary-controls {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

/* Second Row: Day Filter Buttons */
.asae-controls-row-2 {
    display: flex;
    width: 100%;
}

.asae-view-toggle {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.asae-view-btn {
    background: #f8f9fa;
    color: #333;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.asae-view-btn:hover {
    background: #2c3e50;
    color: white;
    text-decoration: underline;
}

.asae-view-btn.active {
    background: #0073aa;
    color: white;
}

.asae-view-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* My Agenda Toggle Button */
.asae-my-agenda-toggle {
    display: flex;
    align-items: flex-start;
}

.asae-my-agenda-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
}

.asae-my-agenda-btn:hover:not(.disabled) {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    text-decoration: underline;
}

.asae-my-agenda-btn.active {
    background: #000;
    color: white;
    border-color: #000;
}

.asae-my-agenda-btn.active:hover {
    background: #2c3e50;
    border-color: #2c3e50;
    text-decoration: underline;
}

.asae-my-agenda-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.asae-my-agenda-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #ffb900;
}

.asae-my-agenda-btn.active .dashicons {
    color: #ffb900;
}

/* Day Filter Buttons */
.asae-day-filter-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.asae-day-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
}

.asae-day-btn:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    text-decoration: underline;
}

.asae-day-btn.active {
    background: #000000;
    color: white;
    border-color: #000000;
}

.asae-day-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Description Toggle & Refresh Buttons */
.asae-description-toggle,
.asae-refresh-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #666;
    transition: all 0.3s ease;
    text-decoration: none;
}

.asae-description-toggle:hover,
.asae-refresh-btn:hover {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    text-decoration: underline;
}

/* Descriptions toggle active state (matches My Agenda style) */
.asae-description-toggle.active {
    background: #000;
    color: white;
    border-color: #000;
}

.asae-description-toggle.active:hover {
    background: #2c3e50;
    border-color: #2c3e50;
    text-decoration: underline;
}

.asae-refresh-btn.loading {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
    cursor: not-allowed;
}

.asae-refresh-btn.loading .dashicons {
    animation: asae-spin 1s linear infinite;
}

.asae-description-toggle .dashicons,
.asae-refresh-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

@keyframes asae-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pull-to-Refresh Indicator */
.asae-pull-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px) scale(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.asae-pull-indicator .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #0073aa;
}

.asae-pull-indicator.ready .dashicons {
    color: #28a745;
}

.asae-pull-indicator .asae-spinning {
    animation: asae-spin 1s linear infinite;
}

.asae-pull-indicator .asae-pull-text {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    text-align: center;
}

.asae-pull-indicator.ready .asae-pull-text {
    color: #28a745;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .asae-secondary-controls {
        justify-content: flex-start;
        gap: 8px;
    }
    
    .asae-description-toggle,
    .asae-refresh-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .asae-day-filter-toggle {
        gap: 6px;
    }
    
    .asae-day-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .asae-event-agenda {
        position: relative;
        overflow: hidden;
    }
}

/* Toggle Switch */
.asae-toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.asae-toggle-switch input[type="checkbox"] {
    display: none;
}

.asae-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background 0.3s;
}

.asae-slider:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.asae-toggle-switch input:checked + .asae-slider {
    background: #0073aa;
}

.asae-toggle-switch input:checked + .asae-slider:before {
    transform: translateX(26px);
}

.asae-toggle-label {
    font-size: 14px;
    font-weight: 500;
}

/* Cancelled Events */
.asae-agenda-item.cancelled-event .asae-item-title.cancelled-title,
.asae-timeline-item.cancelled-event h4.cancelled-title {
    color: #666666 !important;
}

.asae-agenda-item.cancelled-event .asae-item-description,
.asae-timeline-item.cancelled-event .asae-item-description {
    display: none !important;
}

/* External Link Icons */
.asae-item-description a[target="_blank"] .dashicons-external {
    font-size: 12px;
    width: 12px;
    height: 12px;
    margin-left: 2px;
    vertical-align: text-top;
    color: #0073aa;
}

/* Session title links */
.asae-item-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.asae-item-title a:hover,
.asae-item-title a:focus {
    color: #0073aa;
    text-decoration: underline;
}

.asae-item-title a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Full Width Layout Fix */
.asae-agenda-view {
    width: 100%;
    max-width: 100%;
}

.asae-day-section {
    width: 100%;
    max-width: 100%;
}

.asae-day-items {
    width: 100%;
    max-width: 100%;
}

.asae-agenda-item {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.asae-calendar-view,
.asae-calendar-content {
    width: 100%;
    max-width: 100%;
}

/* Loading and Error States */
.asae-loading {
    text-align: center;
    padding: 40px;
}

.asae-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: asaeSpinner 2s linear infinite;
    margin: 0 auto 15px;
}

@keyframes asaeSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.asae-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.asae-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* List View Styles */
.asae-list-view {
    margin-top: 20px;
}

.asae-day-section {
    margin-bottom: 30px;
}

.asae-day-header {
    background: linear-gradient(135deg, #0073aa, #005177);
    color: white;
    margin: 0 0 15px 0;
    padding: 15px 20px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
}

.asae-day-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.asae-agenda-item {
    display: flex;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.asae-agenda-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.asae-agenda-item.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.asae-agenda-item.selected:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #0073aa;
    border-radius: 6px 0 0 6px;
}

.asae-item-time {
    flex-shrink: 0;
    width: 120px;
    font-weight: 600;
    color: #0073aa;
    font-size: 14px;
    padding-right: 15px;
    align-self: flex-start;
    padding-top: 2px;
}

.asae-item-content {
    flex-grow: 1;
    padding-right: 15px;
}

.asae-item-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    padding-top: 0;
}

.asae-item-description {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.asae-item-speaker {
    margin-bottom: 8px;
    font-size: 14px;
    color: #444;
}

.asae-item-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.asae-item-location .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.asae-item-bookmark {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

.asae-bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #ccc;
    margin-top: -2px;
}

.asae-bookmark-btn:hover:not(.disabled) {
    background: #f0f0f0;
    color: #ffb900;
}

.asae-bookmark-btn.selected {
    color: #ffb900;
}

.asae-bookmark-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.asae-bookmark-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Calendar View Styles */
.asae-calendar-view {
    margin-top: 20px;
}

.asae-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0073aa, #005177);
    color: white;
    border-radius: 6px;
}

.asae-nav-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.asae-nav-btn:hover {
    background: rgba(255,255,255,0.3);
}

.asae-nav-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.asae-current-date {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.asae-calendar-content {
    position: relative;
    min-height: 400px;
}

.asae-calendar-day {
    width: 100%;
}

.asae-no-events {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.asae-timeline {
    position: relative;
    padding-left: 80px;
}

.asae-timeline:before {
    content: "";
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e1e1e1;
}

.asae-timeline-item {
    position: relative;
    margin-bottom: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
}

.asae-timeline-item:before {
    content: "";
    position: absolute;
    left: -25px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: #0073aa;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 1px #e1e1e1;
}

.asae-timeline-item.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.asae-timeline-item.selected:before {
    background: #dc3545;
}

.asae-timeline-time {
    position: absolute;
    left: -75px;
    top: 15px;
    width: 60px;
    text-align: right;
    font-weight: 600;
    color: #0073aa;
    font-size: 12px;
}

.asae-timeline-content {
    position: relative;
}

.asae-timeline-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-right: 40px;
}

.asae-timeline-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.asae-timeline-location .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.asae-timeline-content .asae-bookmark-btn {
    position: absolute;
    top: 0;
    right: 0;
}

/* Hide bookmarked items when filter is active */
.asae-event-agenda.filter-bookmarks .asae-agenda-item:not(.selected),
.asae-event-agenda.filter-bookmarks .asae-timeline-item:not(.selected) {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .asae-event-agenda {
        padding: 15px;
        margin: 10px 0;
    }
    
    .asae-agenda-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .asae-view-toggle {
        justify-content: center;
    }
    
    .asae-agenda-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .asae-item-time {
        width: auto;
        padding-right: 0;
        padding-bottom: 10px;
        border-bottom: 1px solid #e1e1e1;
    }
    
    .asae-item-content {
        padding-right: 0;
    }
    
    .asae-calendar-navigation {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .asae-timeline {
        padding-left: 20px;
    }
    
    .asae-timeline:before {
        left: 10px;
    }
    
    .asae-timeline-item:before {
        left: 4px;
    }
    
    .asae-timeline-time {
        position: relative;
        left: 0;
        top: 0;
        width: auto;
        text-align: left;
        margin-bottom: 10px;
        font-size: 14px;
    }
}

/* Status indicators for API connectivity and diagnostics */
.asae-status-success {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.asae-status-error {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

/* Multi-endpoint status display for admin dashboard */
.asae-endpoint-status {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.asae-endpoint-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.asae-endpoint-row:last-child {
    border-bottom: none;
}

.asae-endpoint-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.asae-overall-status {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
    font-style: italic;
    color: #666;
    font-size: 13px;
}

/* Enhanced session display with booth info */
.asae-session-sponsor {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.asae-booth-info {
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.8em;
    color: #0073aa;
    margin-left: 5px;
    font-weight: 500;
}

/* ========================================
   INLINE MESSAGES (positioned at item location)
   ======================================== */
.asae-inline-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid;
    position: relative;
    animation: slideIn 0.3s ease-out;
    width: 100%;
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.asae-inline-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.asae-inline-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.asae-inline-message .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.asae-message-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

/* Login link styling - entire sentence is clickable */
.asae-login-link {
    color: #721c24;
    text-decoration: underline;
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.asae-login-link:hover,
.asae-login-link:focus {
    color: #491217;
    text-decoration: underline;
}

.asae-message-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.asae-message-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.asae-message-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.asae-message-close .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   WCAG 2.2 LEVEL AA COMPLIANCE ENHANCEMENTS
   ======================================== */

/* Enhanced focus indicators for all interactive elements */
.asae-my-agenda-btn:focus,
.asae-description-toggle:focus,
.asae-refresh-btn:focus,
.asae-day-btn:focus,
.asae-bookmark-btn:focus,
.asae-view-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Ensure focus is visible even for active states */
.asae-my-agenda-btn.active:focus,
.asae-day-btn.active:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.5);
}

/* Enhanced button accessibility - minimum 44x44px touch target */
.asae-bookmark-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Keyboard navigation support - visible focus indicators */
*:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Skip to content link for screen readers (can be added to template if needed) */
.asae-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.asae-skip-link:focus {
    top: 0;
}

/* Ensure disabled buttons are clearly indicated */
.asae-my-agenda-btn.disabled,
.asae-bookmark-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .asae-my-agenda-btn,
    .asae-day-btn,
    .asae-description-toggle,
    .asae-refresh-btn {
        border-width: 2px;
    }
    
    .asae-my-agenda-btn:focus,
    .asae-day-btn:focus,
    .asae-description-toggle:focus,
    .asae-refresh-btn:focus,
    .asae-bookmark-btn:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support for users with vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .asae-inline-message {
        animation: none;
    }
    
    @keyframes slideIn {
        from { opacity: 1; transform: translateX(0); }
        to { opacity: 1; transform: translateX(0); }
    }
}

