@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-page: #090d16;
    --bg-card: #111827;
    --bg-card-hover: #172033;
    --bg-input: #0d131f;
    --border: #1f293d;
    --border-hover: #374151;
    --border-focus: #3b82f6;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --accent: #06b6d4;
    --text-main: #f3f4f6;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.6);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Layout Containers */
.container, .argumentcontainer {
    max-width: 1360px;
    width: 95%;
    margin: 32px auto 60px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    float: none !important;
}

/* Header Section */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.header-content h1, h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, #ffffff 30%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 a {
    text-decoration: none;
    color: inherit;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 0 0 10px 0;
}

.header-desc {
    font-size: 0.92rem;
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.6;
    margin: 0;
}

.header-logo .lumina-box-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 16px var(--primary-glow));
}

/* Navigation Modes (Gallery / Menu) */
.modenav {
    display: inline-flex;
    background: var(--bg-input);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: 16px 0 28px 0;
    gap: 4px;
}

.modebutton {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.modebutton:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.modeactive {
    background: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* Category Headings */
h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin: 36px 0 18px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--accent);
    border-radius: 4px;
}

/* Gallery Grid */
.gallery, .gallery_missing {
    display: inline-flex !important;
    flex-direction: column;
    width: 220px !important;
    margin: 10px 10px 18px 0;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    vertical-align: top;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    text-align: center;
}

.gallery:hover, .gallery_missing:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 24px -4px var(--primary-glow);
}

.gallery a, .gallery_missing a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.gallery img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.gallery_missing a {
    padding: 24px 16px;
    justify-content: center;
    min-height: 170px;
    color: var(--text-muted);
}

/* Collapsible Section Accordions */
h3.toggle {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 14px 0 8px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    width: 100% !important;
}

h3.toggle:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

h3.toggle::before {
    content: "▸";
    font-size: 1.1rem;
    color: var(--primary);
    transition: transform 0.2s ease;
}

h3.toggle.open::before {
    transform: rotate(90deg);
}

/* Form Tables / Generator Args */
table[role="presentation"] {
    width: 100%;
    margin: 8px 0 20px 0;
    border-collapse: separate;
    border-spacing: 0 8px;
}

table[role="presentation"] tr {
    background: rgba(13, 19, 31, 0.5);
    border-radius: var(--radius-sm);
}

table[role="presentation"] td {
    padding: 10px 14px;
    vertical-align: middle;
}

table[role="presentation"] td:first-child {
    width: 250px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

table[role="presentation"] td:last-child {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Inputs & Form Elements */
input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    max-width: 380px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    padding: 9px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select {
    cursor: pointer;
}

/* Action Buttons / Generator Controls */
input[type="submit"],
button.btn-primary,
#generate,
#preview_buttons input {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: #ffffff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 28px;
    cursor: pointer;
    box-shadow: 0 4px 14px var(--primary-glow);
    transition: all 0.2s ease;
    margin: 8px 8px 8px 0;
}

input[type="submit"]:hover,
button.btn-primary:hover,
#preview_buttons input:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

/* Linkbar / Breadcrumb Header */
.linkbar {
    padding: 12px 0;
    margin: 8px 0 16px 0;
    border-bottom: 1px solid var(--border);
}

.linkbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.linkbar ul li a {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.linkbar ul li a:hover {
    color: var(--primary);
}

/* Menu Page */
.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu ul li {
    padding: 10px 16px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
    font-size: 0.92rem;
}

.menu ul li:hover {
    background: var(--bg-card-hover);
}

.menu ul li a {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    margin-right: 8px;
}

.menu ul li a:hover {
    color: var(--primary);
}

/* Preview Area */
#preview {
    margin-top: 24px;
    background: #000000;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}

#preview_figure svg {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* Language Selector */
select[name="language"] {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

/* Responsive Rules */
@media (max-width: 860px) {
    .container, .argumentcontainer {
        padding: 20px;
        width: 100%;
        margin: 12px auto;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .header-main {
        flex-direction: column;
    }
    
    .gallery, .gallery_missing {
        width: 100% !important;
        margin-right: 0;
    }
    
    table[role="presentation"] td:first-child {
        width: auto;
    }
}
