/**
 * MindForge Rail Components
 * Horizontal scrolling sections based on Game Night Rail design
 * Provides consistent rail styling across the application
 */

/* ================================================
   BOLD RAIL COMPONENT
   ================================================ */

/* Bold Rail - Based on Game Night Rail design with grey title, orange accent, grey slider */
.rail-bold {
    width: 100%;
    margin: 2rem 0;
    position: relative;
    overflow: visible; /* Allow shadows to extend beyond rail bounds */
}

.rail-bold__container {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Rail Header */
.rail-bold__header {
    width: 100%;
    margin-bottom: 0;
    padding: 0;
}

.rail-bold__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e5e7eb; /* Grey lettering */
    margin: 0 0 0.5rem 0;
}

.rail-bold__accent {
    width: 60px;
    height: 4px;
    background: var(--color-accent-orange); /* Mini orange bar */
    border-radius: 2px;
    margin-bottom: 0;
}

/* Rail Content Area */
.rail-bold__content {
    position: relative;
    overflow: visible; /* Allow shadows to extend beyond bounds */
}

/* Rail Track - The scrollable container */
.rail-bold__track {
    display: flex;
    gap: 4rem; /* Increased gap like guild-hybrid-grid for shadow breathing room */
    overflow-x: auto;
    overflow-y: visible; /* Allow shadows to extend vertically */
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 4rem 2rem; /* Extra vertical and horizontal padding for shadow breathing room */
}

.rail-bold__track::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

/* Rail Items - Container for cards */
.rail-bold__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* Use Orange Hover Image Cards in rails */
.rail-bold .layout-card-image {
    width: 280px;
    margin: 0;
    
    /* Reduce shadow size by 20% for better spacing */
    box-shadow: 
        12.8px 12.8px 25.6px rgba(0, 0, 0, 0.3),  /* was 16px 16px 32px */
        -12.8px -12.8px 25.6px rgba(255, 255, 255, 0.1);  /* was -16px -16px 32px */
}

.rail-bold .layout-card-image:hover {
    /* Reduce hover shadow size by 20% */
    box-shadow: 
        16px 16px 32px rgba(0, 0, 0, 0.3),  /* was 20px 20px 40px */
        -16px -16px 32px rgba(255, 255, 255, 0.1),  /* was -20px -20px 40px */
        0 0 24px rgba(251, 146, 60, 0.4),  /* was 0 0 30px */
        0 0 48px rgba(251, 146, 60, 0.2);  /* was 0 0 60px */
    transform: translateY(-4px);
}

/* Rail Navigation Arrows */
.rail-bold__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(31, 41, 55, 0.9);
    border: none;
    color: #e5e7eb;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    
    /* Neumorphic styling */
    box-shadow: 
        4px 4px 8px rgba(0, 0, 0, 0.3),
        -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.rail-bold__nav:hover {
    background: rgba(31, 41, 55, 1);
    color: var(--color-accent-orange);
    box-shadow: 
        6px 6px 12px rgba(0, 0, 0, 0.4),
        -6px -6px 12px rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.rail-bold__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%) scale(1);
}

.rail-bold__nav--prev {
    left: -20px;
}

.rail-bold__nav--next {
    right: -20px;
}

.rail-bold__nav svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Rail Progress Bar - Grey slider design (moved to be directly under accent bar) */
.rail-bold__progress {
    height: 4px;
    background: rgba(229, 231, 235, 0.2); /* Grey background */
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin-bottom: 1.5rem;
    padding: 0;
}

.rail-bold__progress-fill {
    height: 100%;
    background: #e5e7eb; /* Grey fill color */
    border-radius: 2px;
    width: 0;
    transition: width 0.3s ease;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 1024px) {
    .rail-bold__container {
        padding: 0 1.5rem;
    }
    
    .rail-bold .layout-card-image {
        width: 250px;
    }
    
    .rail-bold__track {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .rail-bold__container {
        padding: 0 1rem;
    }
    
    .rail-bold__header {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .rail-bold__title {
        font-size: 1.25rem;
    }
    
    .rail-bold__accent {
        width: 30px;
        height: 3px;
    }
    
    .rail-bold .layout-card-image {
        width: 220px;
    }
    
    .rail-bold__track {
        gap: 1rem;
    }
    
    .rail-bold__nav {
        width: 35px;
        height: 35px;
    }
    
    .rail-bold__nav svg {
        width: 16px;
        height: 16px;
    }
    
    .rail-bold__nav--prev {
        left: -15px;
    }
    
    .rail-bold__nav--next {
        right: -15px;
    }
}

@media (max-width: 480px) {
    .rail-bold__container {
        padding: 0 0.5rem;
    }
    
    .rail-bold .layout-card-image {
        width: 200px;
    }
    
    .rail-bold__nav {
        display: none; /* Hide arrows on very small screens, rely on touch scrolling */
    }
    
    .rail-bold__track {
        scroll-snap-type: x mandatory;
    }
    
    .rail-bold__item {
        scroll-snap-align: center;
    }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

/* Hide scrollbars completely */
.rail-bold--no-scrollbar .rail-bold__track {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.rail-bold--no-scrollbar .rail-bold__track::-webkit-scrollbar {
    display: none;
}

/* Auto-hide navigation arrows */
.rail-bold--auto-hide-nav .rail-bold__nav {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.rail-bold--auto-hide-nav:hover .rail-bold__nav {
    opacity: 1;
    pointer-events: auto;
}

/* Disable progress bar */
.rail-bold--no-progress .rail-bold__progress {
    display: none;
}