/* Tutorials Page Styles */

/* Adjust body to work with home page styles */
body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Main Layout - adjust for header */
.tutorial-container {
    display: flex;
    min-height: calc(100vh - 100px); /* Account for header */
    margin-top: 80px; /* Space for fixed header */
}

/* Sidebar Styles */
.tutorial-sidebar {
    width: 320px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    position: sticky;
    top: 80px; /* Account for header height */
    height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 10;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-header h3 {
    color: #64b5f6;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #b0bec5;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(100, 181, 246, 0.1);
    color: #64b5f6;
    border-color: rgba(100, 181, 246, 0.2);
    transform: translateX(4px);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.3);
}

.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link.active .chapter-number {
    background: rgba(255, 255, 255, 0.2);
}

.chapter-title {
    font-size: 0.9rem;
    line-height: 1.3;
    flex: 1;
}

/* Progress Indicator */
.progress-indicator {
    margin: 2rem 1.5rem 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #64b5f6, #42a5f5);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 12.5%;
}

.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #90a4ae;
}

/* Main Content */
.tutorial-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-width: calc(100vw - 320px);
}

.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.content-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.5rem;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #90a4ae;
    font-size: 0.9rem;
}

.content-type {
    background: rgba(100, 181, 246, 0.2);
    color: #64b5f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Loading Indicator */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #90a4ae;
}

.loading-indicator.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(100, 181, 246, 0.2);
    border-top: 3px solid #64b5f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tutorial Article */
/* Tutorial article styling */
.tutorial-article {
    line-height: 1.8;
    font-size: 1.1rem;
}

.tutorial-article h1 {
    color: #64b5f6;
    border-bottom: 2px solid #42a5f5;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.tutorial-article h2 {
    color: #90caf9;
    margin-top: 25px;
    margin-bottom: 15px;
}

.tutorial-article h3 {
    color: #bbdefb;
    margin-top: 20px;
    margin-bottom: 10px;
}

.tutorial-article p {
    margin-bottom: 15px;
    text-align: justify;
}

.tutorial-article ul, .tutorial-article ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.tutorial-article li {
    margin-bottom: 8px;
}

.tutorial-article code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #ffcc02;
}

.tutorial-article pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border-left: 4px solid #64b5f6;
}

.tutorial-article pre code {
    background: none;
    padding: 0;
    color: #e1f5fe;
}

/* Tutorial internal links styling */
.tutorial-article a.tutorial-link {
    color: #64b5f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(100, 181, 246, 0.1);
}

.tutorial-article a.tutorial-link:hover {
    color: #90caf9;
    background: rgba(100, 181, 246, 0.2);
    border-bottom: 1px solid #64b5f6;
    transform: translateY(-1px);
}

.tutorial-article a.tutorial-link:active {
    transform: translateY(0);
}

/* External links styling */
.tutorial-article a:not(.tutorial-link) {
    color: #81c784;
    text-decoration: none;
    border-bottom: 1px dotted #81c784;
    transition: all 0.3s ease;
}

.tutorial-article a:not(.tutorial-link):hover {
    color: #a5d6a7;
    border-bottom: 1px solid #81c784;
}

/* Mermaid Diagrams */
.tutorial-article .mermaid {
    text-align: center;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 3rem 2rem;
}

.welcome-message h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-message > p {
    font-size: 1.1rem;
    color: #b0bec5;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.tutorial-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.feature {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    background: rgba(100, 181, 246, 0.1);
    border-color: rgba(100, 181, 246, 0.3);
    box-shadow: 0 8px 25px rgba(100, 181, 246, 0.2);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature h3 {
    color: #64b5f6;
    font-size: 1.2rem;
    margin: 0 0 0.75rem;
}

.feature p {
    color: #b0bec5;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Content Navigation */
.content-navigation {
    display: flex;
    justify-content: space-between;
    margin: 3rem 0 2rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.4);
}

.nav-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: #607d8b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.prev-btn {
    margin-right: auto;
}

.next-btn {
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tutorial-container {
        flex-direction: column;
        margin-top: 70px; /* Adjust for mobile header */
    }
    
    .tutorial-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        padding: 1rem 0;
    }
    
    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
        padding: 0 1rem;
    }
    
    .tutorial-content {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .content-header h1 {
        font-size: 2rem;
    }
    
    .tutorial-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .content-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn {
        align-self: stretch;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tutorial-content {
        padding: 1rem;
    }
    
    .welcome-message {
        padding: 2rem 1rem;
    }
    
    .welcome-message h2 {
        font-size: 1.8rem;
    }
    
    .feature {
        padding: 1.5rem 1rem;
    }
}

/* Custom Scrollbar */
.tutorial-sidebar::-webkit-scrollbar,
.tutorial-content::-webkit-scrollbar {
    width: 6px;
}

.tutorial-sidebar::-webkit-scrollbar-track,
.tutorial-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.tutorial-sidebar::-webkit-scrollbar-thumb,
.tutorial-content::-webkit-scrollbar-thumb {
    background: rgba(100, 181, 246, 0.5);
    border-radius: 3px;
}

.tutorial-sidebar::-webkit-scrollbar-thumb:hover,
.tutorial-content::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 181, 246, 0.7);
}

/* Print Styles */
@media print {
    .tutorial-sidebar,
    .content-navigation,
    .footer {
        display: none !important;
    }
    
    .tutorial-content {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .tutorial-article {
        color: #000 !important;
    }
    
    .tutorial-article h1,
    .tutorial-article h2,
    .tutorial-article h3,
    .tutorial-article h4,
    .tutorial-article h5,
    .tutorial-article h6 {
        color: #333 !important;
    }
}
