/* 
 * ================================================================
 *   Object-Oriented Programming (OOPM) Lab - Styles
 * ================================================================
 *   Author: Amey Thakur
 *   GitHub: https://github.com/Amey-Thakur
 *   Course: Object-Oriented Programming (OOPM) Lab
 *   Roll No: 50
 *   Batch: B3
 *   Date: January 17, 2020
 * ================================================================
 */

/* Ensure confetti canvas is always visible above everything */
canvas.confetti-canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    pointer-events: none !important;
}

/* 
 * =========================================
 *   THEME & BASE VARIABLES
 * =========================================
 */
:root {
    /* Light Mode Variables - Mirroring DS structurally, swapping colors */
    --bg-color: #f4f6f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --accent-color: #dc2626;
    /* Java Red */
    --accent-hover: #b91c1c;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --header-gradient: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    --badge-bg: #fef2f2;
    --badge-text: #dc2626;
    --footer-border: #cbd5e1;
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --card-bg: #1e293b;
    --accent-color: #ef4444;
    /* Brighter Red for Dark Mode */
    --accent-hover: #fca5a5;
    --border-color: #334155;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --header-gradient: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --badge-bg: #0f172a;
    --badge-text: #ef4444;
    --footer-border: #334155;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.8s ease, color 0.8s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Back to Top Button */
#btn-back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: none;
    z-index: 100;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    background: var(--accent-color);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#btn-back-to-top:hover {
    transform: translateY(-5px);
    background: var(--accent-hover);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

h5 {
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
}

.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 0 20px;
    flex: 1;
}

/* Hero Section - Exactly like DS */
.hero {
    background: linear-gradient(-45deg, #ffffff, #fff1f1, #fee2e2, #f8fafc);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite, fadeInDown 0.8s ease-out;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #450a0a);
    background-size: 400% 400%;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes bounce {

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

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

    60% {
        transform: translateY(-3px);
    }
}

.hero h1 {
    font-weight: 900;
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(120deg, var(--accent-color), #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
}

.info-badges {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.badge-pill {
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    text-decoration: none;
}

.hero-buttons .btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    margin: 10px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.btn-primary-custom {
    background: var(--accent-color);
    color: #fff;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 10px 20px -5px rgba(220, 38, 38, 0.5);
}

.btn-secondary-custom {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.section-title h3 {
    font-weight: 700;
    margin-right: 20px;
    white-space: nowrap;
}

.section-title::after {
    content: '';
    width: 100%;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
}

/* Glassmorphism Cards - Precise Mirror of DS */
.card-custom {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 30px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .card-custom {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .card-custom:hover {
    background: rgba(30, 41, 59, 0.9);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    background: var(--badge-bg);
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.card-custom:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.exp-tag {
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    display: block;
    margin-bottom: 8px;
}

.card-custom h5 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.card-custom p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.launch-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    transition: gap 0.2s;
}

.launch-link:hover {
    gap: 8px;
    color: var(--accent-hover);
}

/* Stats Counter */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(120deg, var(--accent-color), #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* High-Fidelity Featured Card Revamp: Hero Centerpiece */
.featured-card {
    background: linear-gradient(-45deg, #ffffff, #fff1f1, #fee2e2, #f8fafc) !important;
    background-size: 400% 400% !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 60px 15px !important;
    border-radius: 32px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    position: relative;
    overflow: hidden;
    gap: 0 !important;
    /* Managed by margins */
    animation: gradientBG 15s ease infinite;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.featured-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color) !important;
}

[data-theme="light"] .featured-card {
    background: linear-gradient(-45deg, #ffffff, #fff1f1, #fee2e2, #f8fafc) !important;
    background-size: 400% 400% !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .featured-card:hover {
    transform: translateY(-10px);
    border: 1px solid var(--accent-color) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .featured-card {
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a, #450a0a) !important;
    background-size: 400% 400% !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .featured-card:hover {
    transform: translateY(-10px);
    border: 1px solid var(--accent-color) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}



.laptop-column {
    width: 75%;
    max-width: none;
    margin: 0 auto 20px auto;
    perspective: 1000px;
    display: flex;
    justify-content: center;
}

.laptop-frame {
    position: relative;
    padding-bottom: 25px;
    width: 100%;
    /* Ensure it fills the column */
}

.laptop-screen {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    border-radius: 12px 12px 0 0;
    border: 6px solid #1e293b;
    border-bottom: none;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.laptop-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 12px;
    background: #1e293b;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    z-index: 10;
}

.laptop-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    animation: videoLoad 1.5s ease-out 0.8s forwards;
}

@keyframes videoLoad {
    from {
        opacity: 0;
        filter: blur(10px);
        transform: scale(1.02);
    }

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

.laptop-base {
    width: 116%;
    height: 14px;
    background: linear-gradient(to bottom, #334155, #1e293b);
    margin-left: -8%;
    border-radius: 2px 2px 12px 12px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.laptop-base::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 0 0 10px 10px;
}

.content-column {
    width: 100%;
    max-width: 800px;
}

.robot-icon {
    font-size: 3rem;
    color: var(--accent-color);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.4));
    margin-bottom: 15px;
}

.project-title {
    font-weight: 900;
    font-size: 3rem;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 30px auto;
}

/* Redesigned Badges */
.badge-custom {
    background: rgba(30, 41, 59, 0.6);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

[data-theme="light"] .badge-custom {
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Light up badges on card hover */
.featured-card:hover .badge-custom {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Action Grid Buttons */
.btn-dark-custom {
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.btn-dark-custom:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.btn-outline-custom {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-outline-custom:hover {
    background: rgba(220, 38, 38, 0.1);
    transform: translateY(-2px);
    color: #b91c1c;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

/* Light up buttons on card hover */
.featured-card:hover .btn-dark-custom {
    background: var(--accent-color);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.featured-card:hover .btn-outline-custom {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.2);
}

.btn-yellow-custom {
    background: #fde047;
    color: #1e293b;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.3);
    transition: all 0.3s;
}

.btn-yellow-custom:hover {
    background: #facc15;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(234, 179, 8, 0.4);
}

.btn-red-video {
    background: #ff0000;
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    transition: all 0.3s;
}

.btn-red-video:hover {
    background: #cc0000;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
    color: white;
}

@media (max-width: 768px) {
    .featured-card {
        padding: 30px !important;
    }

    .laptop-column {
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 30px;
    }

    .laptop-base {
        width: 110%;
        margin-left: -5%;
    }

    .project-title {
        font-size: 1.8rem;
    }
}

/* Tech Badges */
.badge-tech {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: inline-block;
    white-space: normal;
    word-break: break-word;
    transition: all 0.3s ease;
}

.badge-tech:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
}


/* --- Controls --- */
.top-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 12px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1e293b;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .control-btn {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.control-btn:hover {
    transform: translateY(-2px);
    background: var(--accent-color);
    color: white !important;
    border-color: transparent;
}

.control-btn.success {
    background: #10b981 !important;
    color: white !important;
    border-color: transparent;
}

/* 
 * =========================================
 *   RESPONSIVE DESIGN (MOBILE FIRST)
 * =========================================
 */

/* Medium Devices (Tablets, 768px and up) */
@media (max-width: 992px) {
    .main-container {
        padding: 20px 15px;
    }

    .hero h1,
    .project-title {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .logic-sidebar {
        flex: 0 0 180px;
        width: 180px;
    }
}

/* Small Devices (Landscape Phones, 576px and up) */
@media (max-width: 768px) {
    .top-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .hero {
        padding: 40px 20px;
        border-radius: 15px;
    }

    .hero h1 {
        font-size: 2rem;
        margin-top: 40px;
        /* Clear top controls */
    }

    .hero p {
        font-size: 1rem;
    }

    .stats-container {
        gap: 15px;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    /* Featured Card Stacking */
    .featured-card {
        padding: 30px 15px !important;
        border-radius: 20px !important;
    }

    .laptop-column {
        width: 100% !important;
        margin-bottom: 30px;
    }

    .laptop-base {
        width: 110% !important;
        margin-left: -5% !important;
    }

    .project-title {
        font-size: 2rem !important;
    }

    /* Logic Visualization Stacking */
    .logic-body {
        flex-direction: column !important;
    }

    .logic-sidebar {
        flex: 1 1 auto !important;
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 20px !important;
    }

    .variable-monitor {
        white-space: normal !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .hangman-anim-box {
        min-height: 200px !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Cards Grid */
    .col-md-6 {
        width: 100% !important;
        margin-bottom: 20px;
    }
}

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
        margin-top: 10px;
    }

    .top-controls {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        margin-bottom: 20px;
        width: 100%;
    }

    .info-badges {
        gap: 8px;
    }

    .badge-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .hero-buttons .btn {
        margin: 0;
        width: 100%;
    }

    .stat-item {
        flex: 0 0 45%;
    }

    .project-title {
        font-size: 1.5rem !important;
    }

    .project-description {
        font-size: 1rem;
    }

    .card-custom {
        padding: 20px;
    }

    .card-custom h5 {
        font-size: 1.2rem;
    }

    .terminal-body {
        height: 200px;
        font-size: 0.75rem;
    }

    .hangman-word {
        font-size: 1.2rem;
        letter-spacing: 5px;
    }

    .hangman-key {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

/* Fix for horizontal scroll issues */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* 
 * =========================================
 *   PRINT STYLES
 * =========================================
 */
@media print {

    .hero-buttons,
    .control-btn,
    #btn-back-to-top,
    .launch-link,
    .footer a {
        display: none !important;
    }

    body,
    .main-container,
    .card-custom,
    .featured-card {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .badge-tech,
    .badge-custom {
        border: 1px solid #000 !important;
        color: #000 !important;
    }

    .laptop-frame {
        box-shadow: none !important;
        border-color: #333 !important;
    }

    .project-title,
    h1,
    h2,
    h3,
    h5 {
        color: #000 !important;
    }
}

.card-custom:hover .badge-tech {
    background: var(--badge-bg);
    color: var(--badge-text);
    border-color: var(--badge-bg);
}

.card-custom:hover .badge-tech:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.laptop-frame {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.laptop-frame:hover {
    transform: scale(1.02) translateY(-5px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--footer-border);
    margin-top: 40px;
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--accent-color);
}


/* Animations */
@keyframes heroEntrance {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }

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

@keyframes pulseGlow {
    from {
        transform: rotate(0deg) scale(1);
    }

    to {
        transform: rotate(360deg) scale(1.1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.reveal,
.reveal-left,
.reveal-right {
    opacity: 0;
    transition: all 0.8s ease-out;
}

.reveal.active,
.reveal-left.active,
.reveal-right.active {
    opacity: 1;
    transform: translate(0, 0);
}

.reveal-left {
    transform: translateX(-50px);
}

.reveal-right {
    transform: translateX(50px);
}

.reveal {
    transform: translateY(30px);
}

/* Custom Tooltips for Badges */
.badge[data-tooltip] {
    position: relative;
    cursor: help;
}

.badge[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
    font-weight: normal;
}

.badge[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1001;
}

.badge[data-tooltip]:hover::after,
.badge[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Badge Hover Animation */
.badge[data-tooltip]:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.clickable-badge {
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    display: inline-flex;
    align-items: center;
    white-space: normal;
    cursor: pointer;
}

.clickable-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.3);
    background: var(--accent-color) !important;
    color: #fff !important;
    border-color: var(--accent-color) !important;
}


@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake-anim {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* =========================================
   HANGMAN GAME STYLES
   ========================================= */
.hangman-game-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 25px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.hangman-game {
    text-align: center;
}

.hangman-terminal {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.hangman-terminal .terminal-body {
    padding: 15px 20px;
    text-align: left;
}

.hangman-hint {
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-style: italic;
    min-height: 24px;
}

.hangman-word {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    letter-spacing: 10px;
    margin-bottom: 20px;
    color: var(--text-primary);
    min-height: 50px;
}

.hangman-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
}

.hangman-key {
    width: 36px;
    height: 36px;
    border: 2px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hangman-key:hover:not(:disabled) {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.hangman-key:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hangman-key.correct {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.hangman-key.wrong {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}


.hangman-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    color: var(--text-secondary);
}

#hangman-lives {
    color: #ef4444;
    font-weight: 600;
}

.hangman-result {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 30px;
}

.hangman-result.win {
    color: #22c55e;
}

.hangman-result.lose {
    color: #ef4444;
}

/* =========================================
   CODE TERMINAL STYLES
   ========================================= */
.code-terminal {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.terminal-header {
    background: #323232;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

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

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

.terminal-title {
    margin-left: auto;
    font-size: 0.75rem;
    color: #888;
    font-family: 'Courier New', monospace;
}

.terminal-body {
    padding: 20px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #d4d4d4;
    height: 264px;
    /* Fixed height to prevent layout shift */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.terminal-body pre {
    margin: 0;
    background: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-body code {
    background: transparent;
    color: inherit;
}

#typing-code .keyword {
    color: #c586c0;
}

#typing-code .type {
    color: #4ec9b0;
}

#typing-code .string {
    color: #ce9178;
}

#typing-code .comment {
    color: #6a9955;
}

#typing-code .function {
    color: #dcdcaa;
}

.typing-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--accent-color);
    animation: blink 1s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

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

/* =========================================
   LOGIC VISUALIZATION (LEFT CARD)
   ========================================= */

.logic-visualization {
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: none;
    margin-top: 58px;
    /* Aligns with right terminal */
}

/* Pseudocode Block (Flexible) */
.pseudocode-block {
    background: #1e1e1e;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #abb2bf;
    line-height: 1.5;
    /* Flex handled by HTML classes */
}

/* Variable Monitor */
/* Sidebar Container (Fixed Width) */
.logic-sidebar {
    flex: 0 0 220px;
    /* Rigid constraint */
    width: 220px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Variable Monitor */
.variable-monitor {
    white-space: nowrap;
    /* Prevent wrapping */
}

/* Hangman Animation */
.hangman-anim-box {
    /* Dimensions handled by parent */
}

.code-line {
    padding: 2px 5px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.code-line.active {
    background: rgba(198, 120, 221, 0.15);
    /* Purple tint */
    border-left: 2px solid #c678dd;
}

.pseudocode-block pre,
.pseudocode-block code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.pseudocode-block .kwd {
    color: #c678dd;
    font-weight: bold;
}

/* Keywords (purple) */
.pseudocode-block .func {
    color: #61afef;
}

/* Functions (blue) */
.pseudocode-block .var {
    color: #98c379;
}

/* Variables/Methods (green) */
.pseudocode-block .err {
    color: #e06c75;
}

/* Failure/Lives (red) */

/* Animated SVG Container */
.hangman-anim-box {
    background: #21252b;
    border-left: 1px solid #3e4451;
    min-width: 100px;
}

/* SVG Line Drawing Animation */
.hangman-draw-anim .draw-path {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawLine 6s infinite ease-in-out;
}

.hangman-draw-anim .base {
    animation-delay: 0s;
}

.hangman-draw-anim .pole {
    animation-delay: 1s;
}

.hangman-draw-anim .head {
    animation-delay: 2s;
    stroke-dasharray: 65;
    stroke-dashoffset: 65;
}

.hangman-draw-anim .body {
    animation-delay: 3s;
}

.hangman-draw-anim .arms {
    animation-delay: 4s;
}

.hangman-draw-anim .legs {
    animation-delay: 5s;
}

@keyframes drawLine {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    10% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    80% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    /* Hold */
    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    /* Fade out for loop */
}

/* Variable Monitor Visibility */
.variable-monitor .text-muted {
    color: #8b9bb4 !important;
    /* Lighter grey for better contrast on dark bg */
    font-family: 'Fira Code', monospace;
}

.variable-monitor .var-val {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* 
 * =========================================
 *   COMMAND PALETTE STYLES (OOPM)
 * =========================================
 */
.cmd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cmd-overlay.active {
    display: flex;
    opacity: 1;
}

.cmd-modal {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cmd-overlay.active .cmd-modal {
    transform: scale(1);
}

.cmd-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.cmd-header i {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

#cmd-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    font-family: 'Poppins', sans-serif;
}

.cmd-esc kbd {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cmd-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
}

.cmd-item {
    padding: 10px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.1s;
}

.cmd-item:hover,
.cmd-item.selected {
    background: var(--badge-bg);
    color: var(--accent-color);
}

.cmd-item-icon {
    margin-right: 12px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.cmd-item.selected .cmd-item-icon {
    color: var(--accent-color);
}

.cmd-item-text {
    flex: 1;
    font-weight: 500;
}

.cmd-item-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.cmd-footer {
    padding: 8px 16px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.cmd-keys {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.k-small {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.7rem;
    font-weight: 600;
}

/* No results message */
.algo-no-results {
    padding: 12px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   KEYBOARD HINT BADGE
   ========================================= */
.kbd-hint {
    position: fixed;
    bottom: 100px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    z-index: 999;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.3s ease;
    animation: kbdSlideIn 0.5s ease forwards;
}

.kbd-hint.hidden {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px);
}

.kbd-hint kbd {
    padding: 4px 8px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: 600;
}

@keyframes kbdSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Hide on mobile */
@media (max-width: 768px) {
    .kbd-hint {
        display: none;
    }
}

/* =========================================
   SHARE RESULTS STYLES
   ========================================= */

/* Button Styling (if not already defined) */
.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-icon-only:hover {
    background: var(--accent-color);
    color: white !important;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Share Modal Overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Share Modal Card */
.share-modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.share-modal-overlay.active .share-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.share-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-color);
}

.share-modal-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
    transition: color 0.2s;
}

.share-modal-close:hover {
    color: var(--text-primary);
}

/* Body & Preview */
.share-modal-body {
    padding: 20px;
    background: var(--bg-color);
    max-height: 70vh;
    overflow-y: auto;
}

.share-preview {
    background: #fff;
    /* Always white for consistent snapshots */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-preview canvas {
    max-width: 100%;
    height: auto !important;
}

/* Dark Mode Adjustment for Preview Container */
[data-theme="dark"] .share-preview {
    background: #1e293b;
    border: 1px solid #334155;
}

/* Author Badge */
.share-author-badge {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 0;
    border: 1px solid #334155;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    flex-wrap: wrap;
}

.share-author-badge a {
    color: #f87171;
    /* lighter red/OOPM accent */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.share-author-badge a:hover {
    color: #fca5a5;
    text-decoration: underline;
}

.share-badge-separator {
    color: #475569;
}

/* Footer */
.share-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--card-bg);
}

/* Ensure secondary buttons visible on hover (fix for white-on-white) */
.btn-secondary-custom:hover {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
}

@media (max-width: 576px) {
    .share-modal-footer {
        flex-direction: column;
    }

    .share-modal-footer .btn {
        width: 100%;
    }
}
/* 
 * =========================================
 *   SCROLL HINT HOVER EFFECT
 * =========================================
 */
.scroll-link {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.scroll-link:hover {
    color: var(--accent-color) !important;
    letter-spacing: 0.5px;
}

.scroll-link .fa-chevron-down {
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}
