/* =============================================
   Domain E-Book - Complete CSS Styling
   ============================================= */

/* ===== COLOR VARIABLES ===== */
:root {
    --bg-color: #f0f4f8;
    --border-color: rgb(208, 31, 224);
    --button-color: rgb(58, 235, 52);
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --hover-shadow: rgba(0, 0, 0, 0.2);
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f4f8 100%);
    padding: 20px;
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 5px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 15px 50px var(--shadow);
    overflow: hidden;
}

/* ===== COVER PAGE ===== */
.cover-page {
    background: linear-gradient(135deg, var(--border-color) 0%, #4a148c 100%);
    color: var(--text-light);
    padding: 80px 40px;
    text-align: center;
    border-bottom: 8px solid var(--button-color);
}

.ebook-title {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
}

.ebook-subtitle {
    font-size: 1.5em;
    margin-bottom: 15px;
    opacity: 0.95;
}

.author {
    font-size: 1.1em;
    opacity: 0.9;
}

.globe-icon {
    font-size: 5em;
    margin-top: 30px;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== TABLE OF CONTENTS ===== */
.toc-section {
    padding: 50px 40px;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-bottom: 3px solid var(--border-color);
}

.toc-section h2 {
    font-size: 2.2em;
    color: var(--border-color);
    margin-bottom: 30px;
    text-align: center;
}

.toc-list ul {
    list-style: none;
    max-width: 700px;
    margin: 0 auto;
}

.toc-list li {
    padding: 15px 20px;
    margin-bottom: 12px;
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-left: 8px solid var(--button-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px var(--shadow);
}

.toc-list li:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px var(--hover-shadow);
}

.toc-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1.1em;
    font-weight: 500;
    display: block;
}

/* ===== CHAPTERS ===== */
.chapter {
    padding: 50px 40px;
    border-bottom: 3px solid #e0e0e0;
}

.chapter:nth-child(even) {
    background: #fafafa;
}

.chapter-number {
    display: inline-block;
    background: var(--border-color);
    color: var(--text-light);
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 15px;
}

.chapter-title {
    font-size: 2.2em;
    color: var(--border-color);
    margin-bottom: 25px;
    border-bottom: 4px solid var(--button-color);
    padding-bottom: 10px;
}

/* ===== CONTENT BOXES ===== */
.content-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid var(--border-color);
    box-shadow: 0 5px 15px var(--shadow);
}

.content-box h3 {
    color: var(--border-color);
    font-size: 1.6em;
    margin: 25px 0 15px 0;
    border-left: 5px solid var(--button-color);
    padding-left: 15px;
}

.content-box h4 {
    color: var(--text-dark);
    font-size: 1.3em;
    margin: 20px 0 12px 0;
}

.content-box p {
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 15px;
}

.content-box ul,
.content-box ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.content-box li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.content-box strong {
    color: var(--border-color);
}

/* ===== EXAMPLE BOXES ===== */
.example-box {
    background: rgba(58, 235, 52, 0.1);
    border: 3px solid var(--button-color);
    border-left: 8px solid var(--button-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
}

/* ===== STRUCTURE DIAGRAM ===== */
.structure-diagram {
    background: rgba(208, 31, 224, 0.05);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
}

.structure-diagram h4 {
    color: var(--border-color);
    font-size: 1.3em;
    margin-bottom: 20px;
}

.structure-parts {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.part {
    background: var(--card-bg);
    border: 3px solid var(--button-color);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 120px;
}

.part-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.part-value {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--border-color);
}

.dot {
    font-size: 2em;
    font-weight: bold;
    color: var(--button-color);
}

/* ===== COMPONENT GRID ===== */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.component-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s ease;
}

.component-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--hover-shadow);
}

.component-card h4 {
    color: var(--border-color);
    margin-bottom: 10px;
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 5px 15px var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.data-table thead {
    background: linear-gradient(135deg, var(--border-color) 0%, #4a148c 100%);
    color: var(--text-light);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1.05em;
}

.data-table tbody tr {
    border-bottom: 2px solid #e0e0e0;
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(58, 235, 52, 0.1);
}

.data-table td {
    padding: 12px 15px;
    font-size: 1em;
}

.data-table td strong {
    color: var(--border-color);
}

.danger-row {
    background: rgba(255, 82, 82, 0.1) !important;
    border-left: 5px solid #ff5252;
}

.critical-row {
    background: rgba(255, 23, 68, 0.15) !important;
    border-left: 5px solid #ff1744;
}

/* ===== RULES GRID ===== */
.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.rule-card {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    position: relative;
    transition: transform 0.3s ease;
}

.rule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--hover-shadow);
}

.rule-number {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--button-color);
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.rule-card h4 {
    color: var(--border-color);
    margin-bottom: 12px;
}

/* ===== FLOWCHART ===== */
.flowchart {
    max-width: 600px;
    margin: 30px auto;
    text-align: center;
}

.flow-step {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-shadow: 0 4px 10px var(--shadow);
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 15px var(--hover-shadow);
}

.flow-step.success {
    background: rgba(58, 235, 52, 0.1);
    border-color: var(--button-color);
}

.step-number {
    background: var(--border-color);
    color: var(--text-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.step-text {
    font-size: 1.1em;
    font-weight: 500;
}

.flow-arrow {
    font-size: 2em;
    color: var(--button-color);
    font-weight: bold;
    margin: 5px 0;
}

/* ===== BOXES ===== */
.note-box,
.tip-box,
.warning-box {
    padding: 20px;
    margin: 20px 0;
    border-radius: 10px;
    border-left: 6px solid;
}

.note-box {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
}

.tip-box {
    background: rgba(58, 235, 52, 0.1);
    border-left-color: var(--button-color);
}

.warning-box {
    background: rgba(255, 82, 82, 0.1);
    border-left-color: #ff5252;
}

/* ===== FAQ SECTION ===== */
.faq-intro {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    font-style: italic;
    margin-bottom: 25px;
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
}

.faq-question {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(208, 31, 224, 0.05);
    cursor: pointer;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(208, 31, 224, 0.1);
}

.q-icon {
    background: var(--border-color);
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 8px;
    flex-shrink: 0;
}

.q-text {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
}

.toggle-btn {
    background: var(--button-color);
    color: var(--text-light);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

.faq-answer {
    display: none;
    padding: 20px;
    background: var(--card-bg);
    border-top: 2px solid #e0e0e0;
}

.faq-answer.show {
    display: flex;
    gap: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.a-icon {
    background: var(--button-color);
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.1em;
    padding: 8px 15px;
    border-radius: 8px;
    flex-shrink: 0;
    height: fit-content;
}

.a-text {
    flex: 1;
    line-height: 1.8;
    font-size: 1.05em;
}

/* ===== CONCLUSION ===== */
.conclusion {
    padding: 50px 40px;
    background: linear-gradient(135deg, rgba(208, 31, 224, 0.05), rgba(58, 235, 52, 0.05));
}

.conclusion h2 {
    font-size: 2.2em;
    color: var(--border-color);
    text-align: center;
    margin-bottom: 25px;
}

.conclusion-content {
    max-width: 800px;
    margin: 0 auto;
}

.conclusion-content p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
}

.key-points {
    background: var(--card-bg);
    border: 3px solid var(--button-color);
    border-left: 8px solid var(--button-color);
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
}

.key-points h3 {
    color: var(--border-color);
    margin-bottom: 15px;
}

.key-points ul {
    margin-left: 25px;
}

.key-points li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.final-note {
    text-align: center;
    font-weight: 600;
    font-size: 1.15em;
    color: var(--border-color);
    padding: 20px;
    background: rgba(208, 31, 224, 0.1);
    border-radius: 10px;
    margin-top: 20px;
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--border-color) 0%, #4a148c 100%);
    color: var(--text-light);
    text-align: center;
    padding: 30px 20px;
}

footer p {
    margin: 5px 0;
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--border-color), var(--button-color));
    color: var(--text-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: scale(1.1) translateY(-5px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-width: 3px;
    }

    .cover-page {
        padding: 50px 20px;
    }

    .ebook-title {
        font-size: 2em;
    }

    .chapter {
        padding: 30px 20px;
    }

    .chapter-title {
        font-size: 1.8em;
    }

    .content-box {
        padding: 20px;
    }

    .structure-parts {
        flex-direction: column;
    }

    .component-grid,
    .rules-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9em;
    }

    .faq-question {
        flex-wrap: wrap;
    }

    .toggle-btn {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .ebook-title {
        font-size: 1.5em;
    }

    .chapter-title {
        font-size: 1.5em;
    }

    .data-table {
        font-size: 0.85em;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        border: none;
        box-shadow: none;
    }

    .scroll-to-top {
        display: none;
    }

    .faq-answer {
        display: flex !important;
    }

    .toggle-btn {
        display: none;
    }
}