/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, rgb(31, 224, 199) 0%, rgb(20, 180, 160) 100%);
    color: #000000;
    line-height: 1.8;
    padding: 20px;
    min-height: 100vh;
}

/* Print Button */
.print-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.print-button button {
    background-color: rgb(208, 31, 224);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.print-button button:hover {
    background-color: rgb(180, 20, 200);
    transform: scale(1.05);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border: 5px solid rgb(208, 31, 224);
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Headings */
h1 {
    font-size: 36px;
    font-weight: bold;
    color: rgb(208, 31, 224);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    border-bottom: 4px solid rgb(31, 224, 199);
    padding-bottom: 15px;
}

h2 {
    font-size: 28px;
    font-weight: bold;
    color: rgb(208, 31, 224);
    margin-bottom: 25px;
    margin-top: 20px;
    border-left: 6px solid rgb(31, 224, 199);
    padding-left: 15px;
}

h3 {
    font-size: 22px;
    font-weight: bold;
    color: rgb(180, 20, 200);
    margin-bottom: 15px;
    margin-top: 20px;
}

/* Paragraphs */
p {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: justify;
    color: #1a1a1a;
}

/* Lists */
ul {
    margin-bottom: 20px;
    padding-left: 30px;
}

ul li {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #1a1a1a;
    list-style-type: disc;
}

/* Table of Contents Buttons */
.toc-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 25px;
}

.toc-buttons button {
    background-color: rgb(31, 224, 199);
    color: #000000;
    border: 3px solid rgb(208, 31, 224);
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.toc-buttons button:hover {
    background-color: rgb(208, 31, 224);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 3px solid rgb(208, 31, 224);
}

thead {
    background-color: rgb(208, 31, 224);
    color: white;
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid rgb(180, 20, 200);
}

tbody tr {
    border-bottom: 2px solid rgb(31, 224, 199);
}

tbody tr:nth-child(even) {
    background-color: rgba(31, 224, 199, 0.15);
}

tbody tr:nth-child(odd) {
    background-color: white;
}

tbody tr:hover {
    background-color: rgba(208, 31, 224, 0.15);
}

tbody td {
    padding: 12px 15px;
    font-weight: bold;
    font-size: 15px;
    color: #1a1a1a;
    border: 1px solid rgb(31, 224, 199);
}

/* Flowchart Styles */
.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 30px 0;
    padding: 20px;
    background-color: rgba(31, 224, 199, 0.1);
    border: 3px solid rgb(208, 31, 224);
    border-radius: 10px;
}

.flow-box {
    background-color: white;
    border: 3px solid rgb(208, 31, 224);
    padding: 15px 25px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    min-width: 250px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.flow-start {
    background-color: rgb(31, 224, 199);
    color: #000000;
}

.flow-end {
    background-color: rgb(208, 31, 224);
    color: white;
}

.flow-decision {
    background-color: rgba(208, 31, 224, 0.2);
    border-radius: 50px;
}

.flow-action {
    background-color: rgba(31, 224, 199, 0.3);
}

.flow-arrow {
    font-size: 30px;
    font-weight: bold;
    color: rgb(208, 31, 224);
    margin: 5px 0;
}

.flow-branches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
    margin: 20px 0;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-subbox {
    background-color: white;
    border: 2px solid rgb(31, 224, 199);
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Question Blocks */
.question-block {
    background-color: rgba(31, 224, 199, 0.15);
    border: 3px solid rgb(208, 31, 224);
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0;
}

.question-block h3 {
    color: rgb(208, 31, 224);
    margin-bottom: 15px;
}

.show-answer {
    background-color: rgb(208, 31, 224);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.show-answer:hover {
    background-color: rgb(180, 20, 200);
    transform: scale(1.05);
}

.answer {
    display: none;
    background-color: white;
    border: 2px solid rgb(31, 224, 199);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.answer.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.answer p {
    font-weight: bold;
    color: #1a1a1a;
}

.answer ul {
    margin-top: 10px;
}

.answer ul li {
    font-weight: bold;
    color: #1a1a1a;
}

/* Back to Top Button */
.back-to-top {
    background-color: rgb(31, 224, 199);
    color: #000000;
    border: 3px solid rgb(208, 31, 224);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.back-to-top:hover {
    background-color: rgb(208, 31, 224);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    background-color: rgba(208, 31, 224, 0.2);
    border: 3px solid rgb(208, 31, 224);
    padding: 20px;
    margin-top: 50px;
}

.footer p {
    font-weight: bold;
    color: #1a1a1a;
    margin: 5px 0;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .print-button {
        display: none;
    }
    
    .container {
        page-break-inside: avoid;
        border: 2px solid rgb(208, 31, 224);
        margin-bottom: 20px;
    }
    
    .back-to-top {
        display: none;
    }
    
    .show-answer {
        display: none;
    }
    
    .answer {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .toc-buttons {
        grid-template-columns: 1fr;
    }
    
    .flow-branches {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 14px;
    }
    
    tbody td, thead th {
        padding: 8px;
    }
}