/* Custom CSS for Shell2R */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Page transitions */
.page-content {
    animation: fadeIn 0.5s ease-in-out;
}

/* Tutorial cards */
.tutorial-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.tutorial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px 0 rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.tutorial-card h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.tutorial-card .meta {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.tutorial-card .category {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
}

.tutorial-card .excerpt {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-card .read-more {
    color: #3b82f6;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.tutorial-card .read-more:hover {
    color: #1d4ed8;
}

/* Category buttons */
.category-btn {
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
}

.category-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.category-btn.active {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
}

/* Search input enhancements */
#search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Code blocks styling */
pre {
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

pre code {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Inline code */
:not(pre) > code {
    background: #f1f5f9;
    color: #475569;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Tutorial content styling */
.tutorial-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.tutorial-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.tutorial-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 1.5rem 0 0.75rem 0;
}

.tutorial-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 1.25rem 0 0.5rem 0;
}

.tutorial-content p {
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #374151;
}

.tutorial-content ul, .tutorial-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.tutorial-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #374151;
}

.tutorial-content blockquote {
    border-left: 4px solid #3b82f6;
    background: #f8fafc;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #475569;
}

.tutorial-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tutorial-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.tutorial-content th,
.tutorial-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tutorial-content th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

/* Responsive design enhancements */
@media (max-width: 768px) {
    .tutorial-content h1 {
        font-size: 2rem;
    }
    
    .tutorial-content h2 {
        font-size: 1.5rem;
    }
    
    .tutorial-content h3 {
        font-size: 1.25rem;
    }
    
    pre code {
        font-size: 0.75rem;
    }
    
    .tutorial-content table {
        font-size: 0.875rem;
    }
    
    .tutorial-content th,
    .tutorial-content td {
        padding: 0.5rem 0.75rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Search results highlighting */
.search-highlight {
    background-color: #fef3c7;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Sidebar enhancements */
.sidebar-link {
    display: block;
    padding: 0.5rem 0;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-link:hover {
    color: #3b82f6;
}

.sidebar-link:last-child {
    border-bottom: none;
}

/* Category count badges */
.category-count {
    background: #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #3b82f6;
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
    }
    
    .tutorial-content {
        max-width: none;
    }
    
    pre {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tutorial-card {
        border: 2px solid #000;
    }
    
    .tutorial-card:hover {
        border-color: #3b82f6;
        border-width: 3px;
    }
}

