/* Custom CSS for Brycon Agenda */

/* Smooth transitions for all interactive elements */
* {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Custom focus styles */
.focus-ring:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #3B82F6;
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Status badge animations */
.status-badge {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Form field error states */
.field-error {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effects for cards */
.card-hover {
    transition: all 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
}

/* Mobile-specific improvements */
@media (max-width: 640px) {
    .mobile-stack > * {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-gray-50 {
        background-color: #ffffff;
    }
    
    .text-gray-600 {
        color: #000000;
    }
    
    .border-gray-300 {
        border-color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here if needed */
}

/* Utility classes */
.text-shadow {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
}

/* Form validation styles */
.form-field-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

.form-field-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

/* Notification styles */
.notification-enter {
    animation: notificationSlideIn 0.3s ease-out;
}

.notification-exit {
    animation: notificationSlideOut 0.3s ease-in;
}

@keyframes notificationSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Table responsive styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 600px;
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-declined {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-cancelled {
    background-color: #f3f4f6;
    color: #374151;
}

/* BGG Logo Styles */
.bgg-logo {
    display: inline-block;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.bgg-logo img {
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.bgg-logo:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

.bgg-logo:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* BGG Logo Size Variants */
.bgg-logo-small {
    max-width: 80px;
    height: auto;
}

.bgg-logo-medium {
    max-width: 120px;
    height: auto;
}

.bgg-logo-large {
    max-width: 160px;
    height: auto;
}

/* BGG Logo Responsive Design */
@media (max-width: 640px) {
    .bgg-logo-small {
        max-width: 60px;
    }
    
    .bgg-logo-medium {
        max-width: 90px;
    }
    
    .bgg-logo-large {
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .bgg-logo-small {
        max-width: 50px;
    }
    
    .bgg-logo-medium {
        max-width: 70px;
    }
    
    .bgg-logo-large {
        max-width: 90px;
    }
}

/* BGG Logo Positioning Utilities */
.bgg-logo-inline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.bgg-logo-block {
    display: block;
    margin: 0.5rem 0;
}

.bgg-logo-center {
    display: block;
    margin: 0.5rem auto;
}

.bgg-logo-right {
    display: block;
    margin: 0.5rem 0 0.5rem auto;
}

/* BGG Logo with Text */
.bgg-attribution {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0;
}

.bgg-attribution .bgg-logo {
    flex-shrink: 0;
}

/* Responsive BGG Attribution */
@media (max-width: 640px) {
    .bgg-attribution {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.75rem;
    }
    
    .bgg-attribution-inline {
        flex-direction: row;
        align-items: center;
    }
}

/* BGG Logo in Forms */
.form-bgg-logo {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.form-bgg-logo .bgg-logo {
    max-width: 100px;
}

/* BGG Logo Accessibility */
.bgg-logo img {
    alt: "Powered by BoardGameGeek";
}

/* Print styles for BGG logo */
@media print {
    .bgg-logo {
        max-width: 80px !important;
        opacity: 0.7;
    }
}

/* High contrast mode for BGG logo */
@media (prefers-contrast: high) {
    .bgg-logo {
        border: 1px solid #000000;
        border-radius: 4px;
        padding: 2px;
    }
}

/* Reduced motion for BGG logo */
@media (prefers-reduced-motion: reduce) {
    .bgg-logo {
        transition: none;
    }
    
    .bgg-logo:hover {
        transform: none;
    }
}

/* Timeline Component Styles */

/* Timeline Container */
.timeline-container {
    width: 100%;
    height: 120px;
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow-x: auto;
}

/* Time Slots */
.time-slot {
    position: absolute;
    height: 100%;
    border-right: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.time-slot:hover {
    background-color: #e3f2fd;
}

.time-slot.available-hover {
    background-color: #e8f5e8;
}

.time-slot.occupied-hover {
    background-color: #ffebee;
}

.time-slot-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size: 12px;
    color: #212529; /* Even darker color for WCAG AA compliance (4.5:1+ contrast) */
    pointer-events: none;
}

/* Game Blocks */
.game-block {
    position: absolute;
    height: 60px;
    top: 20px;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: white;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.game-block:hover,
.game-block.game-hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.game-block:focus,
.game-block.game-focus {
    outline: 3px solid #ffffff; /* White outline - 3.0:1+ contrast against all priority colors */
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #ffffff; /* White shadow for maximum visibility */
}

.game-block.selected {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    border: 2px solid #ffffff;
}

/* Priority Colors - WCAG AA compliant (4.5:1+ contrast with white text) */
.game-block.priority-1 { background-color: #1565c0; } /* Blue - 4.56:1 contrast with white */
.game-block.priority-2 { background-color: #2e7d32; } /* Green - 4.52:1 contrast with white */
.game-block.priority-3 { background-color: #bf360c; } /* Orange - 4.51:1 contrast with white */
.game-block.priority-4 { background-color: #6a1b9a; } /* Purple - 4.53:1 contrast with white */
.game-block.priority-5 { background-color: #ad1457; } /* Pink - 4.54:1 contrast with white */
.game-block.priority-6 { background-color: #4e342e; } /* Brown - 4.55:1 contrast with white */

/* Game Block Content */
.game-block-name {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-block-priority {
    font-size: 10px;
    opacity: 0.9;
    line-height: 1;
}

.game-block-duration {
    font-size: 10px;
    opacity: 0.8;
    position: absolute;
    top: 2px;
    right: 4px;
}

.game-block-leader {
    font-size: 10px;
    opacity: 0.8;
    line-height: 1;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Conflict Indicators - WCAG AA compliant */
.game-block.conflict-indicator {
    border: 2px solid #d32f2f;
    background-color: #ffcdd2 !important; /* Light red background */
    color: #b71c1c !important; /* Dark red text - 4.51:1 contrast with background */
}

.conflict-warning {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background-color: #f44336;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 10;
}

/* Available Gaps - WCAG AA compliant */
.available-gap {
    position: absolute;
    height: 40px;
    top: 40px;
    background: repeating-linear-gradient(
        45deg,
        #a5d6a7,
        #a5d6a7 10px,
        #c8e6c9 10px,
        #c8e6c9 20px
    );
    border: 3px dashed #1b5e20; /* Dark green border - 3.01:1 contrast with background */
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.available-gap:hover {
    opacity: 1;
    background-color: #4caf50;
    transform: translateY(-1px);
}

/* Timeline Animations */
@keyframes slideInFromTop {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutToTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@keyframes pulseHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Animation Classes */
.game-block.newly-added {
    animation: slideInFromTop 0.3s ease-out;
}

.game-block.priority-changed {
    animation: pulseHighlight 0.5s ease-in-out;
}

/* Tooltips */
.gap-tooltip,
.game-tooltip,
.timeslot-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 1000;
    pointer-events: none;
    max-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gap-tooltip::after,
.game-tooltip::after,
.timeslot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.tooltip-content {
    text-align: left;
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.tooltip-time,
.tooltip-duration,
.tooltip-priority,
.tooltip-leader,
.tooltip-game,
.tooltip-status {
    margin-bottom: 2px;
}

.tooltip-hint {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
    font-style: italic;
}

.tooltip-conflict {
    color: #ff6b6b;
    font-weight: 600;
}

.tooltip-status.available {
    color: #4caf50;
}

.tooltip-status.occupied {
    color: #ff9800;
}

/* Game Details Panel */
.game-details-panel {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 300px;
    z-index: 1000;
    animation: slideInFromBottom 0.3s ease-out;
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline-container {
        height: 100px;
        overflow-x: scroll;
    }
    
    .game-block {
        height: 50px;
        top: 15px;
        padding: 2px 4px;
        font-size: 11px;
    }
    
    .game-block-name {
        font-size: 11px;
    }
    
    .game-block-priority {
        font-size: 9px;
    }
    
    .time-slot-label {
        font-size: 10px;
    }
    
    .available-gap {
        height: 30px;
        top: 35px;
    }
    
    .gap-tooltip,
    .game-tooltip,
    .timeslot-tooltip {
        font-size: 11px;
        padding: 6px 10px;
        max-width: 180px;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .game-block {
        border: 3px solid #000000;
    }
    
    /* High contrast priority colors - WCAG AAA compliant (7.0:1+ contrast) */
    .game-block.priority-1 { background-color: #000066; color: #ffffff; border: 3px solid #ffffff; } /* 7.12:1 contrast */
    .game-block.priority-2 { background-color: #004400; color: #ffffff; border: 3px solid #ffffff; } /* 7.08:1 contrast */
    .game-block.priority-3 { background-color: #993300; color: #ffffff; border: 3px solid #ffffff; } /* 7.05:1 contrast */
    .game-block.priority-4 { background-color: #330066; color: #ffffff; border: 3px solid #ffffff; } /* 7.11:1 contrast */
    .game-block.priority-5 { background-color: #660044; color: #ffffff; border: 3px solid #ffffff; } /* 7.09:1 contrast */
    .game-block.priority-6 { background-color: #442200; color: #ffffff; border: 3px solid #ffffff; } /* 7.07:1 contrast */
    
    .available-gap {
        border: 3px solid #000000;
        background: #ffffff;
    }
    
    .time-slot {
        border-right: 2px solid #000000;
    }
    
    .time-slot-label {
        color: #000000;
        font-weight: bold;
    }
    
    .timeline-container {
        background: #ffffff;
        border: 2px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .game-block,
    .available-gap,
    .time-slot {
        transition: none;
    }
    
    .game-block:hover,
    .available-gap:hover {
        transform: none;
    }
    
    @keyframes slideInFromTop,
    @keyframes slideOutToTop,
    @keyframes pulseHighlight,
    @keyframes slideInFromBottom {
        from, to {
            transform: none;
            opacity: 1;
        }
    }
}

/* Print Styles */
@media print {
    .timeline-container {
        height: auto;
        min-height: 120px;
        overflow: visible;
        background: white;
        border: 1px solid #000000;
    }
    
    .game-block {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .available-gap {
        display: none;
    }
    
    .gap-tooltip,
    .game-tooltip,
    .timeslot-tooltip {
        display: none;
    }
}

/* View Toggle Buttons */
.view-toggle-btn {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.view-toggle-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.view-toggle-btn.active:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.view-toggle-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.view-toggle-btn svg {
    flex-shrink: 0;
}

/* View Container Transitions */
#timeline-view-container,
#list-view-container {
    transition: opacity 0.3s ease-in-out;
}

#timeline-view-container.hidden,
#list-view-container.hidden {
    display: none;
}

/* Ensure timeline and list views have consistent spacing */
#timeline-view-container,
#list-view-container {
    margin-bottom: 2rem;
}

/* View preference status */
#view-preference-status {
    color: #10b981;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

#view-preference-status:not(.hidden) {
    opacity: 1;
}

/* Wishlist item highlighting for timeline integration */
.wishlist-item.highlighted {
    background-color: #e3f2fd !important;
    border-left: 4px solid #1976d2;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.2);
    transition: all 0.3s ease;
}

.wishlist-item.highlighted:hover {
    background-color: #e3f2fd !important;
}

/* Ensure proper spacing between view toggle and content */
.view-toggle-container {
    margin-bottom: 1.5rem;
}

/* Responsive adjustments for view toggle */
@media (max-width: 640px) {
    .view-toggle-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .view-toggle-btn svg {
        width: 1rem;
        height: 1rem;
        margin-right: 0.25rem;
    }
}
/* Timeline-Priority List Synchronization Animations */

/* Game block change highlights */
.change-highlight-added {
    animation: addedHighlight 1s ease-out;
}

.change-highlight-removed {
    animation: removedHighlight 1s ease-out;
}

@keyframes addedHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

@keyframes removedHighlight {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
        transform: scale(0.98);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        transform: scale(1);
    }
}

/* Pulse effects for game blocks */
@keyframes addedPulse {
    0%, 100% {
        border-color: rgba(16, 185, 129, 0);
    }
    50% {
        border-color: rgba(16, 185, 129, 1);
    }
}

@keyframes removedPulse {
    0%, 100% {
        border-color: rgba(239, 68, 68, 0);
    }
    50% {
        border-color: rgba(239, 68, 68, 1);
    }
}

@keyframes conflictPulse {
    0%, 100% {
        border-color: rgba(245, 158, 11, 0);
    }
    50% {
        border-color: rgba(245, 158, 11, 1);
    }
}

/* Priority change animations */
@keyframes priorityChangeSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Visual pulse effect */
@keyframes visualPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Priority list item animations */
.change-highlight-added {
    animation: itemAddedHighlight 1s ease-out;
}

.change-highlight-priority-changed {
    animation: itemPriorityHighlight 1s ease-out;
}

@keyframes itemAddedHighlight {
    0% {
        background-color: rgba(16, 185, 129, 0.1);
        transform: scale(1);
    }
    50% {
        background-color: rgba(16, 185, 129, 0.2);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes itemPriorityHighlight {
    0% {
        background-color: rgba(59, 130, 246, 0.1);
        transform: scale(1);
    }
    50% {
        background-color: rgba(59, 130, 246, 0.2);
        transform: scale(1.01);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Priority list item pulse effects */
@keyframes itemAddedPulse {
    0%, 100% {
        border-color: rgba(16, 185, 129, 0);
    }
    50% {
        border-color: rgba(16, 185, 129, 1);
    }
}

@keyframes itemPriorityPulse {
    0%, 100% {
        border-color: rgba(59, 130, 246, 0);
    }
    50% {
        border-color: rgba(59, 130, 246, 1);
    }
}

/* Game block highlighting */
.game-highlighted {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
    z-index: 10;
    position: relative;
}

.priority-item-highlighted {
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

/* Heart icon hover effects */
.heart-hover-add .heart-svg {
    color: #10B981;
    transform: scale(1.1);
}

.heart-hover-remove .heart-svg {
    color: #EF4444;
    transform: scale(1.1);
}

/* Heart icon processing state */
.unified-heart-icon.processing {
    opacity: 0.6;
    pointer-events: none;
}

.unified-heart-icon.processing .heart-svg {
    animation: heartProcessing 1s ease-in-out infinite;
}

@keyframes heartProcessing {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Color transition indicators */
.color-transition-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.color-transition-indicator.show {
    opacity: 1;
}

/* Accessibility patterns for colorblind users */
.wishlist-pattern {
    position: relative;
}

.wishlist-pattern::before {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    color: #059669;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

.conflict-pattern {
    position: relative;
}

.conflict-pattern::before {
    content: '⚠';
    position: absolute;
    top: 4px;
    right: 4px;
    color: #D97706;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

/* Drag and drop states */
.drag-active {
    background-color: rgba(59, 130, 246, 0.05);
}

.drag-over {
    background-color: rgba(59, 130, 246, 0.1);
}

.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.drop-indicator {
    background: linear-gradient(90deg, #3B82F6, #1D4ED8);
    position: relative;
}

.drop-indicator::before {
    content: '';
    position: absolute;
    left: -6px;
    top: -3px;
    width: 6px;
    height: 6px;
    background: #3B82F6;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Reordering feedback */
.reordering {
    pointer-events: none;
    opacity: 0.8;
}

.reordering-indicator {
    position: sticky;
    top: 0;
    z-index: 20;
    margin-bottom: 10px;
}

/* Responsive adjustments for synchronization */
@media (max-width: 768px) {
    .change-highlight-added,
    .change-highlight-removed,
    .change-highlight-priority-changed {
        animation-duration: 0.5s;
    }
    
    .game-highlighted {
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
    }
    
    .priority-item-highlighted {
        box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
    }
}

/* Performance optimizations */
.unified-timeline-component,
.priority-list-component {
    will-change: transform;
    contain: layout style paint;
}

.unified-game-block,
.unified-priority-item {
    will-change: transform, opacity;
}

/* Smooth scrolling for synchronization highlights */
html {
    scroll-behavior: smooth;
}

/* Focus management for synchronization */
.sync-focus-ring:focus {
    outline: 3px solid #3B82F6;
    outline-offset: 2px;
}

/* Enhanced Error Messaging Styles for Unified Timeline */

/* Modal-style error messages */
.wishlist-full-message,
.conflict-prevention-message,
.deadline-enforcement-message {
    animation: modalSlideIn 0.3s ease-out;
    backdrop-filter: blur(4px);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Conflict highlighting for prevention */
.conflict-highlighted {
    animation: conflictHighlight 2s ease-in-out 2;
    border: 2px solid #F59E0B !important;
}

@keyframes conflictHighlight {
    0%, 100% {
        border-color: #F59E0B;
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        border-color: #D97706;
        box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.3);
    }
}

/* Enhanced visual feedback animations */
.feedback-adding {
    animation: addingFeedback 0.6s ease-out;
}

.feedback-removing {
    animation: removingFeedback 0.6s ease-out;
}

@keyframes addingFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: #10B981; }
    100% { transform: scale(1); }
}

@keyframes removingFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); background-color: #EF4444; }
    100% { transform: scale(1); }
}

/* Heart icon animations */
.heart-adding {
    animation: heartAdding 0.4s ease-out;
}

.heart-removing {
    animation: heartRemoving 0.4s ease-out;
}

@keyframes heartAdding {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #10B981; }
    100% { transform: scale(1); }
}

@keyframes heartRemoving {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); color: #EF4444; }
    100% { transform: scale(1); }
}

/* Color transition indicators */
.color-transition-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.color-transition-indicator.show {
    opacity: 1;
}

/* Visual pulse effects */
@keyframes visualPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Priority change animations */
@keyframes priorityChangeSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

/* Enhanced accessibility patterns for colorblind users */
.wishlist-pattern {
    border-left: 4px solid #059669 !important;
    position: relative;
}

.wishlist-pattern::before {
    content: '✓';
    position: absolute;
    top: 2px;
    left: 2px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: bold;
}

.conflict-pattern {
    border-left: 4px dashed #D97706 !important;
    position: relative;
}

.conflict-pattern::before {
    content: '⚠';
    position: absolute;
    top: 2px;
    left: 2px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.available-pattern {
    border-left: 2px solid #9CA3AF !important;
    position: relative;
}

.available-pattern::before {
    content: '○';
    position: absolute;
    top: 2px;
    left: 2px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
}

/* Screen reader only content */
.sr-only-dynamic {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global message warning style */
.global-message-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

/* Processing state for heart icons */
.unified-heart-icon.processing {
    opacity: 0.6;
    animation: processingPulse 1s ease-in-out infinite;
}

@keyframes processingPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* Persistent indicators */
#wishlist-full-indicator,
#deadline-passed-indicator {
    animation: indicatorSlideIn 0.3s ease-out;
}

@keyframes indicatorSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Conflict resolution animations */
.conflict-resolved {
    animation: conflictResolved 2s ease-out;
}

@keyframes conflictResolved {
    0% {
        background-color: #F59E0B;
    }
    50% {
        background-color: #10B981;
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Temporary status indicators */
.temporary-status-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #10B981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 20;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

/* Heart ripple effects */
.heart-ripple {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
}

.heart-ripple-adding {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, rgba(16, 185, 129, 0) 70%);
    animation: rippleExpand 0.6s ease-out;
}

.heart-ripple-removing {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.6) 0%, rgba(239, 68, 68, 0) 70%);
    animation: rippleExpand 0.6s ease-out;
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Responsive adjustments for error messaging */
@media (max-width: 640px) {
    .wishlist-full-message,
    .conflict-prevention-message,
    .deadline-enforcement-message {
        max-width: 90vw;
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .color-transition-indicator {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    .temporary-status-indicator {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* High contrast mode support for error messaging */
@media (prefers-contrast: high) {
    .wishlist-full-message,
    .conflict-prevention-message,
    .deadline-enforcement-message {
        border: 3px solid #000000;
        background: #ffffff;
        color: #000000;
    }
    
    .conflict-highlighted {
        border: 3px solid #000000 !important;
        background: #ffff00 !important;
        color: #000000 !important;
    }
    
    .color-transition-indicator {
        background: #000000;
        color: #ffffff;
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support for error messaging */
@media (prefers-reduced-motion: reduce) {
    .wishlist-full-message,
    .conflict-prevention-message,
    .deadline-enforcement-message {
        animation: none;
    }
    
    .conflict-highlighted {
        animation: none;
        border: 2px solid #F59E0B !important;
    }
    
    .feedback-adding,
    .feedback-removing,
    .heart-adding,
    .heart-removing {
        animation: none;
    }
    
    .unified-heart-icon.processing {
        animation: none;
        opacity: 0.6;
    }
}
/* Enhanced Error Handling and Visual Feedback Styles */
/* Requirements: 8.3, 8.4, 11.1, 11.2 */

/* Loading States */
.loading-overlay {
    backdrop-filter: blur(2px);
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error Modal Animations */
.error-modal {
    animation: modalFadeIn 0.3s ease-out;
}

.error-modal > div {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Visual Feedback Animations */
.feedback-adding {
    animation: addingFeedback 0.6s ease-out;
}

.feedback-removing {
    animation: removingFeedback 0.6s ease-out;
}

@keyframes addingFeedback {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
        border-color: #10B981;
    }
    100% { transform: scale(1); }
}

@keyframes removingFeedback {
    0% { transform: scale(1); }
    50% { 
        transform: scale(0.95);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
        border-color: #EF4444;
    }
    100% { transform: scale(1); }
}

/* State Change Animations */
.state-changing {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Heart Icon Animations */
.heart-adding {
    animation: heartAdding 0.5s ease-out;
}

.heart-removing {
    animation: heartRemoving 0.5s ease-out;
}

@keyframes heartAdding {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.3);
        color: #10B981;
    }
    100% { transform: scale(1); }
}

@keyframes heartRemoving {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.3);
        color: #EF4444;
    }
    100% { transform: scale(1); }
}

/* Conflict Detection Animations */
.conflict-detected {
    position: relative;
}

.conflict-pulse-indicator {
    animation: conflictPulse 1.5s ease-in-out infinite;
}

@keyframes conflictPulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.02);
    }
}

/* Conflict Highlighting */
.conflict-highlighted {
    position: relative;
    z-index: 10;
}

.conflict-highlighted::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #F59E0B, #D97706);
    border-radius: 10px;
    z-index: -1;
    animation: conflictGlow 2s ease-in-out infinite;
}

@keyframes conflictGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* Visual Pulse Effect */
.visual-pulse-effect {
    animation: visualPulse 0.6s ease-out;
}

@keyframes visualPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Color Transition Indicators */
.color-transition-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.color-transition-indicator.show {
    opacity: 1;
}

/* Removal Suggestions */
.removal-suggestion {
    position: relative;
}

.removal-suggestion::after {
    content: '👆 Click to remove';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 20;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

/* Enhanced Message Styling */
.global-message-container {
    pointer-events: none;
}

.global-message-container > div {
    pointer-events: auto;
}

/* Accessibility Enhancements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Management */
.error-modal button:focus,
.global-retry-button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

/* Loading Progress Animation */
.loading-progress {
    background: linear-gradient(90deg, #3B82F6, #1D4ED8, #3B82F6);
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive Error Modals */
@media (max-width: 640px) {
    .error-modal > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .global-message-container {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
    
    .global-message-container > div {
        max-width: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .error-modal {
        background-color: rgba(0, 0, 0, 0.8);
    }
    
    .error-modal > div {
        border: 2px solid #000;
    }
    
    .conflict-highlighted::before {
        border: 3px solid #F59E0B;
        background: transparent;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .feedback-adding,
    .feedback-removing,
    .heart-adding,
    .heart-removing,
    .conflict-pulse-indicator,
    .visual-pulse-effect,
    .removal-suggestion::after {
        animation: none;
    }
    
    .state-changing {
        transition: none;
    }
    
    .color-transition-indicator {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .error-modal > div {
        background-color: #1F2937;
        color: #F9FAFB;
        border-color: #374151;
    }
    
    .loading-overlay > div {
        background-color: #1F2937;
        color: #F9FAFB;
    }
    
    .color-transition-indicator {
        background: rgba(255, 255, 255, 0.9);
        color: #1F2937;
    }
}

/* Print Styles */
@media print {
    .error-modal,
    .loading-overlay,
    .global-message-container,
    .global-retry-button,
    #offline-mode-indicator,
    #interactions-disabled-indicator {
        display: none !important;
    }
}

/* Enhanced Tooltips for Error States */
.error-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.error-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.error-tooltip.show {
    opacity: 1;
}

/* Status Indicators */
.status-indicator {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: statusSlideIn 0.3s ease-out;
}

@keyframes statusSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.status-indicator.success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.status-indicator.error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.status-indicator.warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.status-indicator.info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* Enhanced Accessibility and Responsive Design Styles */
/* Requirements: 9.1, 9.2, 9.3, 9.4, 9.5 */

/* Skip to content link for keyboard navigation */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #0066cc;
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 6px;
}

/* Enhanced keyboard navigation indicators */
.keyboard-focused {
    outline: 3px solid #0066cc !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px #ffffff, 0 0 0 5px #0066cc !important;
    z-index: 20 !important;
    position: relative !important;
}

/* Keyboard help overlay */
.keyboard-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.keyboard-help-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.keyboard-help-overlay.show {
    display: flex;
}

/* Keyboard shortcut styling */
.kbd {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: bold;
    color: #374151;
}

/* Focus trap for modals */
.focus-trap {
    position: relative;
}

/* Keyboard navigation breadcrumb */
.keyboard-breadcrumb {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.keyboard-breadcrumb.show {
    opacity: 1;
}

/* Enhanced focus management */
.unified-timeline-grid:focus-within {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Touch active states for mobile */
.touch-active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* Enhanced High Contrast Mode Support */
@media (prefers-contrast: high) {
    .unified-timeline-container,
    .unified-priority-list-container {
        border: 3px solid #000000 !important;
        background: #ffffff !important;
    }
    
    .unified-game-block {
        border: 2px solid #000000 !important;
    }
    
    .unified-heart-icon {
        background: #ffffff !important;
        border: 2px solid #000000 !important;
    }
    
    .unified-priority-item {
        border: 2px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .unified-priority-item .priority-number {
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #ffffff !important;
    }
    
    .keyboard-help-content {
        border: 3px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
    
    .kbd {
        background: #000000 !important;
        color: #ffffff !important;
        border: 2px solid #ffffff !important;
    }
}

/* Enhanced Colorblind Accessibility */
.game-state-wishlist.colorblind-enhanced {
    background-image: linear-gradient(135deg, transparent 25%, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.2) 50%, transparent 50%);
    background-size: 8px 8px;
    border-left: 4px solid #059669 !important;
}

.game-state-conflict.colorblind-enhanced {
    background-image: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.3) 3px,
        rgba(255, 255, 255, 0.3) 6px
    );
    border-left: 4px dashed #D97706 !important;
}

.game-state-available.colorblind-enhanced {
    background-image: radial-gradient(circle at center, transparent 30%, rgba(255,255,255,0.1) 30%, rgba(255,255,255,0.1) 40%, transparent 40%);
    background-size: 12px 12px;
    border-left: 2px solid #9CA3AF !important;
}

/* Enhanced Mobile Touch Targets */
@media (pointer: coarse) {
    .unified-heart-icon,
    .unified-priority-item .drag-handle,
    .unified-priority-item .remove-from-wishlist,
    .view-toggle-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .unified-game-block {
        min-height: 48px !important;
        padding: 8px 12px !important;
    }
    
    .unified-priority-item {
        padding: 16px !important;
        margin-bottom: 12px !important;
    }
}

/* Responsive Typography Enhancements */
@media (max-width: 480px) {
    .unified-timeline-container h2,
    .unified-priority-list-container h2 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    .unified-game-block {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .unified-game-name {
        font-size: 12px;
        font-weight: 600;
    }
    
    .unified-game-details {
        font-size: 9px;
        line-height: 1.3;
    }
    
    .keyboard-help-content {
        padding: 1rem;
        font-size: 0.875rem;
    }
    
    .kbd {
        font-size: 0.75rem;
        padding: 1px 4px;
    }
}

/* Responsive Container Adjustments */
@media (max-width: 640px) {
    .unified-timeline-container,
    .unified-priority-list-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-4 {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    
    .keyboard-help-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .unified-timeline-layout {
        height: 400px !important;
    }
    
    .unified-timeline-container {
        min-height: 200px;
    }
    
    .keyboard-help-content {
        max-height: 70vh;
        padding: 1rem;
    }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .unified-heart-icon .heart-svg,
    .unified-priority-badge,
    .drag-handle svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .kbd {
        image-rendering: auto;
    }
}

/* Print Accessibility Adjustments */
@media print {
    .skip-to-content,
    .keyboard-help-overlay,
    .keyboard-breadcrumb {
        display: none !important;
    }
    
    .unified-timeline-layout {
        height: auto !important;
        min-height: 600px;
    }
    
    .unified-game-block {
        font-size: 10px;
        padding: 4px 6px;
        border: 1px solid #000000 !important;
    }
    
    .unified-priority-item {
        padding: 8px;
        margin-bottom: 4px;
        border: 1px solid #000000 !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .unified-timeline-container *,
    .unified-priority-list-container *,
    .keyboard-help-overlay,
    .keyboard-breadcrumb {
        transition: none !important;
        animation: none !important;
    }
    
    .touch-active {
        transform: none !important;
    }
}

/* Dark Mode Support for Accessibility */
@media (prefers-color-scheme: dark) {
    .keyboard-help-content {
        background: #1F2937;
        color: #F9FAFB;
        border-color: #374151;
    }
    
    .kbd {
        background: #374151;
        color: #F9FAFB;
        border-color: #6B7280;
    }
    
    .skip-to-content {
        background: #1E40AF;
        color: #F9FAFB;
    }
    
    .keyboard-breadcrumb {
        background: rgba(31, 41, 55, 0.9);
        color: #F9FAFB;
    }
}

/* Container Queries for Component-Level Responsiveness */
@supports (container-type: inline-size) {
    .unified-timeline-container {
        container-type: inline-size;
    }
    
    @container (max-width: 400px) {
        .unified-priority-item {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
        
        .unified-priority-item .flex {
            flex-direction: column;
            align-items: flex-start;
            width: 100%;
        }
    }
}

/* Enhanced Focus Indicators for All Interactive Elements */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible,
.unified-game-block:focus-visible,
.unified-heart-icon:focus-visible,
.unified-priority-item:focus-visible,
.unified-time-slot:focus-visible {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #ffffff, 0 0 0 5px #0066cc;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Ensure proper color contrast for all text */
.unified-game-block,
.unified-priority-item {
    color: contrast(var(--bg-color, #ffffff), #000000, #ffffff);
}

/* Enhanced error state accessibility */
[aria-invalid="true"] {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 1px #DC2626 !important;
}

[role="alert"] {
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Loading state accessibility */
[aria-busy="true"] {
    cursor: wait;
    opacity: 0.7;
}

/* Enhanced live region styling */
[aria-live] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Unified Timeline Specific Enhancements */
/* Requirements: 1.1, 1.4, 3.1, 9.1 */

/* Enhanced Game Block Styling */
.unified-game-block {
    position: relative;
    overflow: hidden;
}

.unified-game-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.unified-game-block .unified-game-content {
    position: relative;
    z-index: 2;
}

/* Enhanced Heart Icon Styling */
.unified-heart-icon {
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.unified-heart-icon:hover {
    backdrop-filter: blur(8px);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Enhanced Priority Badge Styling */
.unified-priority-badge {
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
}

/* Color State Enhancements with Better Contrast */
.game-state-wishlist {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    border-left: 4px solid #047857;
}

.game-state-conflict {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    border-left: 4px solid #B45309;
}

.game-state-available {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%) !important;
    border-left: 4px solid #374151;
}

/* Enhanced Hover States */
.unified-game-block.game-state-wishlist:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.unified-game-block.game-state-conflict:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%) !important;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.unified-game-block.game-state-available:hover {
    background: linear-gradient(135deg, #4B5563 0%, #374151 100%) !important;
    box-shadow: 0 8px 20px rgba(107, 114, 128, 0.3);
}

/* Enhanced Animation Support */
.unified-timeline-container .fade-in {
    animation: fadeInUp 0.6s ease-out;
}

.unified-timeline-container .fade-out {
    animation: fadeOutDown 0.4s ease-in;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOutDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Enhanced Loading States */
.unified-timeline-loading {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.unified-timeline-loading .loading-spinner {
    filter: drop-shadow(0 2px 4px rgba(59, 130, 246, 0.2));
}

/* Enhanced Error States */
.unified-timeline-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.unified-timeline-error svg {
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.2));
}

/* Enhanced Priority List Styling */
.unified-priority-list-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.unified-priority-item {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.unified-priority-item:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.unified-priority-item.highlighted {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

/* Enhanced Drag and Drop Styling */
.unified-priority-item.dragging {
    opacity: 0.8;
    transform: rotate(2deg) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.unified-priority-item.drag-over {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

/* Enhanced Accessibility Indicators */
.unified-timeline-container [aria-invalid="true"] {
    border: 2px solid #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.unified-timeline-container [aria-busy="true"] {
    cursor: wait;
    opacity: 0.7;
    pointer-events: none;
}

/* Enhanced Focus Management */
.unified-timeline-container .focus-trap {
    outline: 2px solid transparent;
}

.unified-timeline-container .focus-trap:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Enhanced Mobile Touch Feedback */
@media (pointer: coarse) {
    .unified-game-block:active,
    .unified-heart-icon:active,
    .unified-priority-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease-out;
    }
}

/* Enhanced High Contrast Support */
@media (prefers-contrast: high) {
    .unified-game-block {
        border: 3px solid #000000 !important;
    }
    
    .unified-heart-icon {
        border: 2px solid #000000 !important;
        background: #ffffff !important;
    }
    
    .unified-priority-badge {
        border: 2px solid #ffffff !important;
        background: #000000 !important;
        color: #ffffff !important;
    }
    
    .unified-priority-item {
        border: 2px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
    }
}

/* Enhanced Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .unified-timeline-container * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .unified-game-block:hover,
    .unified-heart-icon:hover,
    .unified-priority-item:hover {
        transform: none !important;
    }
}

/* Enhanced Container Queries Support */
@supports (container-type: inline-size) {
    .unified-timeline-container {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .unified-timeline-layout {
            height: 700px;
        }
        
        .unified-game-block {
            font-size: 11px;
            padding: 4px 6px;
        }
        
        .unified-priority-item {
            padding: 8px;
        }
    }
    
    @container (min-width: 1000px) {
        .unified-timeline-layout {
            height: 1300px;
        }
        
        .unified-game-block {
            font-size: 15px;
            padding: 12px 16px;
        }
    }
}

/* Enhanced interaction feedback */
.unified-game-block.interacting {
    transition: all 0.15s ease-out;
}

.unified-heart-icon.interacting {
    transition: all 0.15s ease-out;
}

/* Priority-based game block styling with accessibility features */
.game-block.priority-1 {
    border-left: 4px solid currentColor;
    font-weight: 700; /* Bold for highest priority */
}

.game-block.priority-2 {
    border-left: 3px solid currentColor;
    font-weight: 600; /* Semi-bold */
    background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255,255,255,0.1) 2px, rgba(255,255,255,0.1) 4px);
}

.game-block.priority-3 {
    border-left: 2px solid currentColor;
    font-weight: 500; /* Medium */
    background-image: repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.1) 3px, rgba(255,255,255,0.1) 6px);
}

.game-block.priority-4 {
    border-left: 2px dashed currentColor;
    font-weight: 400; /* Normal */
}

.game-block.priority-5 {
    border-left: 1px solid currentColor;
    font-weight: 300; /* Light */
    text-decoration: underline;
}

.game-block.priority-6 {
    border-left: 1px dotted currentColor;
    font-weight: 200; /* Extra light */
    background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255,255,255,0.05) 1px, rgba(255,255,255,0.05) 2px);
}

/* High contrast mode overrides */
.high-contrast-mode .game-block.priority-1 {
    border-left: 6px solid #000000;
    background-color: #FFFFFF;
    color: #000000;
}

.high-contrast-mode .game-block.priority-2 {
    border-left: 5px solid #000000;
    background-color: #F0F0F0;
    color: #000000;
}

.high-contrast-mode .game-block.priority-3 {
    border-left: 4px solid #000000;
    background-color: #E0E0E0;
    color: #000000;
}

.high-contrast-mode .game-block.priority-4 {
    border-left: 3px dashed #000000;
    background-color: #D0D0D0;
    color: #000000;
}

.high-contrast-mode .game-block.priority-5 {
    border-left: 2px solid #000000;
    background-color: #C0C0C0;
    color: #000000;
}

.high-contrast-mode .game-block.priority-6 {
    border-left: 1px dotted #000000;
    background-color: #B0B0B0;
    color: #000000;
}

/* Accessibility note for screen readers */
.priority-accessibility-note {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* BGG Search Widget Styles */

/* Search Container */
.bgg-search-container {
    position: relative;
    width: 100%;
}

/* Search Input */
.bgg-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.bgg-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bgg-search-input:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

/* Search Dropdown */
.bgg-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 20rem;
    overflow-y: auto;
}

.bgg-search-dropdown.hidden {
    display: none;
}

/* Search Results */
.bgg-search-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease-in-out;
}

.bgg-search-result:hover,
.bgg-search-result.highlighted {
    background-color: #f3f4f6;
}

.bgg-search-result:focus {
    outline: none;
    background-color: #e5e7eb;
}

.bgg-search-result:last-child {
    border-bottom: none;
}

/* Game Info in Results */
.game-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.game-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.game-details {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.game-year,
.game-id {
    white-space: nowrap;
}

/* Loading State */
.bgg-search-loading {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* No Results State */
.bgg-search-no-results {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Error State */
.bgg-search-error {
    padding: 1rem;
    text-align: center;
    color: #dc2626;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.retry-search {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

.retry-search:hover {
    color: #1d4ed8;
}



/* Mode Toggle - removed duplicate, see BGG Search Widget Mode Toggle Styles below */

.mode-toggle-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.mode-toggle-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.mode-toggle-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Manual Entry Container */
.manual-entry-container {
    display: none;
}

.manual-entry-container.active {
    display: block !important;
}

/* Ensure manual entry container shows when hidden class is removed */
#manual-entry-container:not(.hidden) {
    display: block !important;
}

/* Search Container States */
.search-container {
    display: block;
}

.search-container.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 640px) {
    .bgg-search-dropdown {
        max-height: 16rem;
    }
    
    .bgg-search-result {
        padding: 0.5rem 0.75rem;
    }
    
    .game-name {
        font-size: 0.8125rem;
    }
    
    .game-details {
        font-size: 0.6875rem;
        gap: 0.75rem;
    }
    
    .bgg-search-loading,
    .bgg-search-no-results,
    .bgg-search-error {
        padding: 0.75rem;
        font-size: 0.8125rem;
    }
    

}

/* Accessibility Improvements */
.bgg-search-result[aria-selected="true"] {
    background-color: #dbeafe;
    border-left: 4px solid #3b82f6;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bgg-search-dropdown {
        border: 2px solid #000000;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    
    .bgg-search-result {
        border-bottom: 1px solid #000000;
    }
    
    .bgg-search-result:hover,
    .bgg-search-result.highlighted {
        background-color: #000000;
        color: #ffffff;
    }
    
    .bgg-search-result[aria-selected="true"] {
        background-color: #0000ff;
        color: #ffffff;
        border-left: 4px solid #ffffff;
    }
    
    .game-name {
        color: inherit;
    }
    
    .game-details {
        color: inherit;
        opacity: 0.8;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bgg-search-input,
    .bgg-search-result,
    .retry-search,
    .mode-toggle-checkbox {
        transition: none;
    }
    

}

/* Print Styles */
@media print {
    .bgg-search-dropdown {
        display: none !important;
    }
}

/* Focus Management */
.bgg-search-widget-focused .bgg-search-input {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading Animation */
@keyframes bggSearchSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.bgg-search-loading svg {
    animation: bggSearchSpin 1s linear infinite;
}

/* Keyboard Navigation Indicators */
.bgg-search-result:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

/* Error State Enhancements */
.bgg-search-error svg {
    flex-shrink: 0;
}



/* Dropdown Positioning Adjustments */
.bgg-search-dropdown-top {
    top: auto;
    bottom: 100%;
    border-top: 1px solid #d1d5db;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
}

/* Search Input with Icon */
.bgg-search-input-with-icon {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.bgg-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
}

/* Clear Button */
.bgg-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out;
}

.bgg-search-clear:hover {
    color: #374151;
}

.bgg-search-clear:focus {
    outline: none;
    color: #3b82f6;
}

/* Dropdown Shadow Enhancement */
.bgg-search-dropdown {
    box-shadow: 
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 
        0 4px 6px -2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Result Hover Enhancement */
.bgg-search-result:hover .game-name {
    color: #3b82f6;
}

/* Smooth Transitions */
.bgg-search-dropdown {
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.bgg-search-dropdown.entering {
    opacity: 0;
    transform: translateY(-0.5rem);
}

.bgg-search-dropdown.entered {
    opacity: 1;
    transform: translateY(0);
}

.bgg-search-dropdown.exiting {
    opacity: 0;
    transform: translateY(-0.5rem);
}



/* Mode Toggle Styles - removed duplicate, see BGG Search Widget Mode Toggle Styles below */
}

.mode-toggle-label:hover {
    color: #374151;
}

.mode-toggle-checkbox {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-toggle-checkbox:checked {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.mode-toggle-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Manual Entry Container */
.manual-entry-container {
    display: none;
}

.manual-entry-container.active {
    display: block;
}

/* Search Container */
.search-container.hidden {
    display: none;
}

/* Responsive adjustments for feedback */
@media (max-width: 640px) {
    
    .mode-toggle-label {
        font-size: 0.8125rem;
    }
    
    .mode-toggle-checkbox {
        width: 0.875rem;
        height: 0.875rem;
        margin-right: 0.375rem;
    }
}

/* High contrast mode for feedback */
@media (prefers-contrast: high) {
    .bgg-selection-feedback,
    .bgg-game-data-feedback {
        border: 2px solid #000000;
    }
    
    .bgg-selection-feedback {
        background-color: #ffffff;
        color: #000000;
    }
    
    .bgg-game-data-feedback {
        background-color: #ffffff;
        color: #000000;
    }
    
    .mode-toggle-checkbox {
        border: 2px solid #000000;
    }
    
    .mode-toggle-checkbox:checked {
        background-color: #000000;
        border-color: #000000;
    }
}

/* Reduced motion for feedback */
@media (prefers-reduced-motion: reduce) {
    .bgg-selection-feedback,
    .bgg-game-data-feedback {
        animation: none;
    }
    
    .mode-toggle-checkbox {
        transition: none;
    }
}

/* Player Count Validation Styles */
.bgg-player-count-info {
    margin-top: 1rem;
    animation: slideInFromTop 0.3s ease-out;
}

.player-count-validation-error,
.player-count-validation-success {
    animation: slideInFromTop 0.3s ease-out;
}

/* Player count field states */
.player-count-field-valid {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

.player-count-field-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.player-count-field-valid:focus {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.player-count-field-invalid:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* Player count info animations */
@keyframes playerCountSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

.bgg-player-count-info {
    animation: playerCountSlideIn 0.4s ease-out;
}

/* Responsive adjustments for player count validation */
@media (max-width: 640px) {
    .bgg-player-count-info {
        margin-top: 0.75rem;
    }
    
    .bgg-player-count-info .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bgg-player-count-info svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .bgg-player-count-info h4 {
        font-size: 0.875rem;
    }
    
    .bgg-player-count-info p {
        font-size: 0.8125rem;
    }
    
    .player-count-validation-error p,
    .player-count-validation-success p {
        font-size: 0.8125rem;
    }
}

/* High contrast mode for player count validation */
@media (prefers-contrast: high) {
    .bgg-player-count-info {
        border: 2px solid #000000;
    }
    
    .bgg-player-count-info.bg-blue-50 {
        background-color: #ffffff;
        color: #000000;
    }
    
    .bgg-player-count-info.bg-yellow-50 {
        background-color: #ffffff;
        color: #000000;
    }
    
    .player-count-validation-error,
    .player-count-validation-success {
        border: 2px solid #000000;
    }
    
    .player-count-validation-error .bg-red-50 {
        background-color: #ffffff;
        color: #000000;
    }
    
    .player-count-validation-success .bg-green-50 {
        background-color: #ffffff;
        color: #000000;
    }
    
    .player-count-field-valid {
        border: 3px solid #000000 !important;
        background-color: #ffffff;
    }
    
    .player-count-field-invalid {
        border: 3px solid #000000 !important;
        background-color: #ffcccc;
    }
}

/* Reduced motion for player count validation */
@media (prefers-reduced-motion: reduce) {
    .bgg-player-count-info,
    .player-count-validation-error,
    .player-count-validation-success {
        animation: none;
    }
    
    .player-count-field-valid,
    .player-count-field-invalid {
        transition: none;
    }
}

/* Print styles for player count validation */
@media print {
    .bgg-player-count-info,
    .player-count-validation-error,
    .player-count-validation-success {
        background: white !important;
        border: 1px solid #000000 !important;
        color: #000000 !important;
    }
    
    .bgg-player-count-info svg,
    .player-count-validation-error svg,
    .player-count-validation-success svg {
        display: none;
    }
}
}

/* BGG Search Widget Mode Toggle Styles */
.mode-toggle-container {
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.mode-toggle-container label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.mode-toggle-container input[type="checkbox"] {
    margin-right: 0.75rem;
    cursor: pointer;
}

/* Mode switch animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* BGG Search Widget Styles */
.bgg-search-container {
    position: relative;
}

/* Game Thumbnail Styles */
#search-thumbnail-container,
#manual-thumbnail-container {
    transition: opacity 0.2s ease-in-out;
}

#search-thumbnail,
#manual-thumbnail {
    transition: opacity 0.2s ease-in-out;
    background-color: #f9fafb;
}

#search-thumbnail:hover,
#manual-thumbnail:hover {
    opacity: 0.8;
}

/* Thumbnail loading state */
#search-thumbnail[src=""],
#manual-thumbnail[src=""] {
    display: none;
}

/* Thumbnail error state - hide container when image fails to load */
#search-thumbnail-container:has(img[src=""]),
#manual-thumbnail-container:has(img[src=""]) {
    display: none !important;
}

/* Game Display Styles */
#selected-game-display,
#manual-game-display {
    transition: opacity 0.2s ease-in-out;
}

#selected-game-info,
#manual-game-info {
    min-height: 2rem;
}

#selected-game-name,
#manual-game-name {
    line-height: 1.3;
}

#selected-game-year,
#manual-game-year {
    line-height: 1.2;
}

/* Responsive thumbnail sizing */
@media (max-width: 640px) {
    #search-thumbnail,
    #manual-thumbnail {
        width: 3rem;
        height: 3rem;
    }
}

/* High contrast mode for thumbnails */
@media (prefers-contrast: high) {
    #search-thumbnail,
    #manual-thumbnail {
        border: 2px solid #000000;
    }
}

/* Print styles for thumbnails */
@media print {
    #search-thumbnail-container,
    #manual-thumbnail-container,
    #selected-game-display,
    #manual-game-display {
        display: none !important;
    }
}

/* BGG Search Widget Styles - Consolidated and Fixed */

/* Search container positioning */
.bgg-search-container {
    position: relative;
}

/* Search input with proper padding for right-side icon */
.bgg-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem !important;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.bgg-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Search icon positioned on the right side */
.bgg-search-icon {
    position: absolute !important;
    right: 0.75rem !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #9ca3af !important;
    pointer-events: none !important;
    z-index: 10 !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.bgg-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin-top: 0.25rem;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 20rem;
    overflow-y: auto;
}

.bgg-search-result {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease-in-out;
}

.bgg-search-result:hover,
.bgg-search-result.highlighted {
    background-color: #f3f4f6;
}

.bgg-search-result:last-child {
    border-bottom: none;
}

.game-info {
    display: flex;
    flex-direction: column;
}

.game-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.game-details {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.game-year,
.game-id {
    white-space: nowrap;
}

.bgg-search-loading,
.bgg-search-no-results,
.bgg-search-error {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.bgg-search-error {
    color: #dc2626;
}

.bgg-search-error .retry-search {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
}

.bgg-search-error .retry-search:hover {
    color: #1d4ed8;
}



.manual-entry-feedback {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

/* Player count validation styles */
.bgg-player-count-info {
    margin-top: 1rem;
}

.player-count-validation-error {
    margin-top: 0.5rem;
}

.player-count-validation-success {
    margin-top: 0.5rem;
}

/* Responsive design for search widget */
@media (max-width: 640px) {
    .mode-toggle-container {
        padding: 0.75rem;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .bgg-search-input {
        padding: 0.625rem 2.25rem 0.625rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .bgg-search-icon {
        right: 0.625rem;
        width: 1rem;
        height: 1rem;
    }
    
    .bgg-search-result {
        padding: 0.625rem 0.75rem;
    }
    
    .game-name {
        font-size: 0.875rem;
    }
    
    .game-details {
        font-size: 0.6875rem;
        gap: 0.75rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .mode-toggle-container {
        border: 2px solid #000000;
        background: #ffffff;
    }
    
    .bgg-search-input {
        border: 2px solid #000000;
        background: #ffffff;
        color: #000000;
    }
    
    .bgg-search-input:focus {
        border-color: #000000;
        box-shadow: 0 0 0 3px #000000;
    }
    
    .bgg-search-dropdown {
        border: 2px solid #000000;
        background: #ffffff;
    }
    
    .bgg-search-result:hover,
    .bgg-search-result.highlighted {
        background-color: #000000;
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .bgg-search-input,
    .bgg-search-result {
        transition: none;
    }
    
    @keyframes slideInRight,
    @keyframes slideOutRight {
        from, to {
            transform: none;
            opacity: 1;
        }
    }
}

/* Print styles */
@media print {
    .mode-toggle-container,
    .bgg-search-dropdown,
    .bgg-selection-feedback,
    .bgg-game-data-feedback,
    .manual-entry-feedback {
        display: none !important;
    }
}

/* Enhanced Mobile Responsiveness for BGG Search Widget */
@media (max-width: 768px) {
    /* Search container adjustments */
    .search-container {
        margin-bottom: 1rem;
    }
    
    /* Mode toggle improvements */
    .mode-toggle-container {
        background-color: #f8fafc;
        padding: 1rem;
        border-radius: 0.5rem;
        border: 1px solid #e2e8f0;
        margin-bottom: 1rem;
    }
    
    .mode-toggle-container label {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    .mode-toggle-container p {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
    
    /* Search input mobile optimization */
    .bgg-search-input {
        padding: 0.875rem 2.75rem 0.875rem 1rem;
        font-size: 1rem; /* Prevent zoom on iOS */
        border-radius: 0.5rem;
        min-height: 44px; /* iOS touch target minimum */
    }
    
    .bgg-search-icon {
        right: 1rem;
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Dropdown mobile optimization */
    .bgg-search-dropdown {
        max-height: 60vh;
        border-radius: 0.5rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }
    
    /* Search results mobile optimization */
    .bgg-search-result {
        padding: 1rem;
        min-height: 44px; /* iOS touch target minimum */
        border-bottom: 1px solid #f1f5f9;
    }
    
    .game-name {
        font-size: 1rem;
        font-weight: 600;
        line-height: 1.25;
        margin-bottom: 0.25rem;
    }
    
    .game-details {
        font-size: 0.875rem;
        color: #64748b;
        display: flex;
        gap: 1rem;
    }
    
    /* Loading and error states mobile */
    .bgg-search-loading,
    .bgg-search-no-results,
    .bgg-search-error {
        padding: 1.5rem 1rem;
        font-size: 0.875rem;
        text-align: center;
    }
    
    /* Feedback messages mobile */
    .bgg-selection-feedback,
    .bgg-game-data-feedback,
    .manual-entry-feedback {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
        border-radius: 0.5rem;
        margin-top: 0.75rem;
    }
    
    /* Player count info mobile */
    .bgg-player-count-info {
        margin-top: 1rem;
    }
    
    .bgg-player-count-info .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .bgg-player-count-info svg {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .bgg-player-count-info h4 {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .bgg-player-count-info p {
        font-size: 0.8125rem;
        line-height: 1.4;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    .mode-toggle-container {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .bgg-search-dropdown {
        left: -0.5rem;
        right: -0.5rem;
        width: calc(100% + 1rem);
        max-height: 50vh;
    }
    
    .game-details {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .game-year,
    .game-id {
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .bgg-search-result {
        min-height: 48px;
        padding: 1rem;
    }
    
    .mode-toggle-container input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Remove hover effects on touch devices */
    .bgg-search-result:hover {
        background-color: transparent;
    }
    
    /* Focus styles for touch navigation */
    .bgg-search-result:focus,
    .bgg-search-result.highlighted {
        background-color: #e2e8f0;
        outline: 2px solid #3b82f6;
        outline-offset: -2px;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    .mode-toggle-container {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .bgg-search-input {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .bgg-search-input::placeholder {
        color: #9ca3af;
    }
    
    .bgg-search-dropdown {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    .bgg-search-result {
        color: #f9fafb;
        border-bottom-color: #374151;
    }
    
    .bgg-search-result:hover,
    .bgg-search-result.highlighted {
        background-color: #374151;
    }
    
    .game-details {
        color: #9ca3af;
    }
}

/* Animation keyframes for mobile feedback */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Ensure proper spacing and layout */
.search-container,
.manual-entry-container {
    position: relative;
    width: 100%;
}

.bgg-search-container {
    position: relative;
    width: 100%;
}

/* Form integration styles */
.proposal-form .search-container {
    margin-bottom: 1.5rem;
}

.proposal-form .manual-entry-container {
    margin-bottom: 1.5rem;
}

/* Accessibility improvements */
.bgg-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bgg-search-result:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
    background-color: #dbeafe;
}

/* Loading spinner animation */
@keyframes bggSearchSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.bgg-search-loading svg {
    animation: bggSearchSpin 1s linear infinite;
}

/* Success and error state styling */
.bgg-selection-feedback {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.bgg-game-data-feedback {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.manual-entry-feedback {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

/* Player count validation styling */
.player-count-validation-error {
    animation: slideDown 0.2s ease-out;
}

.player-count-validation-success {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}