/* Islamic Anger Management - Professional Stylesheet */

/* Root Variables for RGB Colors */
:root {
    --bg-primary: rgb(240, 248, 155);
    --bg-secondary: rgb(230, 240, 255);
    --bg-accent: rgb(220, 235, 245);
    --border-primary: rgb(70, 130, 180);
    --border-secondary: rgb(100, 149, 237);
    --text-primary: rgb(25, 25, 112);
    --text-secondary: rgb(47, 79, 79);
    --header-bg: rgb(65, 105, 225);
    --header-text: rgb(255, 255, 255);
    --highlight-bg: rgb(255, 248, 220);
    --highlight-border: rgb(218, 165, 32);
    --hadith-bg: rgb(245, 255, 250);
    --hadith-border: rgb(60, 179, 113);
    --use-case-bg: rgb(255, 250, 240);
    --use-case-border: rgb(255, 140, 0);
    --strategy-bg: rgb(248, 248, 255);
    --strategy-border: rgb(138, 43, 226);
    --qa-bg: rgb(255, 255, 255);
    --qa-border: rgb(70, 130, 180);
    --button-bg: rgb(70, 130, 180);
    --button-hover: rgb(100, 149, 237);
    --success: rgb(34, 139, 34);
    --warning: rgb(255, 140, 0);
    --error: rgb(220, 20, 60);
    --table-header: rgb(70, 130, 180);
    --table-row-even: rgb(240, 248, 255);
    --table-row-odd: rgb(255, 255, 255);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    line-height: 1.8;
    font-weight: bold;
    padding: 20px;
}

/* Print Button */
.print-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--button-bg);
    color: var(--header-text);
    border: 3px solid var(--border-primary);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.print-button:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Navigation Menu */
.navigation-menu {
    position: fixed;
    left: 20px;
    top: 100px;
    width: 220px;
    background-color: var(--qa-bg);
    border: 4px solid var(--border-primary);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    z-index: 999;
}

.navigation-menu h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    border-bottom: 3px solid var(--border-primary);
    padding-bottom: 10px;
}

.nav-btn {
    display: block;
    width: 100%;
    background-color: var(--button-bg);
    color: var(--header-text);
    border: 2px solid var(--border-secondary);
    padding: 10px;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-btn:hover {
    background-color: var(--button-hover);
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    margin-left: 260px;
    background-color: var(--qa-bg);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border: 5px solid var(--border-primary);
}

/* Header Styles */
.main-header {
    text-align: center;
    background: linear-gradient(135deg, var(--header-bg) 0%, rgb(30, 160, 140) 100%);
    color: var(--header-text);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 4px solid var(--border-secondary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.main-header h1 {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    font-style: italic;
}

.disclaimer {
    font-size: 14px;
    font-weight: bold;
    margin-top: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* Content Section Styles */
.content-section {
    margin-bottom: 40px;
    padding: 30px;
    background-color: var(--bg-accent);
    border-radius: 12px;
    border: 4px solid var(--border-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    color: var(--header-bg);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 4px solid var(--border-primary);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.content-section h3 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 15px;
}

.content-section h4 {
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 12px;
}

.content-section p {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: justify;
}

.content-section ul,
.content-section ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.content-section li {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.8;
}

/* Highlight Box */
.highlight-box {
    background-color: var(--highlight-bg);
    border: 4px solid var(--highlight-border);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.highlight-box h3 {
    color: var(--highlight-border);
    font-weight: bold;
    margin-bottom: 12px;
}

.highlight-box p {
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 16px;
}

/* Hadith Box */
.hadith-box {
    background-color: var(--hadith-bg);
    border: 4px solid var(--hadith-border);
    border-radius: 10px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hadith-box h4 {
    color: var(--hadith-border);
    font-weight: bold;
    font-size: 22px;
    margin-bottom: 15px;
}

.arabic-text {
    font-size: 24px;
    font-weight: bold;
    text-align: right;
    direction: rtl;
    color: var(--text-primary);
    margin: 15px 0;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
}

.hadith-box strong {
    color: var(--hadith-border);
}

/* Use Case Box */
.use-case {
    background-color: var(--use-case-bg);
    border: 4px solid var(--use-case-border);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.use-case h4 {
    color: var(--use-case-border);
    font-weight: bold;
    margin-bottom: 12px;
}

/* Strategy Box */
.strategy-box {
    background-color: var(--strategy-bg);
    border: 4px solid var(--strategy-border);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.strategy-box h4 {
    color: var(--strategy-border);
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 20px;
}

/* Table Styles */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: hidden;
    border: 4px solid var(--border-primary);
}

.info-table thead {
    background-color: var(--table-header);
    color: var(--header-text);
}

.info-table thead th {
    padding: 16px;
    text-align: left;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid var(--border-secondary);
}

.info-table tbody tr {
    border-bottom: 2px solid var(--border-secondary);
}

.info-table tbody tr:nth-child(even) {
    background-color: var(--table-row-even);
}

.info-table tbody tr:nth-child(odd) {
    background-color: var(--table-row-odd);
}

.info-table tbody tr:hover {
    background-color: var(--highlight-bg);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.info-table tbody td {
    padding: 14px;
    font-weight: bold;
    color: var(--text-primary);
    border: 2px solid var(--border-secondary);
}

.info-table strong {
    color: var(--header-bg);
}

/* Flowchart Styles */
.flowchart {
    margin: 30px 0;
    padding: 30px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 4px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-box {
    padding: 18px 30px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid;
}

.flow-start {
    background-color: var(--success);
    color: white;
    border-color: rgb(0, 100, 0);
}

.flow-end {
    background-color: var(--success);
    color: white;
    border-color: rgb(0, 100, 0);
}

.flow-process {
    background-color: var(--button-bg);
    color: white;
    border-color: var(--border-primary);
}

.flow-decision {
    background-color: var(--warning);
    color: white;
    border-color: rgb(200, 100, 0);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    padding: 30px 40px;
}

.flow-action {
    background-color: rgb(138, 43, 226);
    color: white;
    border-color: rgb(100, 0, 180);
}

.flow-success {
    background-color: rgb(34, 139, 34);
    color: white;
    border-color: rgb(0, 100, 0);
}

.flow-arrow {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 5px 0;
}

.flow-split {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 20px 0;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 20px;
}

.flow-branch span {
    font-weight: bold;
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

/* Mind Map Styles */
.mindmap-container {
    position: relative;
    min-height: 1000px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 4px solid var(--border-primary);
    padding: 50px;
    margin: 30px 0;
    overflow: visible;
}

.mindmap-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.central-node {
    background: linear-gradient(135deg, var(--header-bg) 0%, rgb(30, 60, 140) 100%);
    color: white;
    padding: 40px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid var(--border-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.mindmap-branch {
    position: absolute;
    z-index: 5;
}

.branch-node {
    background-color: var(--button-bg);
    color: white;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 15px;
    text-align: center;
    border: 3px solid var(--border-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 12px;
    white-space: nowrap;
}

.sub-branches {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 200px;
}

.sub-node {
    background-color: var(--bg-accent);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px;
    border: 3px solid var(--border-secondary);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

/* Position branches around the center - Fixed to prevent overlapping */
/* Branch 1: Top (12 o'clock position) */
.branch-1 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
}

/* Branch 2: Top Right (2 o'clock position) */
.branch-2 {
    top: 20%;
    right: 8%;
}

/* Branch 3: Bottom Right (4 o'clock position) */
.branch-3 {
    bottom: 20%;
    right: 8%;
}

/* Branch 4: Bottom (6 o'clock position) */
.branch-4 {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
}

/* Branch 5: Bottom Left (8 o'clock position) */
.branch-5 {
    bottom: 20%;
    left: 8%;
}

/* Branch 6: Top Left (10 o'clock position) */
.branch-6 {
    top: 20%;
    left: 8%;
}

/* Q&A Section Styles */
.qa-container {
    margin: 25px 0;
}

.qa-item {
    margin-bottom: 20px;
    border: 4px solid var(--qa-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.question-btn {
    width: 100%;
    background-color: var(--button-bg);
    color: white;
    padding: 18px 25px;
    font-size: 17px;
    font-weight: bold;
    text-align: left;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.question-btn:hover {
    background-color: var(--button-hover);
}

.q-icon {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    margin-right: 15px;
    font-weight: bold;
}

.answer-box {
    max-height: 0;
    overflow: hidden;
    background-color: white;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 25px;
}

.answer-box.active {
    max-height: 2000px;
    padding: 25px;
    border-top: 3px solid var(--border-secondary);
}

.answer-box p {
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.answer-box ul,
.answer-box ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

.answer-box li {
    font-weight: bold;
    margin-bottom: 10px;
}

.answer-box strong {
    color: var(--header-bg);
}

/* Footer Styles */
.main-footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    background-color: var(--bg-accent);
    border-radius: 12px;
    border: 4px solid var(--border-primary);
    font-weight: bold;
}

.main-footer p {
    margin: 10px 0;
    font-size: 16px;
    color: var(--text-primary);
}

/* Print Styles */
@media print {
    .print-button,
    .navigation-menu {
        display: none !important;
    }

    .container {
        margin-left: 0 !important;
        box-shadow: none !important;
        border: 2px solid black !important;
    }

    body {
        background: white !important;
    }

    .content-section {
        page-break-inside: avoid;
    }

    .answer-box {
        max-height: none !important;
        padding: 15px !important;
    }
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .navigation-menu {
        position: relative;
        left: 0;
        width: 100%;
        margin-bottom: 20px;
    }

    .container {
        margin-left: 0;
    }

    .mindmap-container {
        min-height: 1400px;
    }

    /* Adjust branch positions for tablets */
    .branch-1 {
        top: 3%;
    }

    .branch-2 {
        top: 18%;
        right: 5%;
    }

    .branch-3 {
        bottom: 35%;
        right: 5%;
    }

    .branch-4 {
        bottom: 3%;
    }

    .branch-5 {
        bottom: 35%;
        left: 5%;
    }

    .branch-6 {
        top: 18%;
        left: 5%;
    }

    .flow-split {
        flex-direction: column;
    }

    .info-table {
        font-size: 13px;
    }

    .info-table thead th,
    .info-table tbody td {
        padding: 10px;
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    .main-header h1 {
        font-size: 26px;
    }

    .content-section h2 {
        font-size: 24px;
    }

    .content-section h3 {
        font-size: 20px;
    }

    .navigation-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .navigation-menu h3 {
        grid-column: 1 / -1;
    }

    .mindmap-container {
        min-height: 1800px;
        padding: 30px 15px;
    }

    /* Stack mind map branches vertically on mobile */
    .mindmap-branch {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 20px auto;
        max-width: 90%;
    }

    .mindmap-center {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        margin: 30px auto;
        display: flex;
        justify-content: center;
    }

    .sub-branches {
        max-width: 100%;
    }

    .sub-node {
        white-space: normal;
    }

    .branch-node {
        white-space: normal;
    }

    .flow-box {
        min-width: 250px;
        font-size: 14px;
    }
}

/* Accessibility */
*:focus {
    outline: 3px solid var(--border-primary);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}