/* =========================
   1. ROOT VARIABLES & BODY
========================= */
:root {
  --bg:#e5e7eb;
  --panel:#ffffffcc;
  --edge: #c6c6c9; /* Light border for card effect */
  --text:#0f172a;
  --muted:#6b7280;
  --blue:#3b82f6;
  --ring:#dbeafe;
  --shadow:0 10px 24px rgba(15,23,42,.08);
}

html, body {
  margin: 0;
  background: var(--bg);
  font-family: 'Montserrat', sans-serif;
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* same as your header height */
}

/* Header styling */
header {
    background-color: #e5e7eb; /* Light gray */
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    height: 5rem;
     /* Add subtle shadow */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    gap: 1rem; /* reduce spacing between h1 and nav */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-left: 5vw;   /* Add as much as you want : view width*/
    padding-right: 5vw;  /* Or use padding-inline: 3vw; */
}

header h1 {
    font-size: 1.2rem; /* 18px */
    font-weight: 400;
    font-family: 'Montserrat', sans-serif;
}

header h1 a {
    text-decoration: none;
    color: inherit; /* inherits color from parent (removes forced gray) */
    position: relative; /* for custom underline */
    padding-bottom: 2px;
}
header h1 a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

header h1 a:hover::after {
    width: 100%;
}


/* Mobile menu toggle button - hidden by default */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 20;
}

.mobile-menu-toggle span {
    width: 2rem;
    height: 0.25rem;
    background: var(--text);
    border-radius: 0.125rem;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Hamburger animation when active */
.mobile-menu-toggle.active span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Nav container styling */
.desktop-nav {
    display: flex;
    gap: 2rem;
}

/* Mobile nav - hidden by default */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--edge);
    box-shadow: var(--shadow);
    z-index: 15;
}

.mobile-nav.active {
    display: flex;
}

/* Nav links */
.desktop-nav a,
.mobile-nav a {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;  /* ~19px */
    font-weight: 400;
    text-decoration: none;
    color: inherit; /* inherits color from parent (removes forced gray) */
    position: relative; /* for custom underline */
    padding-bottom: 2px;
}

/* Underline effect on hover */
.desktop-nav a::after,
.mobile-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.desktop-nav a:hover::after,
.mobile-nav a:hover::after {
    width: 100%;
}

.desktop-nav a.active::after,
.mobile-nav a.active::after {
    width: 100%;
    background-color: currentColor; /* underline for active link */
}

/* Main container styling */
.main-container {
    background-color: #e5e7eb; /* Light gray */
    display: flex;
    flex: 1;
    padding-left: 6vw;   /* Add as much as you want : view width*/
    padding-right: 6vw;  /* Or use padding-inline: 3vw; */
}

/* Sidebar container */
aside {
    width: 18rem; /* 256px */
    background-color: #e5e7eb;
    color: #1f2937;
    position: sticky; /* stick while scrolling main */
    top: 4rem; /* SAME as your header height! */
    align-self: flex-start;    /* Don't stretch full page */
    padding-top: 2rem;         /* Padding from header */
    padding-bottom: 2rem;
    /* Padding left/right optional for more spacing:
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    Padding goes anti-clock wise: top, right, bottom left
    */
    
}

/* Sidebar scroll area: independent scrolling */
.sidebar-scroll {
    max-height: calc(100vh - 4rem - 2rem); /* viewport - header - padding */
    overflow-y: auto;
    padding-right: 2px;    /* prevent scrollbar overlay */
    
    
}

/* Target the custom scroll area, e.g. sidebar */
.sidebar-scroll::-webkit-scrollbar {
  width: 8px; /* thin scrollbar (adjust as you like) */
}

/* Hide arrows (buttons) */
.sidebar-scroll::-webkit-scrollbar-button {
  display: none;
  height: 0;
}

/* Track styling */
.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent; /* or any color */
}

/* Thumb styling */
.sidebar-scroll::-webkit-scrollbar-thumb {
  background-color: #9ca3af; /* light gray thumb */
  border-radius: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #6b7280; /* darker on hover */
}

/* Sidebar list */
ul#sidebar-menu {
    list-style: none;
    padding: 0;
    gap: 1.5rem;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Sidebar item box style */
.sidebar-item {
    border-left: 8px solid transparent; /* Blue for active/hover only */
    background-color: #e5e7eb; /* Slightly whiter than page bg for visible box */
    
    box-shadow: 0 2px 8px rgba(60, 60, 60, 0.08); /* Soft card shadow */
    border: 1.5px solid #c6c6c9; /* Light border for card effect */
    transition: border-left 0.3s, box-shadow 0.3s ;
    margin: 0 0.25rem;        /* Space between box and sidebar edge */
}

.sidebar-item:hover, .sidebar-item.active {
    border-left-color: #3b82f6; /* Blue border */
    background-color: rgba(59, 130, 246, 0.1); /* Light blue background */
    border-left-width: 3.5px;
}

/* Padding inside item/card */
.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 0.85rem 0.75rem; /* vertical / horizontal padding inside box */
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Icon styling */
.sidebar-icon {

    font-size: 1.3em;
    width: 1.4em;
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    margin-right: 1.2rem;
    margin-left: 1.2rem;
    color: #3b82f6;
}


/* Icon styling */
.sidebar-icon-dice {

    font-size: 1.7em;
    width: 1.4em;
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    margin-right: 1.2rem;
    margin-left: 1.2rem;
    color: #3b82f6;
}

/* Icon styling */
.sidebar-icon-calculator {

    font-size: 1.9em;
    width: 1.4em;
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    margin-right: 1.2rem;
    margin-left: 1.2rem;
    color: #3b82f6;
}

/* Hover: ONLY blue left border, no background change */
.sidebar-item:hover {
    border-left-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(50, 100, 250, 0.08);
    background-color: #e5e7eb;
}

/* Active: ONLY blue left border, no background change */
.sidebar-item.active {
    border-left-color: #3b82f6;
    background-color: #e5e7eb;
}
/* Link area inside sidebar */
.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-decoration: none;
    color: inherit;
}

/* Icon styling 
.sidebar-icon {
    width: 1.5rem;
    height: 1.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
    vertical-align: middle;
    margin-right: 1.2rem;
    margin-left: 1.2rem;
} */



/* Item title container */
.item-title-container {
   padding: 0.5rem 0; /* Padding around title and subtitle */
    display: flex;
    flex-direction: column;
    gap: 0.25rem; /* Space between title and subtitle */
    width: 100%; /* Full width of the item */
    box-sizing: border-box; /* Include padding in width */
}
/* Item text styling */
.item-title {
    font-weight: 600;
    font-family: 'Montserrat', sans-serif ;
    padding-bottom: 4px;/* Space below title */
}

.item-subtitle {
    font-size: 0.875rem; /* 14px */
    font-family: 'Montserrat', sans-serif ;
}

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

/* Mobile-first approach: Start with mobile styles, then add desktop styles */

/* Large tablets and small desktops (768px and up) */
@media (max-width: 1024px) {
    .main-container {
        padding-left: 3vw;
        padding-right: 3vw;
    }
    
    .header-container {
        padding-left: 3vw;
        padding-right: 3vw;
    }
    
    aside {
        width: 16rem; /* Slightly smaller sidebar */
    }
}

/* Tablets (768px and down) */
@media (max-width: 768px) {
    /* Header adjustments */
    header {
        padding: 0.75rem;
        height: auto;
        min-height: 4rem;
    }
    
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding-left: 2vw;
        padding-right: 2vw;
        align-items: flex-start;
    }
    
    header h1 {
        font-size: 1.1rem;
    }
    
    /* Show mobile menu toggle, hide desktop nav */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .mobile-nav a {
        font-size: 1rem;
    }
    
    /* Main container - stack sidebar and main content */
    .main-container {
        flex-direction: column;
        padding-left: 2vw;
        padding-right: 2vw;
    }
    
    /* Sidebar becomes horizontal on tablets */
    aside {
        width: 100%;
        position: relative;
        top: 0;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .sidebar-scroll {
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
        padding-bottom: 8px;
    }
    
    ul#sidebar-menu {
        flex-direction: row;
        gap: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .sidebar-item {
        min-width: 200px;
        flex-shrink: 0;
    }
}

/* Mobile phones (480px and down) */
@media (max-width: 480px) {
    /* Header for mobile */
    .header-container {
        padding-left: 4vw;
        padding-right: 4vw;
    }
    
    header h1 {
        font-size: 1rem;
    }
    
    nav {
        gap: 1rem;
        width: 100%;
    }
    
    .mobile-nav a {
        font-size: 0.9rem;
        text-align: left;
    }
    
    /* Main container */
    .main-container {
        padding-left: 4vw;
        padding-right: 4vw;
    }
    
    /* Sidebar on mobile - stack vertically again but more compact */
    ul#sidebar-menu {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .sidebar-item {
        min-width: auto;
        margin: 0;
    }
    
    .sidebar-item a {
        padding: 0.6rem 0.5rem;
    }
    
    .item-title {
        font-size: 0.9rem;
    }
    
    .item-subtitle {
        font-size: 0.8rem;
    }
    
    .sidebar-icon,
    .sidebar-icon-dice,
    .sidebar-icon-calculator {
        font-size: 1.1em;
        margin-right: 0.8rem;
        margin-left: 0.8rem;
    }
}

/* Extra small phones (360px and down) */
@media (max-width: 360px) {
    .header-container {
        padding-left: 2vw;
        padding-right: 2vw;
    }
    
    .main-container {
        padding-left: 2vw;
        padding-right: 2vw;
    }
    
    .mobile-nav a {
        font-size: 0.8rem;
    }
    
    .item-title {
        font-size: 0.85rem;
    }
    
    .item-subtitle {
        font-size: 0.75rem;
    }
}






