/* Focus Rail Component Styles */
:root {
    --rail-bg: #1a1a1a; /* Matches primary-color */
    --rail-card-bg: #222;
    --rail-accent: #e5e5e5; /* Lighter text for accent */
    --rail-highlight: #d4af37; /* Gold for premium feel */
    --rail-text-main: #ffffff;
    --rail-text-muted: #a3a3a3;
}

/* Ensure full screen dark mode for this page */
body.focus-rail-page {
    background-color: var(--rail-bg);
    color: var(--rail-text-main);
    overflow-x: hidden;
    margin: 0;
    font-family: 'Lora', serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header/Nav override for this page if needed */
body.focus-rail-page header {
    background-color: transparent !important; /* "mixed" look */
    box-shadow: none !important;
    border-bottom: none !important;
    position: absolute;
    width: 100%;
    z-index: 50;
    /* Ensure blend with body */
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), transparent);
}

.focus-rail-navbar {
    justify-content: center;
    padding-top: 2rem; /* Increased top padding to move it down */
    position: relative;
}

.focus-rail-navbar .desktop-nav {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.focus-rail-navbar .nav-links a {
    color: #ffffff;
}

.focus-rail-navbar .nav-links a:hover,
.focus-rail-navbar .nav-links a.active {
    color: var(--rail-highlight);
}

/* Bottom Nav Override for Dark Theme */
.bottom-nav {
    background-color: rgba(23, 23, 23, 0.95) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav .nav-item {
    color: #a3a3a3;
}

.bottom-nav .nav-item.active {
    color: var(--rail-highlight);
}

.bottom-nav .nav-item.active i {
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.bottom-nav .nav-indicator-line::after {
    background-color: var(--rail-highlight) !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5) !important;
}

/* Mobile Menu Fix for Featured Page */
@media (max-width: 768px) {
    .focus-rail-navbar .desktop-nav {
        display: none;
    }
    
    .focus-rail-navbar {
        display: flex;
        justify-content: center; /* Logo Center */
        align-items: center;
        height: 60px;
        padding-top: 0;
    }

    .focus-rail-navbar .logo {
        position: relative;
        left: auto;
        transform: none;
    }
}

.focus-rail-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.focus-rail-logo img {
    height: 38px;
    width: auto;
}

body.focus-rail-page .logo img {
    filter: brightness(0) invert(1); /* Make logo white if it's not */
}

/* Main Container */
.focus-rail-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 0 1rem; /* Increased top padding again to push content lower as requested */
    position: relative;
    overflow: hidden;
}

.rail-header {
    text-align: center;
    margin-bottom: 0.35rem; /* Reduced gap */
    position: relative;
    z-index: 20;
    margin-top: 1rem; /* Added margin to push it further down from logo */
    transform: translateY(6px);
}

.rail-header-title {
    color: white;
    font-size: 1.4rem; /* Smaller head text */
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.rail-header-subtitle {
    color: #a3a3a3;
    font-size: 0.8rem;
}

/* Background Ambience */
.rail-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-image-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.bg-image-layer.active {
    opacity: 0.4;
}

.bg-image-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(40px) saturate(200%);
}

.bg-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--rail-bg) 0%, rgba(10,10,10,0.5) 50%, transparent 100%);
}

/* Rail Area */
.rail-stage {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rail-wrapper {
    position: relative;
    margin: 0 auto;
    display: flex;
    height: 400px; /* Adjusted height */
    width: 100%;
    max-width: 1000px;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    /* cursor: grab; */
}

.rail-wrapper:active {
    cursor: grabbing;
}

.rail-card {
    position: absolute;
    aspect-ratio: 3/4;
    width: 260px;
    border-radius: 1rem;
    background-color: var(--rail-card-bg);
    border-top: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
                opacity 0.5s ease, 
                filter 0.5s ease,
                box-shadow 0.3s ease;
    transform-style: preserve-3d;
    cursor: pointer;
    overflow: hidden;
}

@media (min-width: 768px) {
    .rail-card {
        width: 300px;
    }
}

.rail-card.is-center {
    z-index: 20;
    box-shadow: 0 0 40px rgba(255,255,255,0.1);
}

.rail-card img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    pointer-events: none;
    border-radius: 1rem;
}

.rail-card-info {
    position: absolute;
    inset: auto 0 0 0; /* Bottom aligned */
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.0));
    color: #fff;
    text-align: left;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    z-index: 10; /* Ensure text is above image */
}

.rail-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.1rem;
    color: #fff; /* Force white text */
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.rail-card-desc {
    font-size: 0.7rem;
    color: #ddd; /* Lighter color for better visibility */
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.card-lighting {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.card-shadow-overlay {
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background-color: rgba(0,0,0,0.1);
    mix-blend-mode: multiply;
    pointer-events: none;
}

/* Info & Controls */
.rail-info-controls {
    margin-top: 0.5rem; /* Reduced gap */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Hide redundant info on mobile if showing on card */
@media (max-width: 768px) {
    .rail-info {
        display: none !important;
    }
    
    .rail-controls-group {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
}

@media (min-width: 768px) {
    .rail-info-controls {
        flex-direction: row;
        align-items: flex-start; /* Align text top */
    }
}

.rail-info {
    flex: 1;
    text-align: center;
    min-height: 6rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 768px) {
    .rail-info {
        text-align: left;
        align-items: flex-start;
    }
}

.info-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.info-content.active {
    opacity: 1;
    transform: translateY(0);
}

.rail-meta {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rail-highlight);
    display: block;
    margin-bottom: 0.3rem;
}

.rail-title {
    font-size: 1.45rem;
    line-height: 1.95rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--rail-text-main);
    margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
    .rail-title {
        font-size: 1.75rem;
        line-height: 2.1rem;
    }
}

.rail-desc {
    color: var(--rail-text-muted);
    max-width: 28rem;
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

/* Controls */
.rail-controls-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background-color: rgba(23, 23, 23, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--rail-text-muted);
    padding: 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-counter {
    min-width: 40px;
    text-align: center;
    font-size: 0.75rem;
    font-family: monospace;
    color: #737373; /* neutral-500 */
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background-color: white;
    color: black;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn i {
    transition: transform 0.2s;
}

.action-btn:hover i {
    transform: translate(2px, -2px);
}
