@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --border: #333;
    --text-main: #e0e0e0;
    --text-dim: #a0a0a0;
    --accent: #2196f3;
    --success: #00c853;
    --error: #f44336;
    --nav-height: 60px;
}

body {
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

/* App Layout - Full Screen */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Navigation Bar */
.navbar {
    height: var(--nav-height);
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    flex-shrink: 0;
}

.brand {
    font-size: 1.3em;
    font-weight: 700;
}

.brand .highlight {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.05em;
    cursor: pointer;
    padding: 18px 0;
    font-weight: 500;
    transition: color 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
    box-shadow: 0 3px 0 var(--accent);
    /* Bottom border effect */
}

/* Main Content Area - Full Width */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    /* Center content horizontally if cards don't fill */
    align-items: flex-start;
}

.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
    width: 100%;
    max-width: 1600px;
    /* Wider constraint for large screens */
    margin: 0 auto;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    margin: 0 0 10px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 30px;
    font-weight: 300;
}

/* Cards & Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.full-height-card {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: var(--text-main);
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

/* Info Grid */
.info-grid {
    display: grid;
    gap: 15px;
}

.info-item small {
    display: block;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.topic-text {
    font-family: 'Fira Code', monospace;
    color: var(--accent);
    background: rgba(33, 150, 243, 0.1);
    padding: 5px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Controls */
.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.control-card {
    background: #252526;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 1.1em;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-action {
    padding: 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1em;
    transition: filter 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-on {
    background: #1b5e20;
    color: #a5d6a7;
    border: 1px solid #2e7d32;
}

.btn-off {
    background: #b71c1c;
    color: #ffcdd2;
    border: 1px solid #c62828;
}


.btn-action:hover {
    filter: brightness(1.2);
}

.indicator-lamp {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #424242;
    border: 2px solid #666;
    margin-left: 10px;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}


.indicator-lamp.on {
    background-color: #00e676;
    border-color: #00a854;
    box-shadow: 0 0 10px #00e676, inset 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #00e676;
    /* Default (Left/Auto) is Green */
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #ccc;
    /* Checked (Right/Manual) is Gray */
}

input:focus+.slider {
    box-shadow: 0 0 1px #ccc;
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dim);
    font-size: 0.9em;
}

.input-group input {
    width: 100%;
    padding: 14px;
    background: #121212;
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: 'Noto Sans KR', sans-serif;
}

.input-group input:focus {
    border-color: var(--accent);
    outline: none;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Noto Sans KR', sans-serif;
}

.primary-btn:hover {
    background: #1976d2;
}

/* Monitor */
.monitor-display {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    color: #a0a0a0;
    line-height: 1.5;
}

/* Console Drawer */
.console-drawer-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 100;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.console-drawer-toggle:hover {
    background: #333;
}

/* Hide toggle when drawer is open to prevent overlap */
.console-drawer.open~.console-drawer-toggle {
    transform: translateY(100px);
    /* Move out of view */
}

.console-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 350px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.console-drawer.open {
    transform: translateY(0);
}

.console-header {
    padding: 15px 25px;
    background: #252526;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    font-weight: 600;
}

.console-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    background: #121212;
}

.log-entry {
    margin-bottom: 8px;
    border-bottom: 1px solid #222;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-ts {
    color: #666;
    font-size: 0.85em;
    min-width: 80px;
}

.log-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 700;
    min-width: 100px;
    text-align: center;
    display: inline-block;
}

.log-sys {
    background: #424242;
    color: #fff;
}

.log-in {
    background: rgba(0, 200, 83, 0.2);
    color: #69f0ae;
    border: 1px solid #00c853;
}

.log-out {
    background: rgba(33, 150, 243, 0.2);
    color: #64b5f6;
    border: 1px solid #2196f3;
}

.log-login {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
    border: 1px solid #ffca28;
}

.log-msg {
    color: #e0e0e0;
    flex: 1;
}

/* Dev Guide Page */
.dev-btn {
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    padding: 8px 15px !important;
    border-radius: 4px;
}

.dev-btn:hover,
.dev-btn.active {
    background: rgba(33, 150, 243, 0.1) !important;
    box-shadow: none !important;
    border-color: var(--accent) !important;
}

/* Code Blocks & Sections */
.guide-section {
    margin-bottom: 30px;
}

.guide-section h3 {
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: none;
}

.guide-section p {
    color: #aaa;
    font-size: 0.95em;
    margin-bottom: 12px;
}

.code-block {
    background: #121212;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    border: 1px solid #333;
    color: #ce9178;
    line-height: 1.5;
    margin: 0;
}

.code-block .accent {
    color: #4fc1ff;
}

.code-block div {
    margin-bottom: 5px;
    color: #a0a0a0;
}

.code-block strong {
    color: #e0e0e0;
    min-width: 120px;
    display: inline-block;
}