﻿/* ============================================
           PERFUME ENCYCLOPEDIA — دانش‌نامه عطر
           ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    direction: rtl;
    padding: 20px;
    min-height: 100vh;
}

/* ============================================
           HEADER
           ============================================ */
.encyclopedia-header {
    text-align: center;
    padding: 50px 20px 40px;
    background: linear-gradient(135deg, #003366, #0a4d8c);
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 8px 40px rgba(0, 51, 102, 0.2);
    position: relative;
    overflow: hidden;
}

    .encyclopedia-header::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -20%;
        width: 60%;
        height: 200%;
        background: radial-gradient(circle, rgba(244, 180, 0, 0.06), transparent 60%);
        pointer-events: none;
        animation: floatBg 20s ease-in-out infinite;
    }

@keyframes floatBg {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-20px, 30px) scale(1.05);
    }
}

.encyclopedia-header .header-icon {
    width: 80px;
    height: 80px;
    background: rgba(244, 180, 0, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F4B400;
    font-size: 2.5rem;
    margin: 0 auto 16px;
    border: 2px solid rgba(244, 180, 0, 0.2);
    position: relative;
    z-index: 2;
}

.encyclopedia-header h1 {
    font-weight: 900;
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 6px;
    position: relative;
    z-index: 2;
}

    .encyclopedia-header h1 span {
        color: #F4B400;
    }

.encyclopedia-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    line-height: 1.8;
}

.encyclopedia-header .header-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

    .encyclopedia-header .header-stats .stat {
        text-align: center;
    }

        .encyclopedia-header .header-stats .stat .number {
            font-size: 1.8rem;
            font-weight: 800;
            color: #F4B400;
            display: block;
        }

        .encyclopedia-header .header-stats .stat .label {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.6);
        }

/* ============================================
           BREADCRUMB
           ============================================ */
.breadcrumb-section {
    background: #ffffff;
    padding: 12px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

    .breadcrumb-section a {
        color: #003366;
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        transition: color 0.3s ease;
    }

        .breadcrumb-section a:hover {
            color: #F4B400;
        }

    .breadcrumb-section .separator {
        color: #d1d5db;
    }

    .breadcrumb-section .current {
        color: #6b7280;
        font-size: 0.9rem;
    }

/* ============================================
           TABLE OF CONTENTS
           ============================================ */
.toc-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 30px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

    .toc-section .toc-title {
        font-weight: 700;
        color: #003366;
        font-size: 1rem;
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .toc-section .toc-title i {
            color: #F4B400;
        }

    .toc-section .toc-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 8px;
    }

        .toc-section .toc-grid a {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 14px;
            border-radius: 10px;
            background: #f8fafc;
            color: #4b5563;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.4s ease;
            border: 1px solid transparent;
        }

            .toc-section .toc-grid a:hover {
                background: rgba(244, 180, 0, 0.06);
                border-color: #F4B400;
                color: #003366;
                transform: translateY(-2px);
            }

            .toc-section .toc-grid a i {
                color: #F4B400;
                font-size: 0.9rem;
            }

/* ============================================
           CONTENT SECTIONS
           ============================================ */
.encyclopedia-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px 34px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.4s ease;
    scroll-margin-top: 20px;
}

    .content-section:hover {
        border-color: #e5e7eb;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.05);
    }

    .content-section .section-header {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 2px solid #f0f2f5;
    }

        .content-section .section-header .section-icon {
            width: 44px;
            height: 44px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 1.2rem;
            flex-shrink: 0;
        }

        .content-section .section-header h2 {
            font-weight: 800;
            color: #003366;
            font-size: 1.2rem;
            margin: 0;
        }

        .content-section .section-header .section-number {
            margin-right: auto;
            font-size: 0.75rem;
            color: #9ca3af;
            background: #f0f2f5;
            padding: 2px 12px;
            border-radius: 50px;
        }

    .content-section .section-body {
        color: #4b5563;
        font-size: 0.95rem;
        line-height: 1.9;
    }

        .content-section .section-body p {
            margin-bottom: 12px;
        }

        .content-section .section-body .highlight-box {
            background: #f8fafc;
            border-right: 4px solid #F4B400;
            padding: 16px 20px;
            border-radius: 8px;
            margin: 16px 0;
        }

            .content-section .section-body .highlight-box i {
                color: #F4B400;
                margin-left: 8px;
            }

/* ============================================
           NOTE CATEGORIES
           ============================================ */

.note-category {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f2f5;
}

    .note-category:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .note-category .category-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 14px;
    }

        .note-category .category-header i {
            font-size: 1.3rem;
            color: #F4B400;
        }

        .note-category .category-header h4 {
            font-weight: 700;
            color: #003366;
            font-size: 1rem;
            margin: 0;
        }

        .note-category .category-header .category-badge {
            font-size: 0.65rem;
            font-weight: 600;
            color: #6b7280;
            background: #f0f2f5;
            padding: 2px 12px;
            border-radius: 50px;
            margin-right: auto;
        }

/* ============================================
           NOTE GRID
           ============================================ */
.note-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 0;
}

.note-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #f0f2f5;
    transition: all 0.4s ease;
    text-align: center;
    width: 100%;
}

    .note-card:hover {
        transform: translateY(-4px);
        border-color: #F4B400;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    }

    .note-card .note-icon {
        font-size: 1.6rem;
        display: block;
        margin-bottom: 4px;
    }

    .note-card .note-name {
        font-weight: 700;
        color: #003366;
        font-size: 0.85rem;
        display: block;
    }

    .note-card .note-desc {
        font-size: 0.7rem;
        color: #6b7280;
        display: block;
        margin-top: 2px;
        line-height: 1.5;
    }

/* ============================================
           FAMILY TREE
           ============================================ */
.family-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0;
    justify-items: center;
}

.family-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #f0f2f5;
    transition: all 0.4s ease;
    width: 100%;
    max-width: 240px;
}

    .family-card:hover {
        transform: translateY(-4px);
        border-color: #F4B400;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
    }

    .family-card .family-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 6px;
        justify-content: center;
    }

        .family-card .family-header i {
            color: #F4B400;
            font-size: 1.2rem;
        }

        .family-card .family-header h5 {
            font-weight: 700;
            color: #003366;
            font-size: 0.95rem;
            margin: 0;
        }

    .family-card p {
        font-size: 0.85rem;
        color: #6b7280;
        margin: 0;
        line-height: 1.6;
        text-align: center;
    }

/* ============================================
           CONCENTRATION TABLE
           ============================================ */
.table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
}

.concentration-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 400px;
}

    .concentration-table thead th {
        background: #003366;
        color: #fff;
        padding: 10px 14px;
        text-align: right;
        font-weight: 600;
    }

        .concentration-table thead th:first-child {
            border-radius: 0 8px 0 0;
        }

        .concentration-table thead th:last-child {
            border-radius: 8px 0 0 0;
        }

    .concentration-table tbody td {
        padding: 10px 14px;
        border-bottom: 1px solid #f0f2f5;
        color: #4b5563;
    }

    .concentration-table tbody tr:hover {
        background: rgba(244, 180, 0, 0.03);
    }

    .concentration-table tbody tr:last-child td:first-child {
        border-radius: 0 0 0 8px;
    }

    .concentration-table tbody tr:last-child td:last-child {
        border-radius: 0 0 8px 0;
    }

    .concentration-table .highlight-row td {
        background: rgba(244, 180, 0, 0.04);
        font-weight: 600;
    }

/* ============================================
           TIPS LIST
           ============================================ */
.tips-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

    .tips-list li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid #f0f2f5;
    }

        .tips-list li:last-child {
            border-bottom: none;
        }

        .tips-list li .tip-number {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #F4B400;
            color: #003366;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.8rem;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .tips-list li .tip-text {
            font-size: 0.9rem;
            color: #4b5563;
            line-height: 1.7;
        }

            .tips-list li .tip-text strong {
                color: #003366;
            }

/* ============================================
           PROGRESS INDICATOR
           ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #F4B400, #d49d00);
    z-index: 1000;
    transition: width 0.1s ease;
    border-radius: 0 4px 4px 0;
}

/* ============================================
           RESPONSIVE
           ============================================ */
@media (max-width: 992px) {
    .note-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .family-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .encyclopedia-header h1 {
        font-size: 2rem;
    }

    .encyclopedia-header .header-stats {
        gap: 24px;
    }

        .encyclopedia-header .header-stats .stat .number {
            font-size: 1.4rem;
        }

    .toc-section .toc-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .content-section {
        padding: 24px 26px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .encyclopedia-header {
        padding: 30px 16px 28px;
        border-radius: 14px;
    }

        .encyclopedia-header h1 {
            font-size: 1.5rem;
        }

        .encyclopedia-header p {
            font-size: 0.95rem;
        }

        .encyclopedia-header .header-stats {
            gap: 16px;
            flex-wrap: wrap;
        }

            .encyclopedia-header .header-stats .stat .number {
                font-size: 1.2rem;
            }

    .breadcrumb-section {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .toc-section {
        padding: 18px 20px;
    }

        .toc-section .toc-grid {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        }

            .toc-section .toc-grid a {
                font-size: 0.75rem;
                padding: 6px 10px;
            }

    .content-section {
        padding: 18px 18px;
    }

        .content-section .section-header h2 {
            font-size: 1rem;
        }

        .content-section .section-header .section-icon {
            width: 36px;
            height: 36px;
            font-size: 1rem;
        }

        .content-section .section-body {
            font-size: 0.9rem;
        }

    .note-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .note-card .note-desc {
        font-size: 0.65rem;
    }

    .note-card .note-name {
        font-size: 0.8rem;
    }

    .note-card .note-icon {
        font-size: 1.3rem;
    }

    .family-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .family-card {
        padding: 14px 16px;
    }

        .family-card .family-header h5 {
            font-size: 0.85rem;
        }

        .family-card p {
            font-size: 0.8rem;
        }

    .concentration-table {
        font-size: 0.8rem;
        min-width: 350px;
    }

        .concentration-table thead th,
        .concentration-table tbody td {
            padding: 8px 10px;
        }
}

@media (max-width: 576px) {
    body {
        padding: 8px;
    }

    .encyclopedia-header {
        padding: 24px 12px 20px;
        border-radius: 12px;
    }

        .encyclopedia-header h1 {
            font-size: 1.2rem;
        }

        .encyclopedia-header .header-icon {
            width: 56px;
            height: 56px;
            font-size: 1.6rem;
        }

        .encyclopedia-header p {
            font-size: 0.85rem;
        }

        .encyclopedia-header .header-stats .stat .number {
            font-size: 1rem;
        }

        .encyclopedia-header .header-stats .stat .label {
            font-size: 0.65rem;
        }

    .breadcrumb-section {
        font-size: 0.7rem;
        padding: 8px 12px;
        gap: 6px;
    }

        .breadcrumb-section .separator {
            display: none;
        }

    .toc-section {
        padding: 14px 14px;
    }

        .toc-section .toc-title {
            font-size: 0.85rem;
        }

        .toc-section .toc-grid {
            grid-template-columns: 1fr 1fr;
            gap: 6px;
        }

            .toc-section .toc-grid a {
                font-size: 0.7rem;
                padding: 5px 8px;
                border-radius: 8px;
            }

    .content-section {
        padding: 14px 14px;
        border-radius: 12px;
    }

        .content-section .section-header h2 {
            font-size: 0.9rem;
        }

        .content-section .section-header .section-icon {
            width: 32px;
            height: 32px;
            font-size: 0.85rem;
            border-radius: 8px;
        }

        .content-section .section-header .section-number {
            font-size: 0.6rem;
            padding: 1px 10px;
        }

        .content-section .section-body {
            font-size: 0.85rem;
        }

            .content-section .section-body .highlight-box {
                padding: 12px 14px;
                font-size: 0.85rem;
            }

    .note-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .note-card {
        padding: 10px 12px;
    }

        .note-card .note-desc {
            font-size: 0.6rem;
        }

        .note-card .note-name {
            font-size: 0.75rem;
        }

        .note-card .note-icon {
            font-size: 1.1rem;
        }

    .note-category .category-header {
        flex-wrap: wrap;
    }

        .note-category .category-header .category-badge {
            margin-right: 0;
            font-size: 0.55rem;
        }

    .family-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .family-card {
        padding: 12px 14px;
        max-width: 100%;
    }

        .family-card .family-header h5 {
            font-size: 0.8rem;
        }

        .family-card p {
            font-size: 0.75rem;
        }

    .concentration-table {
        font-size: 0.7rem;
        min-width: 300px;
    }

        .concentration-table thead th,
        .concentration-table tbody td {
            padding: 6px 8px;
        }

    .tips-list li .tip-number {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }

    .tips-list li .tip-text {
        font-size: 0.8rem;
    }
}

/* ============================================
           SCROLLBAR
           ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f0f2f5;
}

::-webkit-scrollbar-thumb {
    background: #F4B400;
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #d49d00;
    }
/* ============================================
   NOTE GRID — وسط‌چین (۳ ستونه)
   ============================================ */

.note-grid-center {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 16px 0;
    justify-items: center;
    align-items: stretch;
}

    .note-grid-center .note-card {
        background: #f8fafc;
        border-radius: 12px;
        padding: 18px 20px;
        border: 1px solid #f0f2f5;
        transition: all 0.4s ease;
        text-align: center;
        width: 100%;
        max-width: 280px;
    }

        .note-grid-center .note-card:hover {
            transform: translateY(-6px);
            border-color: #F4B400;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
        }

        .note-grid-center .note-card .note-icon {
            font-size: 2.2rem;
            display: block;
            margin-bottom: 6px;
        }

        .note-grid-center .note-card .note-name {
            font-weight: 700;
            color: #003366;
            font-size: 0.95rem;
            display: block;
        }

        .note-grid-center .note-card .note-desc {
            font-size: 0.78rem;
            color: #6b7280;
            display: block;
            margin-top: 4px;
        }

/* ============================================
   ریسپانسیو
   ============================================ */

@media (max-width: 768px) {
    .note-grid-center {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

        .note-grid-center .note-card {
            padding: 14px 16px;
            max-width: 100%;
        }

            .note-grid-center .note-card .note-icon {
                font-size: 1.8rem;
            }

            .note-grid-center .note-card .note-name {
                font-size: 0.85rem;
            }

            .note-grid-center .note-card .note-desc {
                font-size: 0.7rem;
            }
}

@media (max-width: 576px) {
    .note-grid-center {
        grid-template-columns: 1fr;
        gap: 10px;
        justify-items: center;
    }

        .note-grid-center .note-card {
            max-width: 280px;
            padding: 14px 16px;
        }
}