﻿/* ============================================================================
   HICDEP WIKI - GLOBAL STYLES & DESIGN SYSTEM
   ============================================================================ */

/* Root Variables */
:root {
    /* Colors - Subtle Blue Theme */
    --color-primary: #028bff;
    --color-primary-dark: #0070d8;
    --color-primary-light: #4da6ff;
    --color-primary-lighter: #e6f2ff;
    --color-secondary: #f5f5f5;
    --color-text: #2c3e50;
    --color-text-light: #5a6c7d;
    --color-text-muted: #8b95a5;
    --color-border: #dfe4eb;
    --color-border-light: #e8ecf1;
    --color-background: #ffffff;
    --color-background-alt: #f8fafc;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #06b6d4;

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-base: 1.6;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    --spacing-side: 100px;

    /* Breakpoints */
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --breakpoint-xxl: 1400px;

    /* Shadow & Border Radius */
    --border-radius: 6px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(2, 139, 255, 0.08);
    --shadow-lg: 0 10px 28px rgba(2, 139, 255, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-background);
}

body.debug {
    background-color: rgba(2, 139, 255, 0.05);
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-md);
}

h5 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

h6 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================================================
   LAYOUT COMPONENTS
   ============================================================================ */

/* Main Wrapper & Container */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-side);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* Padding Utilities */
.p-default {
    padding: var(--spacing-lg) var(--spacing-side);
}

.p-small {
    padding: var(--spacing-md) var(--spacing-side);
}

.p-large {
    padding: var(--spacing-xl) var(--spacing-side);
}

@media (max-width: 768px) {
    .p-default {
        padding: var(--spacing-md) var(--spacing-md);
    }

    .p-small {
        padding: var(--spacing-md) var(--spacing-md);
    }

    .p-large {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* Sections */
section {
    padding: var(--spacing-lg) var(--spacing-side);
}

@media (max-width: 768px) {
    section {
        padding: var(--spacing-lg) var(--spacing-md);
    }
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.main-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 0 var(--spacing-side);
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 60px;
    flex-wrap: nowrap;

}

@media (max-width: 1200px) {
    .main-header {
        padding: 0 var(--spacing-md);
    }
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 var(--spacing-lg);
    height: 100%;
    transition: background-color var(--transition-fast);
}

.header-logo:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-logo:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

.header-logo img {
    max-height: 60px;
    height: auto;
    display: block;
    width: auto;
}

/* Navigation Toggle Button */
#nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: auto 0 auto auto;
    width: auto;
    height: 100%;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast);
    position: relative;
    min-width: 44px;
}

#nav-toggle::before {
    content: '☰';
    font-size: 1.5rem;
}

#nav-toggle::after {
    content: '✕';
    font-size: 1.5rem;
    position: absolute;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

#nav-toggle.is-open::before {
    opacity: 0;
}

#nav-toggle.is-open::after {
    opacity: 1;
}

#nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#nav-toggle:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

@media (max-width: 1200px) {
    #nav-toggle {
        display: flex;
    }
}

/* Navigation Panel */
#nav-panel {
    display: flex;
    flex: 1;
    height: 60px;
}

#nav-panel-inner {
    display: flex;
    width: 100%;
    height: 100%;
}

@media (max-width: 1200px) {
    #nav-panel {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--color-primary-dark);
        display: none;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
        z-index: 999;
        height: auto;
        max-height: calc(100vh - 60px);
        animation: slideDown var(--transition-base) ease-out;
    }

    #nav-panel.is-open {
        display: flex;
    }

    #nav-panel-inner {
        flex-direction: column;
        padding: 0;
        width: 100%;
        height: auto;
    }
}

/* Navigation List */
.nav {
    display: flex;
    list-style: none;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.nav-list-level-0 {
    display: flex;
    list-style: none;
    gap: 0;
    width: 100%;
    height: 100%;
    align-items: stretch;
    margin: 0;
    padding: 0;
    max-height: 120px;
}

.nav-list-item {
    position: relative;
    list-style: none;
    flex: 0 1 auto;
    display: flex;
    align-items: stretch;
    height: auto;
    min-height: 60px;
}

.nav-item {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    position: relative;
}

.nav-item-0 {
    width: 100%;
    height: 100%;
}

.nav-action {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: white;
    padding: 0 var(--spacing-lg);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: background-color var(--transition-fast);
    position: relative;
    width: auto;
    height: 100%;
    border: none;
    background: none;
    font-size: var(--font-size-base);
    font-family: var(--font-family-base);
    cursor: pointer;
    white-space: nowrap;
    gap: var(--spacing-md);
}

.nav-action:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-action.is-active,
.nav-action.is-current {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-action:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

.nav-action-span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Dropdown Toggle - Square Button */
.nav-toggle-level-a11y {
    display: none;
}

.nav-toggle-level {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    border-radius: var(--border-radius);
    font-size: 1rem;
    line-height: 1;
}

.nav-toggle-level::after {
    content: '▼';
    font-size: 0.65rem;
    transition: transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.nav-toggle-level:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-toggle-level:focus-visible {
    outline: 2px solid white;
    outline-offset: -2px;
}

.nav-toggle-level.is-active {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-toggle-level.is-active::after {
    transform: rotate(180deg);
}

@media (max-width: 1200px) {
    .nav {
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .nav-list-level-0 {
        flex-direction: column;
        gap: 0;
        width: 100%;
        height: auto;
        align-items: stretch;
        flex-wrap: nowrap;
        max-height: none;
        overflow-y: visible;
    }

    .nav-list-item {
        flex: 1 1 auto;
        flex-direction: column;
        height: auto;
        min-height: auto;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item-0 {
        width: 100%;
        height: auto;
    }

    .nav-action {
        padding: var(--spacing-md) var(--spacing-lg);
        justify-content: flex-start;
        height: auto;
        min-height: 44px;
        white-space: normal;
        word-break: break-word;
        flex: 1;
        width: 100%;
        min-width: auto;
    }

    .nav-item {
        flex-wrap: wrap;
    }

    .nav-toggle-level {
        display: flex;
        position: static;
        transform: none;
        margin-left: auto;
        padding: 0;
        height: 44px;
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
        margin: auto var(--spacing-md);
    }
}

/* Dropdown Submenu */
.nav-list-level-1 {
    display: none;
    list-style: none;
    background-color: rgba(0, 0, 0, 0.2);
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.nav-list-level-1.is-open {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1201px) {
    .nav-list-level-1 {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        min-width: 320px;
        max-width: 100%;
        flex-direction: column;
        display: none;
        background-color: var(--color-primary-dark);
        box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1), var(--shadow-lg);
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        z-index: 1001;
    }

    .nav-list-item:hover > .nav-list-level-1 {
        display: flex;
    }

    .nav-item-1 {
        padding: 0;
        width: 100%;
        height: auto;
    }

    .nav-item-1 a {
        display: flex;
        align-items: center;
        padding: var(--spacing-md) var(--spacing-lg);
        text-decoration: none;
        color: white;
        font-weight: var(--font-weight-semibold);
        transition: background-color var(--transition-fast);
        width: 100%;
        font-size: var(--font-size-base);
        white-space: normal;
        word-wrap: break-word;
        min-height: 44px;
    }

    .nav-item-1 a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .nav-item-1 a.is-active,
    .nav-item-1 a.is-current {
        background-color: rgba(255, 255, 255, 0.25);
        border-left: 3px solid white;
        padding-left: calc(var(--spacing-lg) - 3px);
    }
}

@media (max-width: 1200px) {
    .nav-list-level-1 {
        background-color: rgba(0, 0, 0, 0.3);
        border-left: 3px solid rgba(255, 255, 255, 0.2);
        margin-left: 0;
        padding: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base) ease-out;
    }

    .nav-list-level-1.is-open {
        display: flex;
        max-height: 1000px;
    }

    .nav-item-1 {
        width: 100%;
    }

    .nav-item-1 a {
        padding: var(--spacing-sm) var(--spacing-lg);
        padding-left: calc(var(--spacing-lg) * 2);
        font-size: var(--font-size-sm);
        white-space: normal;
        word-wrap: break-word;
        min-height: 40px;
        display: flex;
        width: 100%;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes expandMenu {
    from {
        max-height: 0;
        opacity: 0;
    }

    to {
        max-height: 1000px;
        opacity: 1;
    }
}

/* ============================================================================
   BREADCRUMB
   ============================================================================ */

.breadcrumb-wrapper {
    background-color: var(--color-background-alt);
    border-bottom: 1px solid var(--color-border-light);
    padding: 0 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: var(--spacing-sm);
    padding: 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    max-width: 1200px;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.breadcrumb a {
    color: var(--color-primary);
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--color-text-muted);
}

@media (max-width: 768px) {
    .breadcrumb {
        padding: 0 var(--spacing-md);
    }
}

/* ============================================================================
   FORMS & INPUTS
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: var(--color-background);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

fieldset {
    margin-bottom: var(--spacing-lg);
    border: none;
    padding: 0;
}

label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

label.required::after {
    content: '*';
    color: var(--color-danger);
    margin-left: 2px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: 32px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    background-color: var(--color-primary);
    color: white;
    cursor: pointer;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
    text-decoration: none;
}

button:hover,
.button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

button:active,
.button:active {
    transform: translateY(0);
}

button:focus-visible,
.button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Button Variants */
.button-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.button-secondary:hover {
    background-color: var(--color-border-light);
    border-color: var(--color-border);
}

.button-success {
    background-color: var(--color-success);
}

.button-success:hover {
    background-color: #059669;
}

.button-danger {
    background-color: var(--color-danger);
}

.button-danger:hover {
    background-color: #dc2626;
}

.button-small {
    padding: 4px 12px;
    font-size: var(--font-size-sm);
}

.button-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

/* Tab Navigation */
.hicdep-tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border-light);
    gap: 0;
    margin-bottom: var(--spacing-lg);
}

.tab-button {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-light);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin: 0;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--color-text);
    background-color: var(--color-background-alt);
}

.tab-button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: none;
}

.tab-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Tab Panels */
.tab-panels {
    margin-top: var(--spacing-lg);
}

.tab-panel {
    display: none;
    animation: fadeIn var(--transition-fast);
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   TABLES
   ============================================================================ */

table {
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Table variant: Full width (default) */
table.table {
    width: 100%;
    background-color: var(--color-background);
}

/* Table variant: Fit content */
table.table-compact {
    width: auto;
    background-color: var(--color-background);
}

thead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

thead th,
thead td {
    padding: var(--spacing-md) var(--spacing-lg);
    font-weight: var(--font-weight-bold);
    text-align: left;
    border: none;
    white-space: nowrap;
}


tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: var(--color-background-alt);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: var(--spacing-sm) var(--spacing-md);
    vertical-align: top;
}

table a {
    color: var(--color-primary);
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

/* Responsive Table */
@media (max-width: 768px) {
    table {
        font-size: var(--font-size-sm);
    }

    thead th,
    thead td {
        padding: var(--spacing-md) var(--spacing-md);
    }

    thead th:first-child,
    thead td:first-child,
    thead th:last-child,
    thead td:last-child {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        margin-bottom: var(--spacing-lg);
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius);
        overflow: hidden;
    }

    td {
        padding: var(--spacing-xs) var(--spacing-md);
        position: relative;
        padding-left: 50%;
    }

    td:first-child,
    td:last-child {
        padding-left: 50%;
        padding-right: var(--spacing-md);
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: var(--spacing-md);
        font-weight: var(--font-weight-bold);
        width: 45%;
        word-wrap: break-word;
    }
}

/* ============================================================================
   COMPONENT: TEXT STANDARD
   ============================================================================ */

.text-standard {
    /* Inherits from section class */
}

.text-standard-content {
    color: var(--color-text);
    line-height: var(--line-height-base);
}

.text-standard-content h2,
.text-standard-content h3,
.text-standard-content h4 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.text-standard-content p {
    margin-bottom: var(--spacing-md);
}

.text-standard-content ul,
.text-standard-content ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.text-standard-content li {
    margin-bottom: var(--spacing-sm);
}

.text-standard-content a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}

.text-standard-content a:hover {
    text-decoration: none;
    color: var(--color-primary-dark);
}

/* Rich Text Editor Styling */
.rte {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

.rte > * + * {
    margin-top: var(--spacing-md);
}

.rte h1,
.rte h2,
.rte h3,
.rte h4,
.rte h5,
.rte h6 {
    margin-top: var(--spacing-lg);
}

.rte strong,
.rte b {
    font-weight: var(--font-weight-bold);
}

.rte em,
.rte i {
    font-style: italic;
}

.rte blockquote {
    padding-left: var(--spacing-lg);
    border-left: 4px solid var(--color-primary);
    color: var(--color-text-light);
    font-style: italic;
    margin: var(--spacing-lg) 0;
    background-color: var(--color-primary-lighter);
    padding: var(--spacing-md) var(--spacing-lg);
}

.rte code {
    background-color: var(--color-background-alt);
    padding: 2px 6px;
    border-radius: var(--border-radius);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-primary);
}

.rte pre {
    background-color: var(--color-background-alt);
    border: 1px solid var(--color-border);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: var(--spacing-lg) 0;
}

.rte pre code {
    padding: 0;
    background: none;
    color: var(--color-text);
}

/* ============================================================================
   COMPONENT: HICDEP WIKI
   ============================================================================ */

.hicdep-wiki-section {
    /* Uses standard section padding */
}

.hicdep-wiki-intro,
.hicdep-wiki-outro {
    margin-bottom: var(--spacing-lg);
}

.hicdep-wiki-table {
    margin: var(--spacing-lg) 0;
}

.hicdep-wiki-table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border-light);
}

.hicdep-wiki-table tr:hover {
    background-color: var(--color-background-alt);
}

/* ============================================================================
   COMPONENT: HICDEP TOOL
   ============================================================================ */

.hicdep-tool-section {
    background-color: var(--color-background-alt);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border-light);
    /* Uses standard section padding */
}

.hicdep-tool-select-group {
    margin-bottom: var(--spacing-lg);
}

.hicdep-tool-select-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

.hicdep-tool-select-group select {
    width: 100%;
    max-width: 400px;
}

.hicdep-tool-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.hicdep-tool-editor {
    background-color: var(--color-background);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    margin-top: var(--spacing-lg);
}

.hicdep-tool-editor fieldset {
    margin-bottom: var(--spacing-lg);
}

.richTextEdittor {
    min-height: 300px;
}

/* ============================================================================
   HICDEP TOOL - ANIMATIONS & TRANSITIONS
   ============================================================================ */

/* Smooth visibility transitions */
.hicdep-tool-editor {
    animation: slideIn var(--transition-base) ease-out;
    overflow: hidden;
    transition: all var(--transition-base) ease-out;
}

.hicdep-tool-editor.hidden {
    display: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    animation: slideOut var(--transition-base) ease-out;
}

.hicdep-tool-editor.active {
    display: block;
    opacity: 1;
    animation: slideIn var(--transition-base) ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

/* Tab panel animations */
.tab-panel {
    animation: fadeIn var(--transition-fast) ease-out;
    max-height: 100%;
    overflow: visible;
}

.tab-panel:not(.active) {
    display: none;
    max-height: 0;
    overflow: hidden;
    animation: fadeOut var(--transition-fast) ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        max-height: 100%;
    }

    to {
        opacity: 0;
        max-height: 0;
    }
}

/* Link-styled button for table names */
.link-button {
    display: inline;
    padding: 0;
    background: none;
    color: var(--color-primary);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    transition: color var(--transition-fast), text-decoration var(--transition-fast);
}

.link-button:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.link-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Editor section styling */
.hicdep-tool-editor {
    position: relative;
}

/* Make form sections more organized */
.hicdep-tool-select-group > * + * {
    margin-top: var(--spacing-md);
}

/* Better spacing for editor sections within tabs */
.tab-panel > * + * {
    margin-top: var(--spacing-lg);
}

/* Improve table styling in editor */
.hicdep-tool-editor .table {
    margin-top: var(--spacing-lg);
    margin-bottom: 0;
}

.hicdep-tool-editor .table thead {
    position: sticky;
    top: 0;
}

/* Button styling consistency */
.hicdep-tool-editor .button-small {
    white-space: nowrap;
}

/* Loading state for async operations */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
