:root {
    /* Light Mode Variables */
    --bg-color: #f4f6f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --card-bg: #ffffff;
    --accent-color: #2563eb;
    /* Royal Blue */
    --accent-hover: #1d4ed8;
    --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%, #f8fafc 100%);
    --badge-bg: #eff6ff;
    --badge-text: #2563eb;
    --footer-border: #cbd5e1;
}

[data-theme="dark"] {
    /* Dark Mode Variables (High Contrast) */
    --bg-color: #0f172a;
    /* Deep Navy/Black */
    --text-primary: #f8fafc;
    /* White */
    --text-secondary: #94a3b8;
    /* Light Grey */
    --card-bg: #1e293b;
    /* Dark Slate */
    --accent-color: #38bdf8;
    /* Bright Sky Blue */
    --accent-hover: #60a5fa;
    --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: #38bdf8;
    --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;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

input,
textarea {
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

/* 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);
}

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

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

/* Hero Section */
.hero {
    background: linear-gradient(-45deg, #ffffff, #f0f4ff, #e0e7ff, #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: 50px;
    position: relative;
    overflow: hidden;
}

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

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

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

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

.hero h1 {
    font-weight: 900;
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(120deg, var(--accent-color), #8b5cf6);
    -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);
}

.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;
}

.btn-primary-custom:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    color: #fff;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-out;
}

.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;
}

/* Cards */
.card-custom {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 30px;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.8s ease, border-color 0.8s ease;
    position: relative;
    z-index: 1;
}

.card-custom:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--accent-color);
}

.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 i {
    font-size: 0.9em;
}

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

.animated-gradient-card {
    background: linear-gradient(-45deg, #ffffff, #f0f4ff, #e0e7ff, #f8fafc);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

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

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

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

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

/* --- Controls --- */
.top-controls {
    position: absolute;
    top: 25px;
    right: 25px;
    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: 45px;
    height: 45px;
    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);
    font-size: 1.1rem;
}

[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;
    border-color: var(--accent-color);
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.col-md-6,
.col-md-4 {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.col-md-6:nth-child(1),
.col-md-4:nth-child(1) {
    animation-delay: 0.2s;
}

.col-md-6:nth-child(2),
.col-md-4:nth-child(2) {
    animation-delay: 0.3s;
}

.col-md-6:nth-child(3),
.col-md-4:nth-child(3) {
    animation-delay: 0.4s;
}

.col-md-6:nth-child(4),
.col-md-4:nth-child(4) {
    animation-delay: 0.5s;
}

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

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


/* Clickable Badge Animation */
.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;
    cursor: pointer;
}

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

/* 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;
    margin-right: 5px;
    border: 1px solid var(--border-color);
    display: inline-block;
    transition: all 0.2s;
}

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

/* 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);
}

/* 
 * =========================================
 *   COMMAND PALETTE STYLES
 * =========================================
 */
.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;
}

/* Scrollbar */
.cmd-body::-webkit-scrollbar {
    width: 6px;
}

.cmd-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* 
 * =========================================
 *   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;
    }
}

/* 
 * =========================================
 *   SCROLL REVEAL ANIMATIONS
 * =========================================
 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 
 * =========================================
 *   LOADING SCREEN
 * =========================================
 */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    /* Consistent with AOA Dark */
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(37, 99, 235, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 20px;
    color: #94a3b8;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 
 * =========================================
 *   SHARE SYSTEM STYLES
 * =========================================
 */
.card-footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-btn {
    background: var(--badge-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
}

.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.share-modal {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

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

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

.share-modal-header h5 {
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.share-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.share-preview {
    background: #fff;
    /* White bg for image consistency */
    border-radius: 12px;
    padding: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.share-preview img {
    width: 100%;
    border-radius: 8px;
}

.share-author-badge {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 0.9rem;
}

.share-author-badge a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

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

.share-modal-footer button {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
}

#native-share-btn {
    display: none;
}

/* 
 * =========================================
 *   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), #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    line-height: 1;
    margin-bottom: 5px;
}

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

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

.btn-secondary-custom:hover {
    background: var(--accent-color) !important;
    color: #fff !important;
    border-color: transparent !important;
}

@media (max-width: 768px) {
    .stats-container {
        gap: 20px;
    }

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

/* 
 * =========================================
 *   SCROLL HINT (AOA STYLE)
 * =========================================
 */
.scroll-hint-container {
    margin-top: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    animation: fadeInDown 1s ease 0.5s both;
}

.scroll-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    max-width: 100px;
}

.scroll-link {
    color: var(--text-secondary);
    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);
    letter-spacing: 0.5px;
}

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

@keyframes bounce {

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

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

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