/* YouTube E-Book Styles */

/* Root Variables */
:root {
    --primary-bg: rgb(31, 224, 199);
    --primary-border: rgb(208, 31, 224);
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-hover: rgba(0, 0, 0, 0.2);
    --accent-color: #ff0000;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--primary-bg) 0%, #20d5c5 100%);
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 5px solid var(--primary-border);
    border-radius: 15px;
    box-shadow: 0 10px 40px var(--shadow-hover);
    overflow: hidden;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-border) 0%, #c21aa0 100%);
    color: var(--text-light);
    padding: 40px;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.3em;
    opacity: 0.95;
    font-weight: 300;
}

.print-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    color: var(--primary-border);
    border: 2px solid var(--card-bg);
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.print-btn:hover {
    background: var(--primary-bg);
    color: var(--text-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Table of Contents */
.table-of-contents {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #30e0cd 100%);
    padding: 30px;
    border-bottom: 4px solid var(--primary-border);
}

.table-of-contents h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 2em;
}

.table-of-contents ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.table-of-contents li {
    background: var(--card-bg);
    border-left: 4px solid var(--primary-border);
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.table-of-contents li:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px var(--shadow-hover);
}

.table-of-contents a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1em;
}

/* Main Content */
main {
    padding: 40px;
}

.chapter {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 3px solid var(--primary-bg);
}

.chapter:last-child {
    border-bottom: none;
}

.chapter h2 {
    color: var(--primary-border);
    font-size: 2.5em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--primary-bg);
}

.chapter h3 {
    color: var(--text-dark);
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 5px solid var(--primary-border);
}

.chapter p {
    font-size: 1.1em;
    margin-bottom: 15px;
    text-align: justify;
    line-height: 1.8;
}

/* Lists */
.feature-list, .step-list {
    margin: 20px 0;
    padding-left: 20px;
}

.feature-list li, .step-list li {
    margin-bottom: 15px;
    font-size: 1.1em;
    line-height: 1.7;
}

.feature-list li strong, .step-list li strong {
    color: var(--primary-border);
}

.step-list {
    counter-reset: step-counter;
    list-style: none;
}

.step-list li {
    counter-increment: step-counter;
    padding-left: 40px;
    position: relative;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    background: var(--primary-border);
    color: var(--text-light);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 1em;
    box-shadow: 0 5px 20px var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead tr {
    background: var(--primary-border);
    color: var(--text-light);
    text-align: left;
    font-weight: bold;
}

.data-table th,
.data-table td {
    padding: 15px 20px;
}

.data-table tbody tr {
    border-bottom: 1px solid #ddd;
    transition: all 0.3s ease;
}

.data-table tbody tr:nth-of-type(even) {
    background-color: rgba(31, 224, 199, 0.1);
}

.data-table tbody tr:hover {
    background-color: rgba(31, 224, 199, 0.3);
    transform: scale(1.01);
}

.data-table tbody tr:last-of-type {
    border-bottom: 3px solid var(--primary-border);
}

.mini-table {
    width: 100%;
    margin: 15px 0;
}

.mini-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

/* Flowchart */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, rgba(31, 224, 199, 0.1) 0%, rgba(208, 31, 224, 0.1) 100%);
    border-radius: 10px;
}

.flow-step {
    background: var(--card-bg);
    border: 3px solid var(--primary-border);
    padding: 20px 40px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
    min-width: 250px;
    box-shadow: 0 4px 10px var(--shadow);
    transition: all 0.3s ease;
}

.flow-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-hover);
    background: var(--primary-bg);
}

.flow-arrow {
    font-size: 2em;
    color: var(--primary-border);
    margin: 10px 0;
    font-weight: bold;
}

/* Quiz Section */
.quiz-intro {
    background: rgba(31, 224, 199, 0.2);
    padding: 20px;
    border-left: 5px solid var(--primary-border);
    border-radius: 5px;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.quiz-item {
    background: var(--card-bg);
    border: 2px solid var(--primary-bg);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: all 0.3s ease;
}

.quiz-item:hover {
    box-shadow: 0 8px 25px var(--shadow-hover);
    transform: translateY(-3px);
}

.quiz-item h3 {
    color: var(--primary-border);
    margin-top: 0;
    margin-bottom: 15px;
    border-left: none;
    padding-left: 0;
}

.question {
    font-size: 1.2em;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(31, 224, 199, 0.1);
    border-radius: 5px;
}

.solution-btn {
    background: var(--primary-border);
    color: var(--text-light);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.solution-btn:hover {
    background: var(--primary-bg);
    color: var(--text-dark);
    transform: scale(1.05);
}

.solution {
    display: none;
    margin-top: 20px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(31, 224, 199, 0.2) 0%, rgba(208, 31, 224, 0.1) 100%);
    border-left: 5px solid var(--primary-border);
    border-radius: 8px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.solution.show {
    display: block;
}

.solution h4 {
    color: var(--primary-border);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.solution ul, .solution ol {
    margin-left: 20px;
}

.solution li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-bg) 0%, #20d5c5 100%);
    padding: 40px;
    text-align: center;
    border-top: 4px solid var(--primary-border);
}

footer h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 2em;
}

footer p {
    font-size: 1.1em;
    margin-bottom: 15px;
    line-height: 1.8;
}

.footer-note {
    font-style: italic;
    opacity: 0.9;
}

.print-btn-footer {
    margin-top: 20px;
    background: var(--primary-border);
    color: var(--text-light);
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.print-btn-footer:hover {
    background: var(--text-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-width: 3px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .print-btn {
        position: static;
        display: block;
        margin-top: 20px;
        width: 100%;
    }

    main {
        padding: 20px;
    }

    .chapter h2 {
        font-size: 1.8em;
    }

    .chapter h3 {
        font-size: 1.3em;
    }

    .table-of-contents ul {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9em;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .flow-step {
        min-width: 200px;
        padding: 15px 20px;
        font-size: 1em;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        border: none;
        box-shadow: none;
    }

    .print-btn,
    .print-btn-footer,
    .solution-btn {
        display: none;
    }

    .solution {
        display: block !important;
    }

    .chapter {
        page-break-after: always;
    }

    .quiz-item {
        page-break-inside: avoid;
    }

    header {
        background: #ddd;
        color: #000;
    }

    .table-of-contents {
        background: #f5f5f5;
    }

    footer {
        background: #f5f5f5;
        border-top: 2px solid #333;
    }
}

/* Accessibility */
a:focus,
button:focus {
    outline: 3px solid var(--primary-border);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: var(--primary-border);
    color: var(--text-light);
}