/* ============================================
   ROUTER & NAVIGATION STYLES
============================================ */

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.page-loader.show {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-content p {
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

/* Error Pages */
.error-page {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-content h1 {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.error-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin: 1rem 0;
}

.error-content p {
    color: #64748b;
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Article Pages */
.blog-article,
.help-article {
    padding: 120px 0 80px 0;
    margin-top: 80px;
}

.article-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb span {
    color: #64748b;
}

.article-header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 1rem;
    color: #64748b;
    font-size: 0.875rem;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    color: #374151;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin: 2.5rem 0 1rem;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 2rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: #64748b;
}

.article-content code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: #dc2626;
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 2rem 0;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Category Pages */
.help-category {
    padding: 120px 0 80px 0;
    margin-top: 80px;
}

.category-header {
    margin-bottom: 3rem;
    text-align: center;
}

.category-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1rem;
}

.category-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* Page Transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

/* Navigation Active States */
.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* Body Classes for Different Pages */
.home-page .navbar {
    /* Home page specific navbar styles */
}

.blog-page .navbar,
.help-page .navbar,
.demo-page .navbar {
    background: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.blog-page .nav-link,
.help-page .nav-link,
.demo-page .nav-link {
    color: #1e293b !important;
}

.blog-page .logo span,
.help-page .logo span,
.demo-page .logo span {
    color: var(--primary-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .error-content h1 {
        font-size: 5rem;
    }
    
    .error-content h2 {
        font-size: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 0 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
    }
    
    .article-content p {
        font-size: 1rem;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .category-articles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .error-content h1 {
        font-size: 4rem;
    }
    
    .article-header {
        text-align: center;
    }
    
    .article-header h1 {
        font-size: 1.75rem;
    }
    
    .blog-article,
    .help-article,
    .help-category {
        padding: 100px 0 60px 0;
    }
}

/* Smooth Loading Animation */
.route-loading {
    animation: routeLoad 0.3s ease-out;
}

@keyframes routeLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Results Highlighting */
.search-result-highlight {
    background: linear-gradient(120deg, transparent 0%, rgba(59, 130, 246, 0.1) 50%, transparent 100%);
    animation: highlightPulse 1.5s ease-out;
}

@keyframes highlightPulse {
    0% { 
        background-position: -100% 0;
    }
    100% { 
        background-position: 100% 0;
    }
}

/* Progressive Web App Support */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pwa-install-prompt.show {
    transform: translateY(0);
}

.pwa-install-prompt h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #1e293b;
}

.pwa-install-prompt p {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.9rem;
}

.pwa-install-buttons {
    display: flex;
    gap: 0.75rem;
}

.pwa-install-buttons button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.pwa-install-buttons .install-btn {
    background: var(--primary-color);
    color: white;
}

.pwa-install-buttons .install-btn:hover {
    background: var(--primary-dark);
}

.pwa-install-buttons .dismiss-btn {
    background: #e2e8f0;
    color: #64748b;
}

.pwa-install-buttons .dismiss-btn:hover {
    background: #cbd5e1;
}

/* Accessibility Improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    border-radius: 4px;
    text-decoration: none;
    z-index: 10001;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .page-loader,
    .breadcrumb,
    .pwa-install-prompt {
        display: none !important;
    }
    
    .article-content {
        max-width: none;
        margin: 0;
    }
    
    .article-header h1 {
        color: #000;
        font-size: 24pt;
        margin-bottom: 12pt;
    }
    
    .article-content p {
        font-size: 12pt;
        line-height: 1.5;
        margin-bottom: 12pt;
    }
    
    .article-content a {
        color: #000;
        text-decoration: underline;
    }
    
    .article-content code {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }
}