/**
 * CryptoInsight - Responsive Layout Shell Styles
 *
 * Implements desktop multi-column and mobile single-column layouts
 * with responsive breakpoint at 768px.
 *
 * Version: 1.0
 * Date: 2025-10-21
 * Story: 8.2 - Responsive Layout Shell
 */

/* ========================================
   LAYOUT CONTAINER
   ======================================== */

.layout-container {
    width: 100%;
    min-height: calc(100vh - 64px); /* Full height minus AppBar */
    background-color: var(--serenity-background);
}

/* ========================================
   DESKTOP LAYOUT (≥768px)
   ======================================== */

@media (min-width: 768px) {
    .desktop-layout {
        display: flex;
        /*max-width: 1440px;*/
        margin: 0 auto;
        padding: var(--serenity-spacing-lg);
        gap: var(--serenity-spacing-lg);
    }

    .center-content {
        flex: 1 1 70%;
        /*max-width: 1008px;*/ /* 70% of 1440px */
        min-width: 0; /* Prevent flex overflow */
    }

    .right-sidebar {
        flex: 0 0 360px;
        width: 360px;
        position: relative;
        transition: width 300ms ease-in-out, flex-basis 300ms ease-in-out;
    }

    .right-sidebar.collapsed {
        flex: 0 0 48px;
        width: 48px;
        overflow: hidden;
    }

    .sidebar-content {
        width: 360px;
        opacity: 1;
        transition: opacity 200ms ease-in-out;
    }

    .right-sidebar.collapsed .sidebar-content {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-toggle {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 10;
    }

    .right-sidebar.collapsed .sidebar-toggle {
        position: static;
    }
}

/* ========================================
   MOBILE LAYOUT (<768px)
   ======================================== */

@media (max-width: 767px) {
    .mobile-content {
        width: 100%;
        padding: var(--serenity-spacing-md);
    }

    /* Hide desktop-only elements */
    .desktop-layout {
        display: none;
    }
}

/* ========================================
   APPBAR CUSTOMIZATIONS
   ======================================== */

.mud-appbar {
    box-shadow: var(--mud-elevation-1) !important;
    background-color: var(--serenity-surface) !important;
    color: var(--serenity-neutral-dark) !important;
}

/* ========================================
   DRAWER CUSTOMIZATIONS
   ======================================== */

.mud-drawer {
    background-color: var(--serenity-surface);
}

.mud-drawer-header {
    border-bottom: 1px solid var(--serenity-neutral-light);
    padding: var(--serenity-spacing-md);
}

.mud-nav-link {
    border-radius: var(--serenity-border-radius-sm);
    margin-bottom: var(--serenity-spacing-xs);
}

.mud-nav-link:hover {
    background-color: rgba(74, 144, 164, 0.08);
}

.mud-nav-link.active {
    background-color: rgba(74, 144, 164, 0.12);
    color: var(--serenity-primary);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 768px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Ensure smooth transitions respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .right-sidebar,
    .sidebar-content,
    .mud-nav-link {
        transition-duration: 0.01ms !important;
    }
}

/* Focus indicators for navigation */
.mud-nav-link:focus-visible,
.mud-menu-item:focus-visible {
    outline: 2px solid var(--serenity-primary);
    outline-offset: 2px;
}

/* ========================================
   CONTENT SPACING
   ======================================== */

/* Add consistent spacing for page content */
.page-content {
    padding: var(--serenity-spacing-lg);
}

@media (max-width: 767px) {
    .page-content {
        padding: var(--serenity-spacing-md);
    }
}

/* ========================================
   LAYOUT DEBUGGING (Development Only)
   ======================================== */

/* Uncomment to visualize layout boundaries during development
.desktop-layout {
    border: 2px solid red;
}

.center-content {
    border: 2px solid blue;
}

.right-sidebar {
    border: 2px solid green;
}
*/


/* ========================================
   CRYPTO NEWS PAGE STYLES
   ======================================== */

/* Truncate long article titles with ellipsis */
.news-title-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Optional: Sentiment color classes for enhanced visual clarity */
.sentiment-positive {
    color: var(--mud-palette-success);
    font-weight: 600;
}

.sentiment-neutral {
    color: var(--mud-palette-warning);
    font-weight: 600;
}

.sentiment-negative {
    color: var(--mud-palette-error);
    font-weight: 600;
}

