/* Documentation pages styles */
/* Inherits base styles from main project and adds documentation-specific styling */

/* Mobile viewport fixes */
html {
    height: 100%;
}

body {
    min-height: 100%;
    position: relative;
    /* Safe area insets for top notch */
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

/* Docs page layout for sticky footer */
.docs-page {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex !important; /* Force flex display during dynamic content loading */
    flex-direction: column;
}

.docs-page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Fix for mobile Safari viewport height */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
    
    .docs-page {
        min-height: -webkit-fill-available;
    }
}

/* Page animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Documentation container */
.docs-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: 'Roboto', sans-serif;
    line-height: 1.7;
    color: #333;
    animation: fadeIn 0.6s ease-out;
    flex: 1; /* Ensure container takes remaining space */
}

/* Documentation header */
.docs-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
    animation: fadeInUp 0.4s ease-out 0.1s both;
}

.docs-title {
    font-family: 'Horizon', 'Roboto', sans-serif;
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.docs-subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 300;
    animation: fadeInUp 0.4s ease-out 0.3s both;
}

/* Navigation breadcrumb */
.docs-breadcrumb {
    margin-bottom: 40px;
    font-size: 15px;
    color: #6c757d;
    padding: 16px 24px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    animation: fadeInUp 0.4s ease-out 0.1s both;
    display: flex;
    align-items: center;
    gap: 8px;
}

.docs-breadcrumb::before {
    content: '🏠';
    font-size: 16px;
    margin-right: 4px;
}

.docs-breadcrumb a {
    color: #3498db;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.docs-breadcrumb a:hover {
    color: #2980b9;
    background-color: rgba(52, 152, 219, 0.1);
}

.docs-breadcrumb .separator {
    margin: 0 4px;
    color: #adb5bd;
    font-weight: 600;
}

/* Documentation content */
.docs-content {
    margin-bottom: 20px; /* Reduced margin to prevent footer overlap */
    animation: fadeInUp 0.4s ease-out 0.2s both;
}

.docs-content h1 {
    font-size: 32px;
    color: #2c3e50;
    margin: 48px 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 3px solid #3498db;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.docs-content h2 {
    font-size: 26px;
    color: #34495e;
    margin: 40px 0 20px 0;
    padding-left: 20px;
    border-left: 5px solid #3498db;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.docs-content h3 {
    font-size: 22px;
    color: #34495e;
    margin: 32px 0 16px 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.docs-content p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    font-weight: 400;
}

.docs-content ul, .docs-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.docs-content li {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.7;
    color: #444;
}

.docs-content strong {
    color: #2c3e50;
    font-weight: 700;
}

.docs-content em {
    color: #6c757d;
    font-style: italic;
    font-weight: 500;
}

/* Info boxes */
.docs-info-box {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}

.docs-warning-box {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}

.docs-danger-box {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}

/* Documentation navigation */
.docs-nav {
    margin-bottom: 40px;
}

/* Navigation grid for index page */
.docs-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
    padding: 0;
    animation: fadeInUp 0.4s ease-out 0.3s both;
}

.docs-nav-card {
    background: #ffffff;
    padding: 28px 24px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e9ecef;
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out both;
}

.docs-nav-card:nth-child(1) {
    animation-delay: 0.4s;
}

.docs-nav-card:nth-child(2) {
    animation-delay: 0.5s;
}

.docs-nav-card:nth-child(3) {
    animation-delay: 0.6s;
}

.docs-nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-nav-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.docs-nav-card:hover::before {
    transform: scaleX(1);
}

.docs-nav-icon {
    font-size: 56px;
    margin-bottom: 24px;
    display: block;
    color: #3498db;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    transform-origin: center;
}

.docs-nav-card:hover .docs-nav-icon {
    transform: scale(1.1);
    color: #2980b9;
}

.docs-nav-card h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.docs-nav-card:hover h3 {
    color: #3498db;
}

.docs-nav-card p {
    margin: 0;
    color: #6c757d;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
}

/* Legacy navigation styles for compatibility */
.docs-nav h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
}

.docs-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-nav-item {
    margin-bottom: 12px;
}

.docs-nav-link {
    display: block;
    padding: 12px 16px;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.docs-nav-link:hover {
    background-color: #e9ecef;
    color: #3498db;
    border-color: #3498db;
}

.docs-nav-link.active {
    background-color: #3498db;
    color: white;
}

/* Footer */
.docs-footer {
    border-top: 1px solid #e9ecef;
    margin-top: 60px;
    padding: 20px 0;
    text-align: center;
    background-color: #f8f9fa;
    /* Safe area insets for bottom home indicator */
    padding-bottom: calc(20px + constant(safe-area-inset-bottom));
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

.docs-footer p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.docs-footer a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.docs-footer a:hover {
    color: #495057;
    text-decoration: underline;
}

.footer-separator {
    color: #adb5bd;
    font-size: 14px;
    opacity: 0.7;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: calc(20px + constant(safe-area-inset-bottom));
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 20px;
    width: 44px;
    height: 44px;
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    z-index: 999;
    opacity: 0.8;
}

.back-to-top:hover {
    background-color: #e9ecef;
    color: #495057;
    opacity: 1;
}

.back-to-top.show {
    display: flex;
}

/* Responsive design */
@media (max-width: 768px) {
    .docs-container {
        padding: 24px 16px;
    }
    
    .docs-title {
        font-size: 30px;
    }
    
    .docs-subtitle {
        font-size: 16px;
    }
    
    .docs-nav-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin: 32px 0;
        padding: 0;
    }
    
    .docs-nav-card {
        padding: 32px 24px;
    }
    
    .docs-nav-icon {
        font-size: 48px;
        margin-bottom: 20px;
    }
    
    .docs-nav-card h3 {
        font-size: 20px;
    }
    
    .docs-nav-card p {
        font-size: 14px;
    }
    
    .docs-breadcrumb {
        padding: 12px 16px;
        font-size: 14px;
        flex-wrap: wrap;
    }
    
    .docs-content h1 {
        font-size: 28px;
        margin: 32px 0 20px 0;
    }
    
    .docs-content h2 {
        font-size: 22px;
        margin: 28px 0 16px 0;
        padding-left: 16px;
    }
    
    .docs-content h3 {
        font-size: 20px;
        margin: 24px 0 12px 0;
    }
    
    .docs-content p {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 18px;
    }
    
    .docs-content li {
        font-size: 15px;
        line-height: 1.6;
    }
    
    .back-to-top {
        bottom: 70px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .docs-container {
        padding: 20px 12px;
    }
    
    .docs-title {
        font-size: 26px;
    }
    
    .docs-subtitle {
        font-size: 15px;
    }
    
    .docs-nav-card {
        padding: 24px 20px;
    }
    
    .docs-nav-icon {
        font-size: 40px;
        margin-bottom: 16px;
    }
    
    .docs-nav-card h3 {
        font-size: 18px;
    }
    
    .docs-nav-card p {
        font-size: 13px;
    }
    
    .docs-breadcrumb {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .docs-content h1 {
        font-size: 24px;
    }
    
    .docs-content h2 {
        font-size: 20px;
        padding-left: 12px;
    }
    
    .docs-content h3 {
        font-size: 18px;
    }
    
    .docs-content p {
        font-size: 14px;
    }
    
    .docs-content li {
        font-size: 14px;
    }
    
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    /* Mobile docs page layout */
    .docs-page {
        min-height: 100vh;
    }
    
    /* Ensure footer is accessible on mobile */
    .docs-footer {
        padding-bottom: 20px;
        position: relative;
        margin-top: auto;
    }
    
    /* Add bottom padding to prevent content cutoff */
    .docs-container {
        padding-bottom: 20px;
    }
}