/* Common Styles for Elephant Project */

/* Light Theme & Font */
body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f8f9fa; /* Light gray background */
    color: #212529;
}

.font-mono {
    font-family: 'IBM Plex Mono', monospace;
}

/* Gradient Text for Light Theme */
.gradient-text {
    background: linear-gradient(90deg, #0d6efd, #6f42c1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Card (Used on index.html) */
.card {
    background-color: #FFFFFF; /* White background for cards */
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #0d6efd;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -15px rgba(13, 110, 253, 0.2);
}

/* Nav Link (Used on index.html) */
.nav-link {
    padding: 8px 16px;
    color: #495057;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: #212529;
    border-bottom-color: #0d6efd;
}

/* Docs Page Layout */
.docs-container {
    display: flex;
}

.main-content {
    flex-grow: 1;
    background-color: #FFFFFF; /* White background for main content area */
    min-width: 0;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.sidebar a {
    display: block;
    padding: 10px 16px;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar a:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}

.sidebar a.active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 700;
}

/* Docs Page Content Elements */
.content-section h2 {
    font-size: 1.875rem;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
    color: #212529;
}

.content-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #343a40;
}

.code-block {
    overflow-x: auto;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
}

.inline-code {
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
    font-family: 'IBM Plex Mono', monospace;
    color: #d63384;
}

.diagram-container {
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.diagram-container img {
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    background-color: #FFFFFF; /* Ensure diagram background is white */
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.diagram-container img:hover {
    transform: scale(1.008);
}

/* Common Text color adjustments */
h1, h4, ul li {
    color: #212529;
}

p, b {
    color: #495057;
}

b {
    font-weight: 600;
    color: #212529;
}

.text-gray-400, .text-gray-500 {
    color: #6c757d !important;
}

footer p, footer a {
    color: #6c757d;
}

footer a:hover {
    color: #0d6efd;
}

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

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.4s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.6s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.8s; opacity: 0; }

/* Table of Contents (TOC) Styles - Sidebar Integration */
.toc-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.toc-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    color: #495057;
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.toc-item {
    margin: 0;
    padding: 0;
}

.toc-link {
    display: block;
    padding: 8px 16px;
    color: #6c757d;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    line-height: 1.4;
}

.toc-level-2 .toc-link {
    padding-left: 20px;
    font-weight: 500;
}

.toc-level-3 .toc-link {
    padding-left: 32px;
    font-size: 0.8rem;
    color: #868e96;
}

.toc-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
    text-decoration: none;
}

.toc-link.active {
    color: #0d6efd;
    border-left-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    font-weight: 600;
}

/* Mobile TOC styles */
@media (max-width: 768px) {
    .toc-section {
        display: none;
    }

    /* 모바일에서는 기존 floating TOC 사용 */
    .toc-container {
        position: fixed;
        top: 20px;
        right: 20px;
        width: 280px;
        max-height: 70vh;
        overflow-y: auto;
        background: #ffffff;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .toc-container.toc-expanded {
        transform: translateX(0);
    }

    .toc-toggle {
        display: block;
        position: fixed;
        top: 20px;
        right: 20px;
        background: #0d6efd;
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1001;
        transition: all 0.3s ease;
    }

    .toc-toggle:hover {
        background: #0b5ed7;
        transform: scale(1.1);
    }
}

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

/* Add some spacing for heading anchors */
h2, h3, h4 {
    scroll-margin-top: 80px;
}
