/* --- SysCalc Live: Modern Dark Mode Interface Theme --- */

/* 1. GLOBAL VARIABLES & FONTS */
:root {
    --color-bg-deep: #121212;
    --color-bg-panel: #1e1e1e;
    --color-text-primary: #e0e0e0;
    --color-text-secondary: #aaaaaa;
    --color-accent-blue: #00bcd4;
    --color-border-subtle: #333333;
    --color-link: #37b7c2;
    --color-result: #0d0d0d;
    --color-btn-glow: rgba(0, 188, 212, 0.4);
    --color-btn-active: #007c87;
}

@font-face {
    font-family: 'Plus Jakarta Sans';
    src: url('../fonts/PlusJakartaSans-variable.woff2') format('woff2');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap; 
}

@font-face {
    font-family: 'Noto Sans JP';
    src: url('../fonts/NotoSansJP-variable.woff2') format('woff2');
    font-weight: 200 800; 
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Noto Sans KR';
    src: url('../fonts/NotoSansKR-variable.woff2') format('woff2');
    font-weight: 200 800; 
    font-style: normal;
    font-display: swap;
}

/* 2. BASE STYLES & LAYOUT */
html {
    scroll-padding-top: 60px;
    scroll-behavior: smooth;
}

body {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: var(--color-text-primary);
    background-color: var(--color-bg-deep);
    margin: 0;
    padding: 15px 10px;
    padding-top: 50px;
    line-height: 1.5;
}

.container,
.window-frame,
.calculator-section {
    background-color: var(--color-bg-panel);
    padding: 25px;
    margin: 15px auto;
    max-width: 750px;
    border: 1px solid var(--color-border-subtle);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.ruler {
    border: none;
    height: 1px;
    background-color: #444444;
    margin: 40px auto;
    max-width: 750px;
}

/* 3. TYPOGRAPHY & LINKS */
h1, h2, h3 {
    font-weight: 800;
    color: var(--color-accent-blue);
    margin: 0 0 10px 0;
    text-shadow: 0 0 5px rgba(0, 188, 212, 0.2);
}

header {
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 2.4em;
    color: var(--color-text-primary);
}

h2 {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 8px;
}

.formula-subtitle {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin-bottom: 15px;
    text-align: center;
}

.link {
    color: var(--color-link);
    font-weight: 400;
    text-decoration: underline;
}

.back-link {
    display: block;
    text-align: right;
    color: var(--color-link);
    font-weight: 700;
    text-decoration: none;
}

.sep {
    color: #444;
    font-size: 0.7rem;
    user-select: none;
}

/* 4. FORM CONTROLS & BUTTONS */
.calc-form {
    padding: 15px 0;
    border-top: 1px solid var(--color-border-subtle);
}

.calc-form label {
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 4px;
    display: block;
}

input[type="number"],
select, 
button {
    width: 100%; 
    box-sizing: border-box; 
}

input[type="number"], select {
    padding: 10px;
    border: 1px solid #555555;
    background-color: #0d0d0d;
    color: var(--color-text-primary);
    font-family: inherit;
    font-size: 1em;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    appearance: none;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--color-accent-blue);
    outline: none;
    box-shadow: 0 0 5px var(--color-accent-blue);
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2012%2012%22%3E%3Cpath%20fill%3D%22%2337b7c2%22%20d%3D%22M6%209l4-4H2z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select option {
    background-color: #1e1e1e;
}

button {
    font-size: 1.1em;
    width: 93%; /* Original attribute preserved */
    padding: 12px 20px;
    margin-top: 20px;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #0097a7;
    border-radius: 6px;
    background: linear-gradient(to bottom, #00bcd4 0%, #00a6b7 100%);
    box-shadow:
        0 3px 0 var(--color-btn-active),
        0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
}

button:active {
    box-shadow:
        0 1px 0 var(--color-btn-active),
        0 2px 5px rgba(0, 0, 0, 0.3);
    transform: translateY(2px);
}

/* 5. DATA TABLES & RESULTS */
td {
    vertical-align: top;
}

.result-box {
    background-color: #0d0d0d;
    border: 1px solid var(--color-accent-blue);
    padding: 15px;
    padding-bottom: 30px; 
    margin-top: 20px;
    font-weight: 300;
    color: #f0f0f0;
    border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0, 188, 212, 0.3);
    white-space: pre-wrap;
    position: relative; 
}

.result-box::after {
    content: "* SysCalc Live v1.0 // MISTRNICK";
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.8em;
    font-style: italic;
    color: #555; 
    pointer-events: none;
}

.result-pri {
    padding-left: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
}

.result-sec {
    padding-left: 15px;
    font-size: 0.9rem;
    color: #888;       
    line-height: 1; 
}

.mode-axial {
    background-color: rgba(0, 188, 212, 0.15) !important;
    border-left: 4px solid var(--color-accent-blue); 
    font-weight: 500;
}

.mode-axial td {
    color: #ffffff; 
}

.mode-table-container {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 4px;
    border: 1px solid var(--color-border-subtle);
}

/* 6. NAVIGATION SYSTEMS */
/* Desktop Nav Tiles */
.nav-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.nav-tile {
    font-size: 1.1em;
    display: block;
    padding: 15px 10px;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 700;
    background-color: #2c2c2c;
    border: 1px solid #444444;
    border-radius: 6px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-table td {
    padding: 6px;
    text-align: center;
}

.nav-tile:hover {
    color: #ffffff;
    border-color: var(--color-accent-blue);
    background-color: #383838;
    box-shadow: 0 0 10px var(--color-btn-glow);
}

.nav-table ul {
    list-style-type: "•   ";
    list-style-position: outside;
    padding: 0 0 0 15px;
    margin: 10px 0 0 0;
    text-align: left;
}

.nav-table ul li { padding: 2px 0; }

.nav-table ul a {
    text-decoration: none;
    font-weight: 500;
    color: var(--color-accent-blue);
    transition: color 0.2s;
}

.nav-table ul a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Language Switcher */
.lang-banner {
    position: fixed; 
    top: 0; left: 0; width: 100%;
    background: rgba(0, 0, 0, 0.33); 
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    display: flex;
    justify-content: flex-end; 
    z-index: 2000; 
    box-sizing: border-box; 
}

.lang-links {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.lang-links a{
    text-decoration: none;
}

.lang-text {
    color: #888;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.lang-text:hover { color: var(--color-accent-blue); }

.lang-text.active {
    color: #fdfdfd;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.6);
    border-bottom: 2px solid var(--color-accent-blue);
    pointer-events: none;
}

/* Sidebar Menu */
.side-nav {
    height: 100%; width: 0;
    position: fixed; z-index: 1000;
    top: 0; left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-x: hidden;
    transition: 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
    padding-top: 100px;
    backdrop-filter: blur(10px);
}

.side-nav-links { display: flex; flex-direction: column; padding-left: 40px; }

.side-nav a {
    padding: 15px 0;
    text-decoration: none;
    font-size: 1.1rem;
    color: #fdfdfd;
    display: block;
    transition: 0.3s;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 700;
}

.side-nav a:hover { color: rgba(253, 253, 253, 0.5); }

/* Hamburger Button */
.menu-toggle {
    position: fixed;
    top: 35px; 
    left: 20px;
    background: transparent;
    border: none !important;
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
    outline: none;
    box-shadow: none !important;
    transition: none !important;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-icon {
    width: 30px; height: 18px;
    display: flex; flex-direction: column;
    justify-content: space-between;
}

.menu-toggle .hamburger-icon span {
    display: block;
    width: 25px; 
    height: 3px;
    background-color: #fdfdfd !important;
    transition: all 0.3s ease-in-out;
    position: relative;
}

.menu-toggle.open .hamburger-icon span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open .hamburger-icon span:nth-child(2) { opacity: 0; }
.menu-toggle.open .hamburger-icon span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 7. GRAPHICS & OVERRIDES */
html[lang="ja"] body {
    font-family: 'Noto Sans JP', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
}

html[lang="ko"] body {
    font-family: 'Noto Sans KR', 'Plus Jakarta Sans', sans-serif;
    font-size: 1.05rem;
    line-height: 1.75;
}

html[lang="ko"] .tip-list li, 
html[lang="ko"] .tech-tip li {
    line-height: 1.75;
}

/* 8. TIPS & NOTES */
.tips {
    margin-top: 20px;
    padding: 15px;
    background: #2b2b2b;
    border: 1px solid #444444;
    border-radius: 6px;
    color: var(--color-text-secondary);
}

.tips h4 {
    color: var(--color-link);
    margin: 0 0 10px 0;
    border-bottom: 1px dotted #444444;
    padding-bottom: 5px;
    text-transform: uppercase;
}

.tip-list li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.tech-tip-title {
    display: block;
    letter-spacing: 0.12em; 
    font-weight: 800;
    font-size: 0.8rem; 
    margin-bottom: 4px;
}

.tech-tip {
    background: rgba(0, 188, 212, 0.3);
    border-left: 3px solid #0097a7;
    padding: 12px 15px; 
    font-size: 0.9em;
    margin-top: 10px;
    border-radius: 0 4px 4px 0; 
}

.tech-tip li { line-height: 1.5; margin-bottom: 12px; }

.warning-note {
    background: rgba(255, 204, 0, 0.1);
    border-left: 3px solid #ffcc00;
    padding: 10px 15px;
    font-size: 0.9em;
    margin-top: 10px;
    border-radius: 0 4px 4px 0;
}

.disclaimer-note {
    border-left: 5px solid #ffcc00;
    font-weight: 200;
    background: #333311;
    color: #ffffdd;
}

.disclaimer-note strong { color: #ffcc00; }

.footer-note {
    background: rgba(0, 188, 212, 0.3);
    border-left: 5px solid #0097a7;
    color: #ffffdd;
    font-weight: 200;
}

/* 9. FOOTER */
footer {
    padding-top: 10px;
    font-size: 0.9em;
    color: #888888;
    text-align: center;
}

footer a {
    color: var(--color-link);
    font-weight: 700;
    text-decoration: none;
}