/*
Theme Name: AlgoMonster Clone
Description: A WordPress theme inspired by AlgoMonster with left sidebar navigation and right content area
Version: 1.0
Author: Your Name
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.content-body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header styles */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.site-logo {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
}

.main-navigation {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #2c3e50;
}

.upgrade-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

.upgrade-btn::after {
    content: "50% OFF";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Banner styles */
.discount-banner {
    background: #28a745;
    color: white;
    text-align: center;
    padding: 12px 20px;
    position: relative;
}

.banner-close {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

/* Main layout */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    min-height: calc(100vh - 120px);
}

/* Sidebar styles */
.sidebar {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.user-level {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
    color: #495057;
}

.search-box {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.sidebar-section {
    margin-bottom: 25px;
}

.section-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 12px; /* Increased spacing between menu items */
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    color: #6c757d;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background: #f8f9fa;
    color: #495057;
}

.sidebar-menu a.locked {
    color: #adb5bd;
    cursor: not-allowed;
}

.sidebar-menu a.locked::after {
    content: "🔒";
    margin-left: auto;
    font-size: 12px;
}

.sidebar-menu a.active {
    background: #667eea;
    color: white;
}

/* Collapsible sidebar sections */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.collapsible-header:hover {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 12px;
    margin: -8px -12px;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.collapsible-header.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
    padding-top: 15px; /* Add gap between header and content */
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Animation for smooth collapse/expand */
.collapsible-section {
    transition: all 0.3s ease;
}

.collapsible-section.collapsed {
    margin-bottom: 10px;
}

/* Hover effects for collapsible headers */
.collapsible-header:hover .toggle-icon {
    color: #495057;
}

/* Active section highlighting */
.collapsible-section.has-active .collapsible-header {
    background: #e3f2fd;
    border-radius: 6px;
    padding: 8px 12px;
    margin: -8px -12px;
}

.collapsible-section.has-active .toggle-icon {
    color: #1976d2;
}

/* Focus states for accessibility */
.collapsible-header:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .collapsible-header {
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .toggle-icon {
        font-size: 14px;
    }
    
    .collapsible-content {
        padding-left: 16px;
    }
    
    /* Auto-expand sections with active items on mobile */
    .collapsible-section.has-active .collapsible-content {
        max-height: none !important;
        opacity: 1 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .collapsible-header,
    .collapsible-content,
    .toggle-icon,
    .collapsible-section {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .collapsible-header:hover {
        background: #000;
        color: #fff;
    }
    
    .collapsible-section.has-active .collapsible-header {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
}

/* Main content styles */
.main-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.content-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.language-selector {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

/* Template grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.template-btn {
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.template-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.template-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Code block styles */
.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.copy-btn:hover {
    background: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
    
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
    
    .main-navigation {
        margin-top: 15px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility classes */
.hidden {
    display: none;
}

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

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
} 