/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --background-color: #ffffff;
    --sidebar-bg: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --hover-bg: #f1f5f9;
    --active-bg: #e0e7ff;
    --active-text: #4338ca;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #60a5fa;
        --secondary-color: #94a3b8;
        --background-color: #0f172a;
        --sidebar-bg: #1e293b;
        --text-color: #e2e8f0;
        --border-color: #334155;
        --hover-bg: #334155;
        --active-bg: #1e3a8a;
        --active-text: #93bbfb;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Container Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Navigation List */
.nav-list {
    list-style: none;
    padding: 1rem 0;
}

.nav-list li {
    position: relative;
}

.nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background-color: var(--hover-bg);
    border-left-color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--active-bg);
    color: var(--active-text);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Arrow indicator for expandable items */
.has-submenu > .nav-link::after {
    content: '▼';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.has-submenu.expanded > .nav-link::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Submenu */
.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.has-submenu.expanded .submenu {
    max-height: 500px;
}

.submenu .nav-link {
    padding: 0.5rem 1.5rem 0.5rem 3rem;
    font-size: 0.9rem;
    border-left-width: 0;
}

.submenu .nav-link::before {
    content: '•';
    position: absolute;
    left: 2rem;
    color: var(--secondary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 480px;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

/* Search Container 
ALS 30Aug2025 added:

    position:fixed;
    left: 330px;    
    width: 800px;
    margin: 0 auto;
*/
.search-container { 
    margin-bottom: 2rem;
    position: absolute;
    left: 330px;    
    width: 400px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Content Sections 
 ALS 30Aug2025 added:
    position:absolute;
    left: 330px;    
    max-width: 900px;
    margin: 0 auto; 
*/

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;    
    position: absolute;
    margin-top: auto;
    top: 60px;
    left: 330px;    
    max-width: 900px;
    margin: 0 auto;    
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Sections h1 
 ALS 30Aug2025 added:
text-align: center;  
*/

.content-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;    
}

.content-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

.content-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
}

.content-section p {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    line-height: 1.8;
}

.content-section ul {
    margin: 1rem 0 1.5rem 2rem;
}

.content-section ol {
    margin: 1rem 0 1.5rem 2rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

/* Subtitle styling */
.subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

/* Images */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-style: italic;
}

/* Grid Layouts */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.audio-modes-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.mode-box {
    text-align: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.mode-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.grid-2x2 {
    display: grid;
    height: auto;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-2x1 {
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-item {
    text-align: center;
    padding: 1rem;
}

.grid-item h2 {
    margin-bottom: 1rem;
}

/* Indented text */
.indent {
    margin-left: 2rem;
}

@media (max-width: 768px) {
    .modes-grid,
    .audio-modes-grid,
    .grid-2x2,
    .grid-2x1 {
        grid-template-columns: 1fr;
    }
}

/* Keyboard Keys */
kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

/* Links Box */
.links-box {
    background-color: var(--sidebar-bg);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.links-box p {
    margin: 0.25rem 0;
}

/* Copyright text */
.copyright {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--secondary-color);
    text-align: center;
}

/* Links in content */
.content-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.content-section a:hover {
    border-bottom-color: var(--primary-color);
}

/* Modes Grid */
.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(768px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.audio-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(768px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.mode-box {
    text-align: center;
}

.mode-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.mode-box img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: block;
    }
    
    /* ALS 30Aug2025 added font-size: and text-align:    position:absolute;    left:150px   */
    .main-content {
        margin-left: 0;
        padding: 1rem;
    position:absolute;
    left:150px  
    }
    
    .content-section h1 {
        font-size: 2rem;
    }
    
    .content-wrapper {
        padding-top: 60px;
    }
    
    /* Mobile header */
    .sidebar-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: var(--sidebar-bg);
        z-index: 1001;
        box-shadow: var(--shadow);
    }
    
    .nav-list {
        margin-top: 80px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #3b82f6;
        --secondary-color: #94a3b8;
        --background-color: #0f172a;
        --sidebar-bg: #1e293b;
        --text-color: #f1f5f9;
        --border-color: #334155;
        --hover-bg: #334155;
        --active-bg: #1e3a8a;
        --active-text: #93bbfc;
    }
    
    .links-box {
        background-color: var(--sidebar-bg);
    }
    
    .search-input {
        background-color: var(--sidebar-bg);
        color: var(--text-color);
    }
    
    kbd {
        background-color: #334155;
        border-color: #475569;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .search-container,
    .menu-toggle {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
      /* ALS 30Aug2025 added font-size: 1rem; and text-align: initial; display: block !important;  */
    .content-section {
         display: block !important;  
        page-break-after: always;

    }
}