/* =========================================
CLOCK7 CALCULATORS - SIDEBAR STYLES
FINAL RESPONSIVE VERSION (Improved v2.0)
========================================= */

/* =========================================
DESKTOP SIDEBAR
========================================= */
#calculator-sidebar {
 width: 280px; /* Slightly wider */
 background: #f9fafb; /* Light background for contrast */
 border: 1px solid #e5e7eb;
 border-radius: 16px; /* Smoother radius */
 padding: 25px;
 box-shadow: 0 8px 20px rgba(0,0,0,0.05);
 margin: 20px 0;
 flex-shrink: 0;
    position: sticky; /* Keep it visible when scrolling main content */
    top: 20px;
    height: calc(100vh - 40px); /* Fill screen height minus margin */
    overflow-y: auto; /* Allow scrolling within the sidebar */
}

/* Sidebar content */
.sidebar-inner {
 display: flex;
 flex-direction: column;
 gap: 30px; /* Increased spacing between sections */
}

.sidebar-section {
    padding-bottom: 20px;
    border-bottom: 1px dashed #e2e8f0;
}
.sidebar-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-section h3,
.sidebar-section h4 {
 color: #1f2937; /* Darker heading color */
 font-weight: 700;
 margin-bottom: 12px;
    font-size: 1.1rem;
    padding-bottom: 5px;
}

.sidebar-section p {
 color: #6b7280; /* Neutral gray */
 font-size: 0.88rem;
 line-height: 1.6;
}

.sidebar-links {
 list-style: none;
 padding: 0;
 margin: 0;
}

.sidebar-links li {
 margin-bottom: 8px; /* Tighter spacing for better lists */
}
.sidebar-links li.separator {
    height: 1px;
    background: #e2e8f0;
    margin: 10px 0;
}

/* GENERAL LINK STYLES */
.sidebar-links li a {
 color: #4b5563; /* Default link color */
 text-decoration: none;
 font-size: 0.95rem;
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-links li a:hover {
 color: #22c55e; /* Clock7 Green on hover */
    background: #ecfdf5; /* Light green background */
 text-decoration: none;
}

/* =========================================
   CATEGORY FILTER SPECIFIC STYLES
   ========================================= */
.category-links h4 {
    color: #22c55e;
}
.category-links a {
    font-weight: 500;
}

.category-links a.active {
    background: #22c55e; /* Highlight Active Filter */
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}
.category-links a.active:hover {
    color: #ffffff; /* Keep white text on hover */
    background: #10b981;
}


/* =========================================
LAYOUT WRAPPER
========================================= */
.calc-wrapper {
 display: flex;
 gap: 30px; /* Increased gap */
 align-items: flex-start;
 width: 100%;
 max-width: 1400px; /* Wider content area */
 margin: 0 auto;
 padding: 20px;
}

/* Main content */
.calculator-hub-container {
 flex-grow: 1;
    min-width: 0; /* Important for flex layout on small screens */
}


/* =========================================
TABLET (≤1200px) - Sidebar moves on top
========================================= */
@media (max-width: 1200px) {

 .calc-wrapper {
  flex-direction: column;
  max-width: 100%;
  padding: 12px;
 }

 #calculator-sidebar {
  width: 100%;
  margin-bottom: 10px;
        /* Reset desktop fixed positioning */
        position: relative;
        top: auto;
        height: auto;
        overflow-y: visible;
 }
    /* Horizontal layout for top sidebar */
    .sidebar-inner {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px 40px;
        padding-bottom: 10px;
    }
    .sidebar-section {
        border-bottom: none;
        padding-bottom: 0;
    }
    .sidebar-note {
        display: none; /* Hide long notes on tablet layout */
    }

 .calculator-hub-container {
  max-width: 100%;
  margin: 0;
 }
    .category-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .category-links li {
        margin: 0;
    }
    .category-links li a {
        padding: 6px 14px;
        font-size: 0.9rem;
        display: inline-block;
        white-space: nowrap;
    }
    .category-links li.separator {
        display: none;
    }
}


/* =========================================
MOBILE (≤768px) - Sidebar becomes OFF-CANVAS
========================================= */
@media (max-width: 768px) {
    /* Full width search bar forces content wider, adjust wrapper padding */
    .calc-wrapper {
  padding: 8px; 
 }

 #calculator-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  height: 100vh;
  width: 85%; /* Slightly less than 100% to show background */
        max-width: 320px;
  margin: 0;
  border-radius: 0;
  z-index: 1200;
  overflow-y: auto;
        background: #ffffff; /* Use white background for mobile for better contrast */
  transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0,0,0,0.2);
        padding: 20px;
        /* Reset mobile layout back to column for off-canvas */
        flex-direction: column;
        display: flex; /* Ensures close button aligns properly */
 }
    .sidebar-inner {
        flex-direction: column;
        gap: 25px;
    }
    .sidebar-section {
        border-bottom: 1px dashed #e2e8f0;
    }
    .category-links {
        display: block;
    }
    .category-links li a {
        display: block;
    }

 /* When activated (JS or future toggle) */
 #calculator-sidebar.active {
  left: 0;
 }
}


/* Mobile sidebar close button */
.sidebar-close-btn {
 display: none;
}

#sidebar-overlay {
 display: none;
}

/* Mobile only (Below 768px for clean off-canvas) */
@media (max-width: 768px) {

 .sidebar-close-btn {
  display: block;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  margin-bottom: 10px;
  align-self: flex-end;
        color: #6b7280;
 }

 #sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6); /* Darker overlay for focus */
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
 }

 #sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
 }
}