/* =========================================================
   1. Global Reset / Base
========================================================= */

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;

    background: #0f172a;
    color: #e2e8f0;
}

:root {

    /* Colors */
    --bg-main: #0f172a;
    --bg-card: #0d1117;
    --bg-soft: #161b22;

    --border: #30363d;

    --text-main: #e2e8f0;
    --text-soft: #94a3b8;

    --blue: #2563eb;
    --blue-light: #3b82f6;

    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;

    /* Spacing */
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    /* Shadows */
    --shadow-soft:
        0 0 10px rgba(0,0,0,0.15);

    --shadow-blue:
        0 0 16px rgba(59,130,246,0.15);
}

main {
    flex: 1;
    padding: 20px;
}

/* =========================================================
   2. Utility Classes
========================================================= */

.tab-section {
    animation: fadeIn 0.25s ease;
}

.hidden {
    display: none;
}

.safe {
    color: #22c55e;
}

/* =========================================================
   3. Header / Footer
========================================================= */

header {
    text-align: center;
    padding: 20px;
    background: #020617;
}

footer {
    margin-top: 20px;
    padding: 15px;
    text-align: center;
    background: #1e293b;
}

/* =========================================================
   4. Main Layout
========================================================= */

.app-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.lab-intro,
.tester-notes {
    margin-top: 20px;
    max-width: 1200px;
}

/* =========================================================
   5. Sidebar Navigation
========================================================= */

.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 20px;

    display: flex;
    flex-direction: column;
    gap: 12px;

    height: fit-content;

    position: sticky;
    top: 20px;
}

.sidebar h2 {
    margin: 0 0 10px 0;

    font-size: 1.1rem;

    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 14px;

    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;

    color: #c9d1d9;
    font-size: 0.95rem;

    text-align: left;

    cursor: pointer;

    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #1f2937;
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    border-color: #3b82f6;

    color: white;

    box-shadow:
    0 0 12px rgba(37, 99, 235, 0.35);
}


/* =========================================================
   6. Topbar
========================================================= */

.topbar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 20px;
}

.topbar h2 {
    margin-bottom: 5px;
    font-size: 2.2rem;
    font-weight: 700;
}

/* =========================================================
   7. Generic Sections
========================================================= */

.lab-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;

    padding: 18px;
    margin-bottom: 20px;

    transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;

    box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.25);
}

.lab-section h2 {
    margin-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 600;
}

.primary-panel {
    border: 1px solid #3b82f6;

    box-shadow:
        0 0 12px rgba(59, 130, 246, 0.15);
}

.note,
.scanner-status,
.placeholder {
    font-size: 0.9rem;
}

.topbar p,
header p,
.note,
.placeholder {
    color: var(--text-soft);
}

.lab-section:hover {
    transform: translateY(-2px);

    border-color: #3b82f6;

    box-shadow: var(--shadow-soft);

    box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.35);
}

/* ====================================
   Threat Themes
==================================== */

/* XSS */
.threat-xss {
    border-color: rgba(239, 68, 68, 0.35);
}

.threat-xss:hover {
    box-shadow:
        0 8px 22px rgba(239, 68, 68, 0.15);
}

.threat-xss h2 {
    color: #f87171;
}

/* Redirect */
.threat-redirect {
    border-color: rgba(234, 179, 8, 0.35);
}

.threat-redirect:hover {
    box-shadow:
        0 8px 22px rgba(234, 179, 8, 0.12);
}

.threat-redirect h2 {
    color: #facc15;
}

/* Clickjacking */
.threat-clickjack {
    border-color: rgba(168, 85, 247, 0.35);
}

.threat-clickjack:hover {
    box-shadow:
        0 8px 22px rgba(168, 85, 247, 0.14);
}

.threat-clickjack h2 {
    color: #c084fc;
}

/* Scanner */
.threat-scanner {
    border-color: rgba(59, 130, 246, 0.35);
}

.threat-scanner:hover {
    box-shadow:
        0 8px 22px rgba(59, 130, 246, 0.15);
}

.threat-scanner h2 {
    color: #60a5fa;
}

/* =========================================================
   8. Forms / Inputs
========================================================= */

input,
textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px;

    background: #0f172a;
    color: #e2e8f0;

    border: 1px solid #334155;
    border-radius: 8px;

    transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

input:focus {
    border-color: #3b82f6;

    box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
    min-height: 120px;

    margin-top: 10px;

    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: #3b82f6;

    box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* =========================================================
   9. Buttons
========================================================= */

button {
    padding: 10px 14px;

    background: var(--bg-soft);
    color: #e2e8f0;

    border: 1px solid var(--border);
    border-radius: 6px;

    cursor: pointer;

    transition: 0.2s ease;
}

button:hover {
    background: #1f2937;

    border-color: #475569;

    transform: translateY(-1px);

    box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.25);
}

button:active {
    transform: scale(0.98);
}

.button-group {
    display: flex;
    gap: 10px;

    margin-top: 12px;

    flex-wrap: wrap;
}

/* =========================================================
   10. Panels
========================================================= */

.panel {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;

    padding: 14px;
    margin-top: 12px;
    transition: border-color 0.2s ease;
}

.panel:hover {
    border-color: #475569;
}

.panel label {
    display: block;

    margin-bottom: 5px;

    font-size: 0.8rem;
    color: #8b949e;
}

.output {
    min-height: 60px;
}

.info {
    font-size: 0.9rem;
    color: #9ecbff;
}

#comments,
#safeComments {
    margin-top: 10px;
}

/* =========================================================
   11. Tool Bar
========================================================= */

.tool-bar {
    display: flex;
    gap: 10px;

    margin-bottom: 10px;

    flex-wrap: wrap;
}

.tool-bar select,
.tool-bar button {
    background: var(--bg-soft);
    color: #c9d1d9;

    border: 1px solid var(--border);
    border-radius: 4px;

    padding: 6px 10px;
}

/* =========================================================
   12. Payload Library
========================================================= */

.payload-library {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-bottom: 15px;
}

.payload-card {
    background: var(--bg-soft);

    border: 1px solid var(--border);
    border-radius: 8px;

    padding: 12px;
}

.payload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payload-header h3 {
    margin: 0;
    font-size: 1rem;
}

.payload-card p {
    font-size: 0.9rem;
    color: var(--text-soft);
}

.load-payload-btn {
    width: 100%;
    margin-top: 10px;
}

/* =========================================================
   13. Severity Badges
========================================================= */

.severity-badge {
    padding: 4px 8px;

    border-radius: 20px;

    font-size: 0.75rem;
    font-weight: bold;
}

.severity-badge.high {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.severity-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

/* =========================================================
   14. Clickjacking Demo
========================================================= */

.clickjack-container {
    position: relative;

    width: 250px;

    margin-top: 10px;
}

.fake-btn {
    width: 100%;

    padding: 10px;

    background: #22c55e;
    color: black;

    border: none;
    border-radius: 6px;

    cursor: pointer;

    position: relative;
    z-index: 2;
}

.real-btn {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    opacity: 0;

    z-index: 3;

    cursor: pointer;

    color: transparent;
    background: transparent;
    border: none;
}

.real-btn:hover {
    background: transparent;
    border-color: transparent;
    opacity: 0;
}

.safe-clickjack button {
    width: 250px;

    background: #3b82f6;
    color: white;

    border: none;
}

/* =========================================================
   15. Scanner / Detection Engine
========================================================= */

.scanner-results {
    margin-top: 15px;
}

.scanner-status {
    margin-bottom: 10px;
}

.scan-card {
    background: #1a1a1a;

    border-radius: 6px;

    padding: 10px;
    margin-bottom: 10px;
}

.scan-card.high {
    border-left: 4px solid red;
}

.scan-card.medium {
    border-left: 4px solid orange;
}

.scan-header {
    display: flex;
    justify-content: space-between;

    font-weight: bold;
}

/* =========================================================
   16. Scan History
========================================================= */

.scan-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-card {
    background: var(--bg-soft);

    border: 1px solid var(--border);
    border-left: 4px solid #475569;

    border-radius: 6px;

    padding: 10px;
}

.history-card.high {
    border-left-color: #ef4444;
}

.history-card.medium {
    border-left-color: #eab308;
}

.history-header {
    display: flex;
    justify-content: space-between;

    font-size: 0.9rem;
}

/* =========================================================
   17. XSS Analysis Text
========================================================= */

#xssExplanation {
    margin-top: 8px;

    font-size: 0.9rem;
    color: #aaa;
}

/* ====================================
   18. Animations
==================================== */

@keyframes fadeIn {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* =========================================================
   19. Responsive Design
========================================================= */

@media (max-width: 900px) {

    .app-layout {
        grid-template-columns: 1fr;
    }

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        order: -1;
    }

    .tool-bar {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }
}