@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --primary: #00ff88;
    --secondary: #00d4ff;
    --danger: #ff0000;
    --warning: #ffaa00;
    --success: #00ff88;
    --dark: #0a0e27;
    --darker: #050714;
    --light: #ffffff;
    --gray: #8892b0;
    --purple: #9c88ff;
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;

    background: linear-gradient(135deg, #0a0e27 0%, #050714 100%);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 50%;
    animation: float 15s linear infinite;
    opacity: 0.6;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 30px rgba(0, 255, 136, 0.3);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--light);
    text-decoration: none;
    position: relative;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.nav-link:hover:not(.sign-in-btn) {
    color: var(--primary);
    background: rgba(0, 255, 136, 0.1);
    transform: translateY(-2px);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #00C851 0%, #007E33 100%);
}

.toast-error {
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
}

.toast-info {
    background: linear-gradient(135deg, #33b5e5 0%, #0099cc 100%);
}

.toast-warning {
    background: linear-gradient(135deg, #ffbb33 0%, #ff8800 100%);
}

/* เพิ่มใน challenge.css */
.interactive-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

@keyframes highlight {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0, 255, 136, 0);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 40px rgba(0, 255, 136, 0.5);
    }
}

.sign-in-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary)) !important;
    color: var(--dark) !important;
    font-weight: bold !important;
    border-radius: 25px !important;
    padding: 0.8rem 1.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border: 2px solid var(--primary) !important;
    transition: all 0.3s ease !important;
    margin-left: 1rem !important;
}

.sign-in-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.4) !important;
}

.nav-user-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* avatar ปุ่มด้านขวา */
.profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid rgba(0, 255, 136, 0.6);
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    transition: all 0.25s ease;
}

.profile-pill:hover {
    background: rgba(0, 255, 136, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.4);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

.navUsername {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    color: var(--light);
    opacity: 0.9;
}


.main-content {
    margin-top: 80px;
    padding: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 10;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.5));
    }

    to {
        filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.8));
    }
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.ctf-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.category-card {
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.4);
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.category-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: bold;
}

.category-description {
    color: var(--light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--light);
    text-transform: uppercase;
}

.difficulty-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.difficulty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #ffffff;
}

.difficulty-easy {
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid var(--primary);
}

.difficulty-medium {
    background: rgba(255, 170, 0, 0.2);
    border: 1px solid var(--warning);
}

.difficulty-hard {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid var(--danger);
}

.difficulty-expert {
    background: rgba(156, 136, 255, 0.2);
    border: 1px solid var(--purple);
}

.back-btn {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.back-btn:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateX(-5px);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem;
}

.modal.active {
    display: block;
}

.modal-content {
    background: var(--dark);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    min-height: calc(100vh - 4rem);
}

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

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary);
}

.modal-title {
    font-size: 2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.close-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    /* เปลี่ยนจาก 50% เป็นมุมมน */
    padding: 0.5rem 1.5rem;
    /* เพิ่ม padding ให้กว้างขึ้น */
    width: auto;
    /* เปลี่ยนจาก 40px */
    height: auto;
    /* เปลี่ยนจาก 40px */
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10;
}

.close-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.5);
}

.close-btn:active {
    transform: translateY(0);
}

.progress-section {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s;
}

.challenge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.challenge-item {
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s;
    cursor: pointer;
}

.challenge-item:hover {
    border-color: var(--primary);
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.3);
}

.challenge-item.completed {
    border-color: var(--success);
    background: rgba(0, 255, 136, 0.05);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.challenge-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--light);
    flex: 1;
}

.challenge-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.challenge-points {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid;
}

.status-completed {
    background: var(--success);
    border-color: var(--success);
    color: var(--dark);
}

.status-not-started {
    background: transparent;
    border-color: var(--gray);
    color: var(--gray);
}

.challenge-description {
    color: var(--gray);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.challenge-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.challenge-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    max-height: 100%;
    overflow: hidden;
    background: #000;
    border: 2px solid var(--primary);
    border-radius: 10px;
    margin: 0;
    position: relative;
}

/* เพิ่ม style สำหรับ input inline */
.terminal-input-wrapper {
    display: flex;
    align-items: flex-start;
    margin-top: 0.5rem;
    font-family: 'Courier New', monospace;
    position: sticky;
    bottom: 0;
    background: inherit;
}

.hint-box {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.08), rgba(255, 170, 0, 0.12));
    border: 2px solid var(--warning);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.1);
}

.hint-btn {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.15), rgba(255, 170, 0, 0.25));
    color: var(--warning);
    border: 2px solid var(--warning);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    margin: 0.5rem 0.5rem 0.5rem 0;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.hint-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 170, 0, 0.3), transparent);
    transition: left 0.5s;
}

.hint-btn:hover::before {
    left: 100%;
}

.hint-btn:hover {
    background: linear-gradient(135deg, rgba(255, 170, 0, 0.3), rgba(255, 170, 0, 0.4));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 170, 0, 0.4);
}

.hint-content {
    display: none;
    margin: 1rem 0.5rem 1rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    line-height: 1.8;
    color: var(--light);
    box-shadow: inset 0 0 20px rgba(255, 170, 0, 0.1);
    font-size: 0.95rem;
}

.hint-content::before {
    content: '💡 ';
    font-size: 1.3em;
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 170, 0, 0.5));
}

.hint-content br {
    margin-bottom: 0.5rem;
}

.hint-content code {
    background: rgba(255, 170, 0, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    color: var(--warning);
    font-family: 'Courier New', monospace;
    font-weight: 600;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.analysis-results {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--secondary);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.9rem;
}

.cipher-box {
    background: rgba(156, 136, 255, 0.1);
    border: 2px solid var(--purple);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    font-family: monospace;
    word-break: break-all;
}

.tool-section {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.tool-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin: 0.5rem;
    transition: all 0.3s;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.flag-input {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.flag-input input {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    color: var(--light);
    font-family: monospace;
    min-width: 300px;
}

.submit-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 255, 136, 0.4);
}

.success-message {
    background: rgba(0, 255, 136, 0.2);
    border: 2px solid var(--success);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
    color: var(--success);
    display: none;
    font-weight: bold;
}

.error-message {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid var(--danger);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    color: var(--danger);
    display: none;
}

.hex-viewer {
    background: #000;
    border: 2px solid var(--purple);
    border-radius: 10px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.packet-display {
    background: #000;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    padding: 1rem;
    font-family: monospace;
    font-size: 0.85rem;
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
}

.back-challenge-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 0, 0, 0.2);
    /* เปลี่ยนเป็นสีแดง */
    color: var(--danger);
    /* เปลี่ยนเป็นสีแดง */
    border: 2px solid var(--danger);
    /* เปลี่ยนเป็นสีแดง */
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-challenge-btn:hover {
    background: var(--danger);
    /* สีแดงเข้มเมื่อ hover */
    color: white;
    /* ตัวอักษรเป็นสีขาวเมื่อ hover */
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
    /* เงาสีแดง */
}

.back-challenge-btn:active {
    transform: translateX(5px) scale(0.95);
}

/* ปรับ modal-content ให้มีที่สำหรับปุ่ม back */
.modal-content {
    position: relative;
    padding-top: 4rem;
    /* เพิ่มพื้นที่ด้านบน */
}

/* Points Deduction Animation */
@keyframes pointsDeduct {
    0% {
        transform: scale(1);
        color: var(--primary);
    }

    50% {
        transform: scale(1.2);
        color: #ff5252;
    }

    100% {
        transform: scale(1);
        color: var(--primary);
    }
}

.points-deducted {
    animation: pointsDeduct 0.5s ease;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: rgba(10, 14, 39, 0.95);
    border-radius: 8px;
    border: 2px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    color: white;
    font-weight: 500;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

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

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

.notification-warning {
    border-color: var(--warning);
}

/* ===== HINT CONFIRMATION DIALOG ===== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 7, 20, 0.85);
    /* พื้นหลังมืดสนิทขึ้น */
    backdrop-filter: blur(8px);
    /* เบลอฉากหลังให้โฟกัสที่กล่อง */
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog.modern {
    background: #0f132a;
    /* สีกรมท่าเข้ม เข้ากับธีม */
    border: 1px solid rgba(0, 255, 136, 0.2);
    /* ขอบสีเขียวจางๆ */
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 255, 136, 0.05);
    /* Glow เบาๆ */
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    padding: 0;
}

.confirm-overlay.show .confirm-dialog.modern {
    transform: scale(1) translateY(0);
}

.dialog-content {
    padding: 2rem 1.5rem 1.5rem;
}

.dialog-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.4));
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.dialog-title {
    font-size: 1.5rem;
    color: #ffffff !important;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ป้ายบอกราคา (Badge) */
.cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Badge สีส้มแดง (เสียเงิน) แบบ Friendly */
.cost-badge.warning {
    background: rgba(255, 82, 82, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 82, 82, 0.2);
}

/* Badge สีเขียว (ฟรี) */
.cost-badge.success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.dialog-desc {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.desc-warning {
    color: #ffaa00;
    /* สีส้มเตือนเบาๆ */
    font-size: 0.85rem;
    display: block;
    margin-top: 0.5rem;
}

/* ส่วนปุ่มกด */
.dialog-actions {
    display: flex;
    padding: 1.5rem;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    /* พื้นหลังปุ่มเข้มขึ้นนิดหน่อย */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ปุ่ม Cancel แบบ Ghost */
.btn-modern-cancel {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(210, 214, 227, 0.3);
    color: var(--gray);
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-modern-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--light);
    border-color: var(--light);
}

/* ปุ่ม Confirm แบบ Gradient ตาม Theme */
.btn-modern-confirm {
    flex: 1.5;
    /* ปุ่มยืนยันใหญ่กว่านิดหน่อย */
    padding: 12px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border: none;
    color: #ffffff;
    /* ตัวหนังสือสีเข้มบนพื้นสว่าง */
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-modern-confirm:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 16px rgba(180, 83, 9, 0.4);
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-modern-confirm:active {
    transform: translateY(0);
}

.confirm-dialog h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.confirm-dialog p {
    color: var(--light);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1rem;
}

/* Buttons Container */
.confirm-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    font-family: inherit;
}

.btn-cancel {
    background: transparent;
    border-color: var(--gray);
    color: var(--gray);
}

.btn-cancel:hover {
    background: rgba(136, 146, 176, 0.1);
    border-color: var(--light);
    color: var(--light);
}

.btn-confirm {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-confirm:hover {
    background: #ff0000;
    border-color: #ff0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.4);
}

/* Custom style สำหรับปุ่มยืนยันแบบฟรี (สีเขียว) */
.btn-confirm.free-hint {
    background: var(--success);
    border-color: var(--success);
}

.btn-confirm.free-hint:hover {
    background: #00ff99;
    border-color: #00ff99;
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

/* Free Hint Sparkle Effect */
.confirm-dialog div[style*="rgba(126, 231, 135"] {
    position: relative;
    overflow: hidden;
}

.confirm-dialog div[style*="rgba(126, 231, 135"]::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    animation: sparkle 1.5s infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2) rotate(180deg);
    }
}

/* SQL Interface Styles */
.sql-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.login-panel {
    background: rgba(10, 14, 39, 0.9);
    border: 2px solid var(--primary);
    border-radius: 15px;
    padding: 1.5rem;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--primary);
    margin-bottom: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: var(--light);
    font-weight: bold;
    font-size: 0.9rem;
}

.login-btn {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    border: none;
    padding: 1rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.result-panel {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    min-height: 60px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.debug-panel {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--secondary);
    border-radius: 15px;
    overflow: hidden;
}

.debug-header {
    background: var(--secondary);
    color: var(--dark);
    padding: 1rem;
    font-weight: bold;
}

.debug-content {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--light);
    max-height: 300px;
    overflow-y: auto;
}

.filter-panel {
    grid-column: 1 / -1;
    background: rgba(255, 170, 0, 0.1);
    border: 2px solid var(--warning);
    border-radius: 15px;
    overflow: hidden;
}

.filter-header {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
    padding: 1rem;
    font-weight: bold;
}

.filter-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--light);
}

.filter-item code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--danger);
}

/* ============================================
   INTERACTIVE WORKSPACE STYLING
   ============================================ */

.workspace-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.workspace-step {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.workspace-step:hover {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.step-header {
    background: rgba(0, 255, 136, 0.1);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.step-header h4 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.step-content {
    padding: 1.5rem;
}

.workspace-input {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: var(--light);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.workspace-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.workspace-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.workspace-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.workspace-btn:active {
    transform: translateY(0);
}

.workspace-output {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    min-height: 60px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--light);
}

.result-box {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    word-break: break-all;
}

.result-box:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
}

/* XOR Calculator */
.xor-calculator {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(156, 136, 255, 0.3);
}

.calc-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calc-row label {
    color: var(--gray);
    font-size: 0.9rem;
    min-width: 60px;
}

.calc-row input {
    flex: 1;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary);
    border-radius: 5px;
    color: var(--light);
    font-family: 'Courier New', monospace;
    text-align: center;
}

.calc-row span {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: bold;
}

.calc-row button {
    padding: 0.7rem 1.2rem;
    background: var(--purple);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.calc-row button:hover {
    background: var(--primary);
    color: #000;
}

.calc-result {
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    min-height: 40px;
    font-family: 'Courier New', monospace;
}

/* Prime Tester */
.prime-tester {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(156, 136, 255, 0.3);
}

/* Operation Buttons */
.operation-btn {
    background: rgba(156, 136, 255, 0.2);
    border: 1px solid var(--purple);
    color: var(--light);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.operation-btn:hover {
    background: rgba(156, 136, 255, 0.4);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Cipher Display */
.cipher-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--secondary);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem 0;
}

.cipher-display:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .workspace-container {
        gap: 1rem;
    }

    .step-content {
        padding: 1rem;
    }

    .calc-row {
        flex-wrap: wrap;
    }

    .calc-row label {
        min-width: 100%;
    }

    .operation-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.workspace-step {
    animation: slideIn 0.5s ease;
}

.workspace-step:nth-child(1) {
    animation-delay: 0s;
}

.workspace-step:nth-child(2) {
    animation-delay: 0.1s;
}

.workspace-step:nth-child(3) {
    animation-delay: 0.2s;
}

.workspace-step:nth-child(4) {
    animation-delay: 0.3s;
}

/* Success Highlight */
.workspace-output:has(strong[style*="success"]) {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* Layer History */
#layerHistory {
    line-height: 1.8;
}

#layerHistory:empty::before {
    content: '(ยังไม่มี operations)';
    color: var(--gray);
    font-style: italic;
}

/* Responsive */
@media (max-width: 968px) {
    .sql-interface {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        grid-column: 1;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .ctf-categories {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .sign-in-btn {
        margin-left: 0 !important;
    }

    .challenge-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .challenge-right {
        align-items: flex-start;
    }

    .flag-input input {
        min-width: 200px;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 480px) {
    .modal {
        padding: 0;
    }

    .modal-content {
        padding: 1rem;
        min-height: 100vh;
        border-radius: 0;
        border: none;
        border-top: 2px solid var(--primary);
    }

    .back-challenge-btn {
        top: 0.5rem;
        right: 0.5rem;
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .notification {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
}

/* ============================================
   CYBERCHEF INTERFACE STYLES
   ============================================ */

.cyberchef-container {
    display: grid;
    grid-template-columns: 220px 280px 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
    min-height: 450px;
}

@media (max-width: 1024px) {
    .cyberchef-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
}

/* Operations Panel */
.cyberchef-operations {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--primary);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.operations-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 1rem;
    color: var(--primary);
    font-weight: bold;
    border-bottom: 1px solid var(--primary);
}

.operations-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.op-category {
    margin-bottom: 1rem;
}

.op-category-header {
    color: var(--gray);
    font-size: 0.8rem;
    padding: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.op-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    margin: 0.25rem 0;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--light);
    font-size: 0.85rem;
    cursor: grab;
    transition: all 0.2s ease;
}

.op-item:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: var(--primary);
    transform: translateX(3px);
}

.op-item:active {
    cursor: grabbing;
}

.op-icon {
    font-size: 1rem;
}

/* Recipe Panel */
.cyberchef-recipe {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.recipe-header {
    background: rgba(0, 255, 136, 0.1);
    padding: 1rem;
    color: var(--secondary);
    font-weight: bold;
    border-bottom: 1px solid var(--secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-clear-btn {
    background: rgba(255, 0, 0, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.recipe-clear-btn:hover {
    background: var(--danger);
    color: white;
}

.recipe-drop-zone {
    flex: 1;
    padding: 1rem;
    min-height: 200px;
    transition: all 0.2s ease;
}

.recipe-drop-zone.drop-hover {
    background: rgba(0, 255, 136, 0.1);
}

.recipe-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    color: var(--gray);
    border: 2px dashed var(--gray);
    border-radius: 8px;
    font-size: 0.9rem;
}

.recipe-item {
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.recipe-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: rgba(0, 255, 136, 0.1);
}

.recipe-item-name {
    color: var(--light);
    font-size: 0.9rem;
}

.recipe-item-remove {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.recipe-item-remove:hover {
    background: var(--danger);
    color: white;
}

.op-params {
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
    color: var(--gray);
}

.op-param-input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gray);
    border-radius: 4px;
    color: var(--light);
    padding: 0.3rem 0.5rem;
    font-family: monospace;
    margin-left: 0.5rem;
}

.bake-btn {
    margin: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--dark);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bake-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

.bake-btn:active {
    transform: translateY(0);
}

/* Input/Output Panel */
.cyberchef-io {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.io-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gray);
    border-radius: 10px;
    overflow: hidden;
}

.io-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--gray);
    color: var(--light);
    font-weight: bold;
    font-size: 0.9rem;
}

.io-btn {
    background: rgba(0, 212, 255, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.io-btn:hover {
    background: var(--primary);
    color: var(--dark);
}

.io-textarea {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--light);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: none;
    min-height: 120px;
}

.io-textarea:focus {
    outline: none;
}

.io-textarea::placeholder {
    color: var(--gray);
}

/* Scrollbar for operations list */
.operations-list::-webkit-scrollbar {
    width: 6px;
}

.operations-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.operations-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.operations-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

.challenge-header-img {
    width: 100%;
    /* ความกว้างเต็มกรอบ */
    height: 250px;
    /* ความสูงคงที่ (ปรับแก้ได้ตามต้องการ) */
    object-fit: cover;
    /* ตัดส่วนเกินออกเพื่อไม่ให้รูปบิดเบี้ยว */
    border-radius: 10px;
    /* มุมโค้งมน */
    border: 2px solid var(--primary);
    /* ขอบสีเขียว */
    margin-bottom: 1.5rem;
    /* ระยะห่างด้านล่าง */
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
    /* เงาสวยงาม */
    display: block;
}

/* (Optional) ถ้าหน้าจอมือถือ อยากให้รูปเล็กลงหน่อย */
@media (max-width: 768px) {
    .challenge-header-img {
        height: 180px;
    }
}

/* ============================================
   ADDITIONAL STYLES FOR ENHANCED TERMINALS
   ============================================ */

/* Workspace Steps for Crypto challenges */
.workspace-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.workspace-step {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 1.5rem;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: var(--dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-header h4 {
    color: var(--light);
    margin: 0;
}

.workspace-input {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gray);
    border-radius: 6px;
    color: var(--light);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.8rem;
}

.workspace-input:focus {
    border-color: var(--primary);
    outline: none;
}

.workspace-btn {
    background: var(--secondary);
    color: var(--dark);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.workspace-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.workspace-output {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 50px;
}

/* Tool Section for Crypto/Network challenges */
.tool-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.tool-btn {
    background: var(--secondary);
    color: var(--dark);
    border: none;
    padding: 0.7rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.tool-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* Cipher Box */
.cipher-box {
    background: rgba(156, 136, 255, 0.1);
    border: 2px solid var(--purple);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

/* Enhanced Terminal Styling */
/* ============================================
   ADVANCED TERMINAL STYLING
   ============================================ */

.terminal-container {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 0;
    margin: 1.5rem 0;
    box-shadow:
        0 0 30px rgba(0, 212, 255, 0.3),
        0 0 60px rgba(0, 212, 255, 0.15),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

/* Terminal Header Bar */
.terminal-header {
    background: linear-gradient(180deg, #1e2638 0%, #161b2e 100%);
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    position: relative;
}

.terminal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 212, 255, 0.5) 50%,
            transparent 100%);
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px currentColor;
}

.terminal-dot.red {
    background: #ff5f56;
    color: #ff5f56;
}

.terminal-dot.yellow {
    background: #ffbd2e;
    color: #ffbd2e;
}

.terminal-dot.green {
    background: #27c93f;
    color: #27c93f;
}

.terminal-title {
    color: var(--light);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.terminal-stats {
    color: var(--gray);
    font-size: 0.75rem;
    font-family: monospace;
}

/* Terminal Body */
.terminal-body {
    position: relative;
}

.terminal-output {
    background: #0a0e27;
    color: #c9d1d9;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 1rem;
    height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    scroll-behavior: auto;
    overflow-anchor: none;
    overflow-y: auto;
    display: block;
    will-change: scroll-position;
    flex: 1;
    min-height: 0;

}

/* CRT Screen Effect */
.terminal-output::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(0deg,
            rgba(0, 0, 0, 0.15),
            rgba(0, 0, 0, 0.15) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
    z-index: 1;
}

/* Scanline Effect */
.terminal-output::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(0, 212, 255, 0.03) 50%,
            transparent 100%);
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* Custom Scrollbar */
.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-left: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #333;
    /* สีของตัวเลื่อน */
    border-radius: 4px;
    border: 1px solid #444;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
}

/* Terminal Input Section */
.terminal-input-section {
    background: #0d1117;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.terminal-input-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 212, 255, 0.5) 50%,
            transparent 100%);
}

.terminal-prompt {
    color: #7ee787;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(126, 231, 135, 0.5);
}

.terminal-prompt .path {
    color: #58a6ff;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #c9d1d9;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.9rem;
    outline: none;
    padding: 0.5rem;
    caret-color: var(--primary);
    text-shadow: 0 0 5px rgba(201, 209, 217, 0.3);
    min-width: 200px;
    min-height: 1.2em;
    cursor: text;
    caret-color: var(--primary);
}

.terminal-input::selection {
    background: rgba(0, 212, 255, 0.3);
    color: white;
}

/* Blinking Cursor Effect */
@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.terminal-input::after {
    content: '▊';
    color: var(--primary);
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Terminal Text Colors */
.terminal-output .cmd-success {
    color: #7ee787;
    text-shadow: 0 0 10px rgba(126, 231, 135, 0.5);
}

.terminal-output .cmd-error {
    color: #f97583;
    text-shadow: 0 0 10px rgba(249, 117, 131, 0.5);
}

.terminal-output .cmd-warning {
    color: #ffa657;
    text-shadow: 0 0 10px rgba(255, 166, 87, 0.5);
}

.terminal-output .cmd-info {
    color: #58a6ff;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.terminal-output .cmd-highlight {
    color: var(--secondary);
    font-weight: bold;
    text-shadow: 0 0 10px var(--secondary);
}

/* Directory/File Colors */
.terminal-output .file-dir {
    color: #58a6ff;
    font-weight: bold;
}

.terminal-output .file-exec {
    color: #7ee787;
    font-weight: bold;
}

.terminal-output .file-regular {
    color: #c9d1d9;
}

/* Glow Effect on Focus */
.terminal-container:focus-within {
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.4),
        0 0 80px rgba(0, 212, 255, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Loading Animation */
.terminal-loading {
    display: inline-block;
    position: relative;
    width: 10px;
    height: 10px;
}

.terminal-loading::after {
    content: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏';
    position: absolute;
    animation: loading-spinner 1s steps(10) infinite;
}

@keyframes loading-spinner {
    0% {
        content: '⠋';
    }

    10% {
        content: '⠙';
    }

    20% {
        content: '⠹';
    }

    30% {
        content: '⠸';
    }

    40% {
        content: '⠼';
    }

    50% {
        content: '⠴';
    }

    60% {
        content: '⠦';
    }

    70% {
        content: '⠧';
    }

    80% {
        content: '⠇';
    }

    90% {
        content: '⠏';
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .terminal-output {
        font-size: 0.8rem;
        height: 300px;
        padding: 1rem;
    }

    .terminal-input {
        font-size: 0.8rem;
    }

    .terminal-header {
        padding: 0.6rem 0.8rem;
    }

    .terminal-title {
        font-size: 0.75rem;
    }

    .terminal-stats {
        display: none;
    }
}

/* Accessibility */
.terminal-output:focus {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Selection */
.terminal-output::selection,
.terminal-output *::selection {
    background: rgba(0, 212, 255, 0.3);
    color: white;
}

/* ASCII Art Enhancement */
.terminal-output pre {
    margin: 0;
    font-family: inherit;
    line-height: inherit;
}

/* Command History Indicator */
.terminal-input[data-history="true"]::before {
    content: '↑';
    position: absolute;
    left: -20px;
    color: var(--gray);
    font-size: 0.8rem;
}

/* Empty State */
.terminal-output:empty::after {
    content: 'Type "help" for available commands...';
    color: var(--gray);
    font-style: italic;
    opacity: 0.6;
}


/* Login Panel for SQL Injection */
.login-panel {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.panel-header {
    background: rgba(0, 212, 255, 0.1);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 1px solid var(--primary);
}

.status-indicator {
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.login-form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    color: var(--gray);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--dark);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.4);
}

.result-panel {
    padding: 0 1.5rem 1.5rem;
}

/* Debug Panel */
.debug-panel {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gray);
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.debug-header {
    background: rgba(255, 170, 0, 0.2);
    padding: 0.8rem 1rem;
    color: var(--warning);
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray);
}

.debug-content {
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--light);
}

/* Filter Panel */
.filter-panel {
    background: rgba(255, 0, 0, 0.05);
    border: 1px solid var(--danger);
    border-radius: 8px;
    overflow: hidden;
}

.filter-header {
    background: rgba(255, 0, 0, 0.1);
    padding: 0.8rem 1rem;
    color: var(--danger);
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--danger);
}

.filter-content {
    padding: 1rem;
}

.filter-item {
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--light);
}

.filter-item code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--warning);
}

/* SQL Interface Grid */
.sql-interface {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.sql-interface .login-panel {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}

.sql-interface .debug-panel {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    margin: 0;
}

.sql-interface .filter-panel {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

@media (max-width: 768px) {
    .sql-interface {
        grid-template-columns: 1fr;
    }

    .sql-interface .login-panel,
    .sql-interface .debug-panel,
    .sql-interface .filter-panel {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Analysis Results Box */
.analysis-results {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.analysis-results h4 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1rem;
}

.analysis-results p {
    color: var(--light);
    line-height: 1.6;
}

/* ==========================================
   Auth Modal Styles
   ========================================== */
.auth-modal-content {
    max-width: 500px !important;
    min-height: auto !important;
    text-align: center;
}

.auth-modal-body {
    padding: 2rem 1rem;
}

.auth-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 136, 0.1);
    border: 2px solid var(--primary);
    border-radius: 50%;
    color: var(--primary);
}

.auth-modal-icon svg {
    width: 48px;
    height: 48px;
    stroke: var(--primary);
}

.auth-modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.auth-modal-description {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.auth-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-modal-btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    min-width: 140px;
    text-decoration: none;
    display: inline-block;
}

.auth-modal-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--dark);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.auth-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.6);
}

.auth-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.auth-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .auth-modal-content {
        padding: 1.5rem;
    }

    .auth-modal-body {
        padding: 1rem;
    }

    .auth-modal-title {
        font-size: 1.5rem;
    }

    .auth-modal-description {
        font-size: 1rem;
    }

    .auth-modal-buttons {
        flex-direction: column;
    }

    .auth-modal-btn {
        width: 100%;
    }
}

/* ==========================================
   Terminal Inline Input Styles
   ========================================== */
.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0;
    background: transparent;
}

.terminal-prompt {
    color: #7ee787;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.terminal-inline-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #c9d1d9;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    outline: none;
    padding: 0;
    margin: 0;
    caret-color: var(--primary);
    width: 100%;
}

.terminal-inline-input::placeholder {
    color: #6e7681;
    font-style: italic;
}

.terminal-inline-input:focus {
    outline: none;
    background: transparent;
}

/* Auto-scroll behavior */

.terminal-output:focus-within {
    outline: none;
}

/* --- HAMBURGER MENU STYLES (REQUIRED FOR TOGGLE) --- */

/* Hide the button on desktop */
.hamburger-menu {
    display: none;
}


#hamburgerBtn:focus,
#hamburgerBtn:active {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

@media (max-width: 768px) {

    /* 1. Ensure the Logo and Hamburger are horizontally spaced on the top line */
    .nav-container {
        display: flex;
        /* Ensure it's explicitly flex on mobile */
        flex-direction: row;
        /* Ensure items flow horizontally first */
        flex-wrap: wrap;
        /* Allows the .nav-links menu to wrap below */
        justify-content: space-between;
        /* Pushes the logo and hamburger to opposite ends */
        align-items: center;
    }

    /* 2. Show the hamburger button and ensure its styling */
    .hamburger-menu {
        display: block;
        /* Ensure the hamburger wrapper stays on the right */
        order: 2;
    }

    .logo {
        /* Ensure the logo stays on the left */
        order: 1;
    }

    #hamburgerBtn {
        /* Remove glow/outline/button styling */
        background: transparent !important;
        border: none !important;
        appearance: none;
        -webkit-appearance: none;
        outline: none !important;
        box-shadow: none !important;

        /* Size and Color */
        font-size: 2.5rem;
        color: var(--primary) !important;
        cursor: pointer;
        padding: 0.2rem 0.5rem 0.2rem 1rem !important;
    }

    /* 3. KEY: Hide the main links by default on mobile (they wrap below) */
    .nav-links {
        display: none;
        width: 100%;
        /* Forces the menu to take the full width below the logo/hamburger line */
        flex-direction: column;
        align-items: center;
        padding-top: 1rem;
        order: 3;
        /* Forces the menu to the bottom row */
    }

    /* 4. KEY: SHOW the menu ONLY when the parent container has the 'menu-active' class */
    .nav-container.menu-active .nav-links {
        display: flex;
        padding-bottom: 1rem;
    }
}

/* Commmand Injection 
/* Layout สำหรับ Command Injection แบบ Split View */
.cmd-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    height: 500px;
}

/* File System Visualizer (ด้านขวา) */
.filesystem-panel {
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid var(--primary);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fs-header {
    background: rgba(0, 255, 136, 0.1);
    padding: 0.8rem 1rem;
    color: var(--primary);
    font-weight: bold;
    border-bottom: 1px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fs-content {
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    color: var(--light);
}

/* Tree View Styling */
.fs-tree ul {
    list-style: none;
    padding-left: 1.2rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.2);
}

.fs-item {
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
    transition: all 0.2s;
}

.fs-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.fs-icon {
    width: 16px;
    text-align: center;
}

.fs-folder {
    color: #f1d592;
}

/* สีเหลืองทองสำหรับ Folder */
.fs-file {
    color: #a0a0a0;
}

.fs-flag {
    color: #ff5f56;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.fs-protected {
    opacity: 0.5;
    font-style: italic;
}

@media (max-width: 900px) {
    .cmd-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .filesystem-panel {
        height: 300px;
    }
}

/* ==========================================
/* XOR Visualizer Styles */
.xor-visualizer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--purple);
    border-radius: 15px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.xor-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    min-width: 140px;
    position: relative;
}

.xor-block-title {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.xor-value-hex {
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--light);
}

.xor-value-bin {
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--secondary);
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

.xor-operator {
    font-size: 2.5rem;
    color: var(--purple);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(156, 136, 255, 0.5);
}

.xor-equals {
    font-size: 2.5rem;
    color: var(--success);
}

/* Key Input Styling within Visualizer */
.xor-key-input {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 2rem;
    width: 80px;
    text-align: center;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
}

.xor-key-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

/* Input ที่ต้องการเน้น */
.input-highlight {
    animation: glow-border 1.5s infinite alternate;
    transition: all 0.3s ease;
}

.input-highlight:focus {
    animation: none;
    border-bottom: 2px solid #fff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.1);
}

@keyframes glow-border {
    0% {
        border-bottom-color: var(--primary);
        box-shadow: 0 5px 10px -5px var(--primary);
    }

    100% {
        border-bottom-color: var(--warning);
        box-shadow: 0 5px 20px -5px var(--warning);
    }
}

/* ทำให้ Placeholder ดูจางๆ เหมือนรอให้เติม */
.input-highlight::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* ==========================================
/* Wireshark-like Table Styles */
.wireshark-container {
    background: #ffffff;
    /* Wireshark มักพื้นหลังขาว/สว่าง */
    color: #333;
    border-radius: 5px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.85rem;
    height: 450px;
    display: flex;
    flex-direction: column;
    border: 2px solid #555;
}

.ws-toolbar {
    background: #e6e6e6;
    padding: 5px 10px;
    border-bottom: 1px solid #ccc;
    display: flex;
    gap: 10px;
}

.ws-filter-input {
    width: 100%;
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: monospace;
}

.ws-filter-input.valid {
    background: #d4ffd4;
}

/* สีเขียวอ่อนแบบ Wireshark */

.ws-table-wrapper {
    flex: 1;
    overflow-y: auto;
    background: white;
}

.ws-table {
    width: 100%;
    border-collapse: collapse;
}

.ws-table th {
    background: #e6e6e6;
    text-align: left;
    padding: 4px 8px;
    border-right: 1px solid #dcdcdc;
    border-bottom: 1px solid #ccc;
    font-weight: normal;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
}

.ws-table td {
    padding: 2px 8px;
    border-right: 1px solid #f0f0f0;
    cursor: pointer;
}

.ws-row:hover {
    background: #e3effd;
}

.ws-row.selected {
    background: #0055cc;
    color: white;
}

/* Protocol Colors (เหมือน Wireshark) */
.proto-tcp {
    background: #e4ffc7;
}

.proto-http {
    background: #e4ffc7;
}

/* สีเขียวอ่อน */
.proto-udp {
    background: #daeeff;
}

/* สีฟ้าอ่อน */
.proto-dns {
    background: #daeeff;
}

.proto-arp {
    background: #faf0d7;
}

/* สีส้มอ่อน */
.proto-error {
    background: #ffc0c0;
    color: black;
}

/* สีแดง */

/* Packet Detail Pane */
.ws-details {
    height: 150px;
    border-top: 1px solid #ccc;
    background: white;
    padding: 10px;
    overflow-y: auto;
    font-family: monospace;
    border-top: 4px solid #ccc;
    /* ตัวคั่น Pane */
}

.ws-tree-item {
    margin-left: 10px;
    color: #333;
}

.ws-tree-title {
    font-weight: bold;
    cursor: pointer;
}

.ws-highlight {
    background: yellow;
    color: black;
}

/* ==========================================
/* Forensics Tool Styles */
.forensics-container {
    display: flex;
    gap: 1.5rem;
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid var(--secondary);
    border-radius: 10px;
    padding: 1.5rem;
    flex-wrap: wrap;
}

.evidence-image-wrapper {
    flex: 1;
    min-width: 300px;
    border: 2px dashed var(--gray);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    position: relative;
}

.evidence-img {
    max-width: 100%;
    border-radius: 4px;
    display: block;
}

.metadata-panel {
    flex: 1;
    min-width: 300px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.meta-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-label {
    color: var(--gray);
    font-weight: bold;
}

.meta-value {
    color: var(--light);
    font-family: monospace;
}

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

.map-view {
    margin-top: 1rem;
    height: 200px;
    background: #e5e3df;
    /* Map color */
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    display: none;
    /* Hidden by default */
}

.map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    font-size: 2rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translate(-50%, -100%);
    }

    50% {
        transform: translate(-50%, -120%);
    }
}

/* ==========================================
/* Stego Lab Styles */
.stego-container {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1rem;
    height: 550px;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
}

.stego-term-window {
    background: var(--stego-term-bg);
    border: 1px solid #30363d;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.term-header {
    background: #21262d;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #30363d;
}

.term-dots {
    display: flex;
    gap: 6px;
    margin-right: 15px;
}

.term-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-r {
    background: #ff5f56;
}

.dot-y {
    background: #ffbd2e;
}

.dot-g {
    background: #27c93f;
}

.term-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    color: var(--stego-text);
    font-size: 0.9rem;
    scroll-behavior: smooth;
}

.term-input-line {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background: #1c2128;
    border-top: 1px solid #30363d;
}

.prompt-sign {
    color: var(--stego-success);
    margin-right: 8px;
    font-weight: bold;
}

.term-input {
    background: transparent;
    border: none;
    color: #fff;
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
}

/* Visualizer Section */
.stego-visualizer {
    background: #000;
    border: 1px solid #30363d;
    border-radius: 6px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 10px #0f0;
    animation: scan 3s linear infinite;
    z-index: 5;
    pointer-events: none;
}

@keyframes scan {
    0% {
        top: -5%;
    }

    100% {
        top: 105%;
    }
}

.file-lock-icon {
    font-size: 4rem;
    transition: all 0.5s ease;
}

.unlocked .file-lock-icon {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px var(--stego-success));
}

.metadata-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.75rem;
    color: var(--stego-accent);
    opacity: 0.7;
}

/* Hints & Tools */
.tools-panel {
    background: #161b22;
    border: 1px solid var(--primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.hint-tag {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid var(--stego-accent);
    color: var(--stego-accent);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .stego-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .stego-term-window {
        height: 350px;
    }

    .stego-visualizer {
        height: 250px;
    }
}

/* ==========================================
/ rasAttack  Styles */
/* Main Console Container */
.rsa-console {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Step Progress Bar */
.step-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    position: relative;
    padding: 0 20px;
}

.step-container::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #30363d;
    z-index: 0;
}

.step-item {
    background: #0d1117;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #8b949e;
    transition: all 0.3s;
    width: 80px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #21262d;
    border: 2px solid #30363d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
}

.step-item.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.step-item.active {
    color: #e6edf3;
    font-weight: bold;
}

.step-item.completed .step-circle {
    background: #2ea043;
    border-color: #2ea043;
    color: white;
}

.step-item.completed {
    color: #2ea043;
}

/* Signal Cards & Tuner */
.signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.signal-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.signal-card:hover {
    transform: translateY(-3px);
    border-color: #58a6ff;
}

.signal-card.captured {
    border-color: #2ea043;
    background: rgba(46, 160, 67, 0.05);
}

.signal-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s;
}

.signal-card.captured .signal-icon {
    filter: grayscale(0%);
}

/* Tuner Slider */
.tuner-container {
    margin: 15px 0;
    background: #0d1117;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #30363d;
}

.freq-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #30363d;
    outline: none;
    opacity: 0.8;
    transition: .2s;
    margin: 10px 0;
}

.freq-slider:hover {
    opacity: 1;
}

.freq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 5px var(--primary);
}

.freq-display {
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: #8b949e;
    margin-bottom: 5px;
}

.freq-display.locked {
    color: #2ea043;
    text-shadow: 0 0 5px rgba(46, 255, 100, 0.5);
    font-weight: bold;
}

/* Decoder Panel */
.decoder-panel {
    background: #000;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    overflow: hidden;
}

.decoder-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* LCD Screen */
.lcd-screen {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 4px;
    min-height: 80px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Consolas', monospace;
    color: #7ee787;
    text-shadow: 0 0 5px rgba(126, 231, 135, 0.3);
    letter-spacing: 1px;
    margin-bottom: 10px;
    transition: all 0.3s;
}

/* Controls */
.control-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
}

.param-input {
    background: #21262d;
    border: 1px solid #30363d;
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    width: 120px;
    text-align: center;
    font-size: 1.2rem;
    font-family: monospace;
    transition: border-color 0.3s;
}

.param-input:focus {
    border-color: var(--primary);
    outline: none;
}

.action-btn {
    background: linear-gradient(180deg, #238636, #2ea043);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #1b6629;
    transition: transform 0.1s, box-shadow 0.1s, opacity 0.3s;
    height: 48px;
}

.action-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

.action-btn:disabled {
    background: #30363d;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.processing {
    animation: pulse 1s infinite;
    color: var(--warning);
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* =  =========================================
/* Mobile Lab Styles */
.root-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: 550px;
    font-family: 'Consolas', monospace;
}

.source-panel,
.editor-panel {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: #161b22;
    padding: 8px 15px;
    border-bottom: 1px solid #30363d;
    font-weight: bold;
    color: #8b949e;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-view {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    color: #e6edf3;
}

.keyword {
    color: #ff7b72;
}

.type {
    color: #79c0ff;
}

.string {
    color: #a5d6ff;
}

.function {
    color: #d2a8ff;
}

.comment {
    color: #8b949e;
    font-style: italic;
}

.frida-editor {
    flex: 1;
    background: #0d1117;
    color: #e6edf3;
    border: none;
    padding: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    line-height: 1.5;
}

.frida-editor:focus {
    background: #12161c;
}

.console-output {
    height: 120px;
    background: #000;
    border-top: 1px solid #30363d;
    padding: 10px;
    color: #7ee787;
    font-size: 12px;
    overflow-y: auto;
    font-family: 'Consolas', monospace;
}

/* Fixed Layout Style */
.phone-status {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    color: #f85149;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.phone-status.unlocked {
    background: rgba(46, 160, 67, 0.1);
    border-color: #2ea043;
    color: #2ea043;
}

@media (max-width: 768px) {
    .root-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .source-panel {
        height: 300px;
    }

    .editor-panel {
        height: 400px;
    }
}