/* Guide Tool Styles */

/* ==========================================================================
   Landing Page
   ========================================================================== */

.guide-landing {
    text-align: center;
    padding: 3rem 0;
}

.landing-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
}

.landing-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary, #666);
    margin: 0 0 3rem 0;
}

.guide-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.guide-card {
    background: var(--card-bg, white);
    border-radius: var(--border-radius-lg, 12px);
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.guide-card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.guide-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark-color, #333);
    margin: 0 0 0.75rem 0;
}

.guide-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary, #666);
    margin: 0;
    line-height: 1.6;
}

/* Dark mode landing page */
[data-theme="dark"] .guide-card {
    background: var(--card-bg);
}

[data-theme="dark"] .guide-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .guide-card-title {
    color: var(--text-color);
}

[data-theme="dark"] .guide-card-desc {
    color: var(--text-secondary);
}

/* ==========================================================================
   Layout System
   ========================================================================== */

.guide-layout {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    position: relative;
    padding: 2rem 0;
}

.guide-content-wrapper {
    flex: 1;
    min-width: 0;
    max-width: 900px;
}

/* ==========================================================================
   Sticky TOC Sidebar
   ========================================================================== */

.toc-sidebar {
    position: sticky;
    top: 2rem;
    width: 280px;
    flex-shrink: 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.toc-container {
    background: var(--card-bg, white);
    border-radius: var(--border-radius-lg, 12px);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* ==========================================================================
   Search Box
   ========================================================================== */

.guide-search {
    margin-bottom: 1.5rem;
}

.guide-search .form-control {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius, 8px);
}

.guide-search .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.search-results-info {
    display: none;
    margin-top: 1rem;
    padding: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    background: var(--gray-100, #f5f5f5);
    border-radius: var(--border-radius-sm, 6px);
}

.search-results-info.visible {
    display: block;
}

/* ==========================================================================
   TOC Navigation
   ========================================================================== */

.toc-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.6rem 0.75rem;
    border-radius: var(--border-radius-sm, 6px);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background: var(--gray-100, #f5f5f5);
    color: var(--primary-color);
}

.toc-link.active {
    background: var(--primary-color);
    color: white;
    border-left-color: transparent;
}

.toc-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

/* Search match states for TOC */
.toc-link.has-match {
    background: rgba(74, 144, 226, 0.1);
    border-left-color: var(--primary-color);
}

.toc-link.no-match {
    opacity: 0.4;
}

/* Back to landing link */
.back-to-landing {
    display: block;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-secondary, #666);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.back-to-landing:hover {
    color: var(--primary-color);
}

/* TOC Scrollbar */
.toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.toc-sidebar::-webkit-scrollbar-track {
    background: var(--gray-100, #f1f1f1);
    border-radius: 3px;
}

.toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-400, #888);
    border-radius: 3px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-600, #555);
}

/* ==========================================================================
   Guide Sections
   ========================================================================== */

.guide-section {
    background: var(--card-bg, white);
    border-radius: var(--border-radius-lg, 12px);
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    scroll-margin-top: 2rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.section-icon {
    font-size: 1.4rem;
}

/* Section Content - Optimized for reading */
.section-content {
    line-height: 1.8;
    color: var(--text-color);
}

.section-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color, #333);
    margin: 2rem 0 1rem;
}

.section-content h3:first-child {
    margin-top: 0;
}

.section-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.5rem 0 0.75rem;
}

.section-content p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

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

.section-content li {
    margin-bottom: 0.5rem;
}

.section-content li strong {
    color: var(--primary-color);
}

/* Search hidden state */
.guide-section.search-hidden {
    display: none;
}

/* Search highlight */
.search-highlight {
    background: linear-gradient(180deg, transparent 50%, rgba(74, 144, 226, 0.3) 50%);
    padding: 0 2px;
    border-radius: 2px;
}

/* ==========================================================================
   Article Styles (Sub-pages)
   ========================================================================== */

.guide-article {
    background: var(--card-bg, white);
    border-radius: var(--border-radius-lg, 12px);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.article-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 2rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.article-icon {
    font-size: 1.8rem;
}

.article-content {
    line-height: 1.8;
    color: var(--text-color);
}

.article-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color, #333);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color, #e0e0e0);
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color, #333);
    margin: 2rem 0 1rem;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 1.5rem 0 0.75rem;
}

.article-content p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

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

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content li strong {
    color: var(--primary-color);
}

/* ==========================================================================
   Coming Soon
   ========================================================================== */

.coming-soon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
}

.coming-soon p {
    font-size: 1.25rem;
    color: var(--text-secondary, #666);
    margin: 0;
    padding: 2rem;
    background: var(--gray-50, #f9fafb);
    border-radius: var(--border-radius-lg, 12px);
    border: 2px dashed var(--border-color, #e0e0e0);
}

[data-theme="dark"] .coming-soon p {
    background: var(--bg-secondary, #252836);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Dark mode article */
[data-theme="dark"] .guide-article {
    background: var(--card-bg);
}

[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3 {
    color: var(--text-color);
}

/* ==========================================================================
   Page Navigation
   ========================================================================== */

.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.page-nav-prev,
.page-nav-next {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-bg, white);
    border-radius: var(--border-radius, 8px);
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-nav-prev:hover,
.page-nav-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.page-nav-prev:empty,
.page-nav-next:empty {
    visibility: hidden;
}

/* Dark mode page nav */
[data-theme="dark"] .page-nav-prev,
[data-theme="dark"] .page-nav-next {
    background: var(--card-bg);
}

[data-theme="dark"] .page-nav-prev:hover,
[data-theme="dark"] .page-nav-next:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Info Cards
   ========================================================================== */

.guide-info-card {
    background: var(--gray-50, #f9fafb);
    border-radius: var(--border-radius, 8px);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.guide-info-card strong {
    color: inherit;
}

.guide-tip {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left-color: #4caf50;
}

.guide-tip strong {
    color: #2e7d32;
}

.guide-warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left-color: #ff9800;
}

.guide-warning strong {
    color: #e65100;
}

.guide-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left-color: var(--primary-color);
}

.guide-note strong {
    color: #1565c0;
}

/* ==========================================================================
   Dark Mode
   ========================================================================== */

[data-theme="dark"] .toc-container {
    background: var(--card-bg);
}

[data-theme="dark"] .toc-link:hover {
    background: var(--hover-bg, rgba(255, 255, 255, 0.1));
}

[data-theme="dark"] .guide-section {
    background: var(--card-bg);
}

[data-theme="dark"] .guide-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .search-results-info {
    background: var(--bg-secondary, #252836);
}

[data-theme="dark"] .search-highlight {
    background: linear-gradient(180deg, transparent 50%, rgba(90, 159, 240, 0.3) 50%);
}

[data-theme="dark"] .section-content h3 {
    color: var(--text-color);
}

/* Dark mode info cards */
[data-theme="dark"] .guide-info-card {
    background: var(--bg-secondary, #252836);
}

[data-theme="dark"] .guide-tip {
    background: linear-gradient(135deg, #1b3d1b 0%, #2d4d2d 100%);
}

[data-theme="dark"] .guide-tip strong {
    color: #81c784;
}

[data-theme="dark"] .guide-warning {
    background: linear-gradient(135deg, #3d2e00 0%, #4d3b00 100%);
}

[data-theme="dark"] .guide-warning strong {
    color: #ffb74d;
}

[data-theme="dark"] .guide-note {
    background: linear-gradient(135deg, #1a2d3d 0%, #2a3d4d 100%);
}

[data-theme="dark"] .guide-note strong {
    color: #64b5f6;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .landing-title {
        font-size: 2rem;
    }

    .guide-cards-grid {
        gap: 1.5rem;
    }

    .toc-sidebar {
        width: 220px;
    }

    .guide-layout {
        gap: 2rem;
    }

    .guide-section {
        padding: 2rem;
    }

    .guide-article {
        padding: 2rem;
    }

    .article-title {
        font-size: 1.75rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .landing-title {
        font-size: 1.8rem;
    }

    .landing-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .guide-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .guide-card {
        padding: 1.5rem;
    }

    .guide-card-icon {
        font-size: 2.5rem;
    }

    .guide-card-title {
        font-size: 1.2rem;
    }

    .guide-layout {
        flex-direction: column;
    }

    .toc-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        max-height: none;
        margin-bottom: 2rem;
    }

    .toc-container {
        max-height: 350px;
        overflow-y: auto;
    }

    .guide-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .section-content h3 {
        font-size: 1.15rem;
    }

    .guide-article {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .article-content h2 {
        font-size: 1.3rem;
    }

    .page-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .page-nav-prev,
    .page-nav-next {
        width: 100%;
        justify-content: center;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .guide-landing {
        padding: 2rem 0;
    }

    .landing-title {
        font-size: 1.5rem;
    }

    .guide-card {
        padding: 1.25rem;
    }

    .guide-section {
        padding: 1.25rem;
        border-radius: var(--border-radius, 8px);
    }

    .section-title {
        font-size: 1.25rem;
        flex-wrap: wrap;
    }

    .toc-container {
        padding: 1rem;
    }

    .toc-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }

    .guide-info-card {
        padding: 1rem;
    }

    .guide-article {
        padding: 1.25rem;
        border-radius: var(--border-radius, 8px);
    }

    .article-title {
        font-size: 1.3rem;
        flex-wrap: wrap;
    }

    .page-nav-prev,
    .page-nav-next {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Chocobo Color Calculator
   ========================================================================== */

.color-calculator {
    background: var(--gray-50, #f9fafb);
    border-radius: var(--border-radius-lg, 12px);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.color-select-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.color-select-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-select-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.color-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-select-wrapper select {
    min-width: 180px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--border-color, #e0e0e0);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.color-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary, #666);
    flex-shrink: 0;
}

.calculator-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.result-area {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.result-area h4 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.fruit-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.fruit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.fruit-item:last-child {
    border-bottom: none;
}

.fruit-item.same-color {
    color: var(--text-secondary);
    font-style: italic;
}

.fruit-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fruit-name {
    font-weight: 500;
    color: var(--text-color);
}

.fruit-count {
    color: var(--primary-color);
    font-weight: 600;
}

.feeding-order {
    margin-top: 1rem;
}

.feeding-order-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.feeding-step {
    padding: 0.3rem 0.6rem;
    border-radius: var(--border-radius-sm, 6px);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.feeding-step:hover {
    transform: scale(1.05);
}

.feeding-arrow {
    color: var(--text-secondary, #6b7280);
    font-size: 1rem;
    padding: 0 0.2rem;
    user-select: none;
}

/* Dark mode for calculator */
[data-theme="dark"] .color-calculator {
    background: var(--bg-secondary, #252836);
}

[data-theme="dark"] .color-preview {
    border-color: var(--border-color);
}

[data-theme="dark"] .fruit-item {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .feeding-arrow {
    color: var(--text-secondary, #9ca3af);
}

/* Responsive for calculator */
@media (max-width: 768px) {
    .color-select-row {
        flex-direction: column;
        gap: 1rem;
    }

    .color-arrow {
        transform: rotate(90deg);
    }

    .color-select-wrapper select {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .color-calculator {
        padding: 1rem;
    }

    .color-select-wrapper select {
        min-width: 120px;
        font-size: 0.9rem;
    }

    .color-preview {
        width: 32px;
        height: 32px;
    }

    .feeding-step {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .toc-sidebar {
        display: none;
    }

    .guide-layout {
        display: block;
    }

    .guide-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
