/* ===================================
   Part IV - Arbitration Act 1996
   Professional Stylesheet
   =================================== */

/* CSS Variables for consistent theming */
:root {
    /* Primary Colors */
    --primary-bg: rgb(15, 23, 42);
    --secondary-bg: rgb(30, 41, 59);
    --tertiary-bg: rgb(51, 65, 85);
    
    /* Accent Colors */
    --accent-gold: rgb(251, 191, 36);
    --accent-amber: rgb(245, 158, 11);
    --accent-emerald: rgb(16, 185, 129);
    --accent-blue: rgb(59, 130, 246);
    --accent-purple: rgb(139, 92, 246);
    --accent-rose: rgb(244, 63, 94);
    
    /* Text Colors */
    --text-primary: rgb(248, 250, 252);
    --text-secondary: rgb(203, 213, 225);
    --text-muted: rgb(148, 163, 184);
    
    /* Border Colors */
    --border-primary: rgb(71, 85, 105);
    --border-accent: rgb(251, 191, 36);
    --border-light: rgb(100, 116, 139);
    
    /* Section Colors */
    --section-82: rgb(59, 130, 246);
    --section-83: rgb(16, 185, 129);
    --section-84: rgb(139, 92, 246);
    --section-85: rgb(245, 158, 11);
    --section-86: rgb(244, 63, 94);
    --section-87: rgb(6, 182, 212);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.3);
    
    /* Fonts */
    --font-heading: 'Merriweather', Georgia, serif;
    --font-body: 'Source Sans Pro', 'Segoe UI', sans-serif;
}

/* Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 50%, var(--primary-bg) 100%);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    font-weight: 600;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    font-weight: 600;
}

strong {
    font-weight: 700;
    color: var(--accent-gold);
}

em {
    font-style: italic;
    color: var(--text-secondary);
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    border-bottom: 4px solid var(--accent-gold);
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1000px;
    margin: 0 auto;
}

.emblem {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.main-header h1 {
    color: var(--accent-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.main-header h2 {
    color: var(--text-primary);
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Print Button */
.print-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--accent-gold);
    color: var(--primary-bg);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.print-btn:hover {
    background: var(--accent-amber);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--secondary-bg);
    border-right: 3px solid var(--border-accent);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-primary);
}

.nav-header h3 {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

.nav-toggle {
    display: none;
    background: var(--accent-gold);
    color: var(--primary-bg);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2rem;
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--tertiary-bg);
    color: var(--text-primary);
    border-left-color: var(--accent-gold);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--tertiary-bg);
    color: var(--accent-gold);
    border-left-color: var(--accent-gold);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    max-width: 1200px;
}

/* Content Sections */
.content-section {
    background: var(--secondary-bg);
    border-radius: 12px;
    margin-bottom: 2rem;
    overflow: hidden;
    border: 2px solid var(--border-primary);
    box-shadow: var(--shadow-lg);
}

.section-header {
    background: linear-gradient(135deg, var(--tertiary-bg) 0%, var(--secondary-bg) 100%);
    padding: 1.5rem 2rem;
    border-bottom: 3px solid var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-number {
    background: var(--accent-gold);
    color: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

.section-body {
    padding: 2rem;
}

/* Section-specific colors */
#section82 .section-header { border-bottom-color: var(--section-82); }
#section82 .section-number { background: var(--section-82); }

#section83 .section-header { border-bottom-color: var(--section-83); }
#section83 .section-number { background: var(--section-83); }

#section84 .section-header { border-bottom-color: var(--section-84); }
#section84 .section-number { background: var(--section-84); }

#section85 .section-header { border-bottom-color: var(--section-85); }
#section85 .section-number { background: var(--section-85); }

#section86 .section-header { border-bottom-color: var(--section-86); }
#section86 .section-number { background: var(--section-86); }

#section87 .section-header { border-bottom-color: var(--section-87); }
#section87 .section-number { background: var(--section-87); }

/* Content Boxes */
.intro-box,
.legal-text-box,
.explanation-box,
.example-box,
.case-law-box,
.info-box,
.key-points-box {
    background: var(--tertiary-bg);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-gold);
}

.intro-box {
    border-left-color: var(--accent-emerald);
}

.legal-text-box {
    background: rgba(251, 191, 36, 0.1);
    border-left-color: var(--accent-gold);
}

.legal-text-box h4 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.explanation-box {
    border-left-color: var(--accent-blue);
}

.explanation-box h4 {
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.example-box {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--accent-emerald);
}

.example-box h4 {
    color: var(--accent-emerald);
    margin-bottom: 1rem;
}

.case-law-box {
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--accent-purple);
}

.case-law-box h4 {
    color: var(--accent-purple);
    margin-bottom: 1rem;
}

.case-details {
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1.25rem;
    border: 1px solid var(--border-light);
}

.case-details h5 {
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.case-details .citation {
    color: var(--accent-amber);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.case-details .court {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.case-details .facts,
.case-details .ratio {
    margin-bottom: 0.5rem;
}

.key-points-box {
    border-left-color: var(--accent-rose);
}

.key-points-box h4 {
    color: var(--accent-rose);
    margin-bottom: 1rem;
}

/* Lists */
ul, ol {
    margin: 1rem 0 1rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

li ul, li ol {
    margin-top: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--tertiary-bg);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--border-primary);
    font-weight: 600;
}

th {
    background: var(--secondary-bg);
    color: var(--accent-gold);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

tr:nth-child(even) {
    background: rgba(51, 65, 85, 0.5);
}

tr:hover {
    background: rgba(251, 191, 36, 0.1);
}

.summary-table h4,
.comparison-highlight h4,
.info-box h4 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.full-width-table {
    overflow-x: auto;
}

.comparison-main-table {
    min-width: 900px;
}

/* Flowchart Styles */
.flowchart-container {
    background: var(--tertiary-bg);
    border-radius: 12px;
    padding: 2rem;
    overflow-x: auto;
    min-height: 600px;
}

.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.flow-node {
    background: linear-gradient(135deg, var(--secondary-bg) 0%, var(--tertiary-bg) 100%);
    border: 3px solid var(--accent-gold);
    border-radius: 12px;
    padding: 1.25rem 2rem;
    text-align: center;
    min-width: 280px;
    max-width: 350px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.flow-node.start {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-amber) 100%);
    color: var(--primary-bg);
    border-radius: 50px;
}

.flow-node.decision {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    transform: rotate(0deg);
    border-radius: 8px;
}

.flow-node.process {
    border-color: var(--accent-emerald);
}

.flow-node.end {
    background: linear-gradient(135deg, var(--accent-rose) 0%, var(--accent-purple) 100%);
    border-radius: 50px;
}

.flow-node h5 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.flow-node p {
    font-size: 0.9rem;
    margin: 0;
    color: var(--text-secondary);
}

.flow-arrow {
    width: 4px;
    height: 40px;
    background: var(--accent-gold);
    position: relative;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid var(--accent-gold);
}

.flow-branch {
    display: flex;
    justify-content: center;
    gap: 4rem;
    position: relative;
}

.flow-branch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%;
    right: 25%;
    height: 4px;
    background: var(--accent-gold);
}

.branch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.branch-label {
    background: var(--accent-emerald);
    color: var(--primary-bg);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.branch-label.no {
    background: var(--accent-rose);
}

/* Mind Map Styles */
.mindmap-container {
    background: var(--tertiary-bg);
    border-radius: 12px;
    padding: 2rem;
    overflow-x: auto;
    min-height: 700px;
}

.mindmap {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-width: 1000px;
    min-height: 650px;
}

.mindmap-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-amber) 100%);
    color: var(--primary-bg);
    padding: 2rem;
    border-radius: 50%;
    width: 180px;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    z-index: 10;
}

.mindmap-center h3 {
    font-size: 1rem;
    color: var(--primary-bg);
    margin-bottom: 0.25rem;
}

.mindmap-center span {
    font-size: 0.8rem;
    font-weight: 600;
}

.mindmap-branch {
    position: absolute;
    background: var(--secondary-bg);
    border: 3px solid;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    min-width: 160px;
    max-width: 200px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.mindmap-branch h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.mindmap-branch p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.mindmap-branch.sec82 {
    top: 5%;
    left: 5%;
    border-color: var(--section-82);
}

.mindmap-branch.sec83 {
    top: 5%;
    right: 5%;
    border-color: var(--section-83);
}

.mindmap-branch.sec84 {
    top: 50%;
    transform: translateY(-50%);
    left: 2%;
    border-color: var(--section-84);
}

.mindmap-branch.sec85 {
    top: 50%;
    transform: translateY(-50%);
    right: 2%;
    border-color: var(--section-85);
}

.mindmap-branch.sec86 {
    bottom: 5%;
    left: 5%;
    border-color: var(--section-86);
}

.mindmap-branch.sec87 {
    bottom: 5%;
    right: 5%;
    border-color: var(--section-87);
}

.mindmap-line {
    position: absolute;
    background: var(--border-light);
    height: 3px;
    transform-origin: left center;
    z-index: 1;
}

/* Roadmap Styles */
.roadmap-container {
    background: var(--tertiary-bg);
    border-radius: 12px;
    padding: 2rem;
    overflow-x: auto;
}

.roadmap {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 60px;
}

.roadmap::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to bottom, 
        var(--section-82) 0%, 
        var(--section-83) 20%,
        var(--section-84) 40%,
        var(--section-85) 60%,
        var(--section-86) 80%,
        var(--section-87) 100%
    );
    border-radius: 3px;
}

.roadmap-item {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
    padding: 1.5rem 0;
}

.roadmap-marker {
    position: absolute;
    left: -60px;
    width: 50px;
    height: 50px;
    background: var(--secondary-bg);
    border: 4px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-gold);
    z-index: 5;
}

.roadmap-item:nth-child(1) .roadmap-marker { border-color: var(--section-82); color: var(--section-82); }
.roadmap-item:nth-child(2) .roadmap-marker { border-color: var(--section-83); color: var(--section-83); }
.roadmap-item:nth-child(3) .roadmap-marker { border-color: var(--section-84); color: var(--section-84); }
.roadmap-item:nth-child(4) .roadmap-marker { border-color: var(--section-85); color: var(--section-85); }
.roadmap-item:nth-child(5) .roadmap-marker { border-color: var(--section-86); color: var(--section-86); }
.roadmap-item:nth-child(6) .roadmap-marker { border-color: var(--section-87); color: var(--section-87); }

.roadmap-content {
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 1.5rem;
    flex: 1;
    border: 2px solid var(--border-primary);
    transition: all 0.3s ease;
}

.roadmap-content:hover {
    border-color: var(--accent-gold);
    transform: translateX(10px);
}

.roadmap-content h4 {
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.roadmap-content .date {
    color: var(--accent-amber);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.roadmap-content p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.95rem;
}

/* Disclaimer Section */
.disclaimer-section {
    margin-top: 2rem;
}

.disclaimer-box {
    background: rgba(244, 63, 94, 0.1);
    border: 2px solid var(--accent-rose);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.disclaimer-box h3 {
    color: var(--accent-rose);
    margin-bottom: 1rem;
}

.disclaimer-box p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.disclaimer-box em {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent-gold);
    color: var(--primary-bg);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-amber);
    transform: translateY(-5px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .side-nav {
        transform: translateX(-100%);
    }
    
    .side-nav.open {
        transform: translateX(0);
    }
    
    .nav-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4rem;
    }
    
    .print-btn {
        position: relative;
        top: 0;
        right: 0;
        margin-top: 1rem;
    }
    
    .main-header {
        padding: 1.5rem 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 768px) {
    .flow-branch {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flow-branch::before {
        display: none;
    }
    
    .mindmap {
        min-width: auto;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .mindmap-center {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 150px;
        height: 150px;
    }
    
    .mindmap-branch {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        max-width: 100%;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.75rem 0.5rem;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .side-nav,
    .print-btn,
    .back-to-top,
    .nav-toggle {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
        max-width: 100%;
    }
    
    .content-section {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .section-header {
        background: #f5f5f5;
        border-bottom: 2px solid #333;
    }
    
    .section-number {
        background: #333;
        color: white;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #333;
    }
    
    strong {
        color: #333;
    }
    
    .legal-text-box,
    .explanation-box,
    .example-box,
    .case-law-box {
        background: #f9f9f9;
        border-left: 4px solid #333;
    }
    
    table {
        border: 1px solid #333;
    }
    
    th {
        background: #e5e5e5;
        color: #333;
    }
    
    a {
        color: #333;
        text-decoration: underline;
    }
    
    .flowchart-container,
    .mindmap-container,
    .roadmap-container {
        background: #f5f5f5;
        border: 1px solid #ccc;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section {
    animation: fadeIn 0.5s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-amber);
}

/* Selection Styling */
::selection {
    background: var(--accent-gold);
    color: var(--primary-bg);
}