/**
 * UTP Kablo & Test Laboratuvarı Stylesheet
 * Based on TST Network Simulator V2 Styles
 */

:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.95);
    --border-color: rgba(148, 163, 184, 0.2);
    --accent-color: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --purple: #8b5cf6;
    --terminal-bg: #0a0a0a;
    --terminal-text: #00ff00;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr 350px;
    height: 100vh;
    width: 100vw;
}

/* ========== SIDEBAR (Malzemeler) ========== */
.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow-y: auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-area i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.logo-area h1 {
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--accent-color), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tool-category h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.8rem;
}

.tool-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.tool-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: grab;
    transition: all 0.2s;
}

.tool-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-color);
}

.tool-item i {
    font-size: 1.5rem;
    color: var(--accent-color);
    width: 30px;
    text-align: center;
}

.tool-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.tool-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== MAIN CONTENT (Tezgah) ========== */
.main-content {
    position: relative;
    background-color: #1e293b;
    /* Dot pattern */
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stage-title {
    position: absolute;
    top: 20px;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-weight: 600;
    backdrop-filter: blur(5px);
    z-index: 10;
}

/* SCENE LAYERS */
.scene {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
    padding: 2rem;
    overflow-y: auto;
}

.scene.active {
    display: flex;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* STORY MODE */
.story-container {
    max-width: 800px;
    background: rgba(15, 23, 42, 0.95);
    padding: 3rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
    line-height: 1.8;
}

.story-container h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.story-container h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

.story-text {
    font-size: 1rem;
    margin-bottom: 2rem;
}

.highlight {
    color: var(--warning);
    font-weight: bold;
}

/* VERTICAL CABLE (Stripping) */
.cable-vertical {
    width: 60px;
    height: 400px;
    background: linear-gradient(to right, #64748b, #94a3b8, #64748b);
    border-radius: 30px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 50px;
    transition: all 0.5s;
}

.cable-vertical::before {
    content: 'UTP CAT6';
    position: absolute;
    transform: rotate(-90deg);
    color: rgba(255, 255, 255, 0.3);
    font-weight: bold;
    top: 50%;
    left: -20px;
    font-size: 1.5rem;
    width: 200px;
}

.stripped-vertical {
    position: absolute;
    top: -50px;
    left: 10px;
    width: 40px;
    height: 100px;
    /* Emerges from top */
    display: flex;
    justify-content: space-around;
    z-index: -1;
    transition: top 1s;
}

.wire-strand-v {
    width: 6px;
    height: 100%;
    border-radius: 3px;
}

/* IN-GAME NOTIFICATION (Toast) */
#toast-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    width: 80%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-msg {
    background: rgba(15, 23, 42, 0.95);
    border-left: 5px solid var(--accent-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s forwards;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.toast-msg.success {
    border-color: var(--success);
}

.toast-msg.error {
    border-color: var(--danger);
}

.toast-msg i {
    font-size: 1.5rem;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

/* DRAGGABLE TOOLS */
.tool-visual {
    position: absolute;
    z-index: 100;
    cursor: grab;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s;
}

.tool-visual:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Ping Animation */
.packet {
    fill: var(--success);
    animation: pingTravel 1s infinite linear;
    opacity: 0;
}

.packet.fail {
    fill: var(--danger);
}

@keyframes pingTravel {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateX(200px);
        opacity: 0;
    }
}

/* --- CSS ART: CABLE & WIRES --- */
.cable-large {
    width: 300px;
    height: 40px;
    background: linear-gradient(to bottom, #94a3b8, #64748b, #94a3b8);
    border-radius: 20px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.stripped-section {
    position: absolute;
    right: -50px;
    top: 5px;
    height: 30px;
    display: flex;
    gap: 2px;
}

.wire-strand {
    width: 4px;
    height: 100%;
    border-radius: 2px;
}

/* Sorting Area */
.sorting-bench {
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px dashed var(--text-secondary);
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
    min-height: 180px;
}

.sort-slot {
    width: 40px;
    height: 160px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.single-wire {
    width: 30px;
    height: 140px;
    border-radius: 15px;
    margin: 10px auto;
    cursor: grab;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    position: relative;
}

/* Wire Colors */
.w-orange {
    background: #f97316;
}

.w-orange-white {
    background: repeating-linear-gradient(45deg, #f97316, #f97316 5px, white 5px, white 10px);
}

.w-green {
    background: #22c55e;
}

.w-green-white {
    background: repeating-linear-gradient(45deg, #22c55e, #22c55e 5px, white 5px, white 10px);
}

.w-blue {
    background: #3b82f6;
}

.w-blue-white {
    background: repeating-linear-gradient(45deg, #3b82f6, #3b82f6 5px, white 5px, white 10px);
}

.w-brown {
    background: #78350f;
}

.w-brown-white {
    background: repeating-linear-gradient(45deg, #78350f, #78350f 5px, white 5px, white 10px);
}

/* --- TOOLS CSS ART --- */
.stripper-tool {
    width: 120px;
    height: 120px;
    background: #eab308;
    border-radius: 10px;
    border: 4px solid #111;
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    font-weight: bold;
    cursor: grab;
    z-index: 20;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.crimper-tool {
    width: 150px;
    height: 200px;
    background: #3b82f6;
    clip-path: polygon(20% 0%, 80% 0%, 100% 30%, 80% 100%, 20% 100%, 0% 30%);
    position: absolute;
    top: 100px;
    transition: transform 0.2s;
    cursor: pointer;
}

/* RJ45 Connector */
.connector-visual {
    width: 80px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 5px;
    position: relative;
}

.connector-pins {
    position: absolute;
    bottom: 5px;
    left: 5px;
    right: 5px;
    height: 10px;
    background: repeating-linear-gradient(90deg, #ffd700, #ffd700 2px, transparent 2px, transparent 8px);
}


/* ========== RIGHT PANEL (Rehber & Terminal) ========== */
.right-panel {
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.tab.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.panel-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.instruction-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--accent-color);
}

.instruction-card h4 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.instruction-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #ccc;
}

.t568b-guide {
    margin-top: 1rem;
    text-align: center;
}

.t568b-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Terminal */
.terminal-container {
    background: var(--terminal-bg);
    border: 1px solid #333;
    border-radius: 6px;
    height: 300px;
    padding: 10px;
    font-family: var(--font-mono);
    color: var(--terminal-text);
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
}

.term-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.term-input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-family: inherit;
}

/* PC Scenario CSS */
.pc-setup {
    display: flex;
    gap: 50px;
    align-items: center;
}

.pc-device {
    width: 120px;
    height: 100px;
    background: #334155;
    border: 2px solid #64748b;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.pc-device:hover {
    border-color: var(--accent-color);
}

.pc-screen {
    width: 80%;
    height: 60%;
    background: #0f172a;
    border-radius: 4px;
    margin-bottom: 5px;
}

.port-area {
    width: 20px;
    height: 10px;
    background: #000;
    margin-top: 5px;
    border: 1px solid #444;
}

.port-area.connected {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    border-color: var(--success);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-box {
    background: #1e293b;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 500px;
}

.modal-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    margin-top: 1.5rem;
    cursor: pointer;
    font-size: 1rem;
}