/* ── Jonnai Custom Theme ── */

:root {
    --jn-bg: #1a1a2e;
    --jn-card: #16213e;
    --jn-accent: #0f3460;
    --jn-highlight: #e94560;
    --jn-highlight-glow: rgba(233, 69, 96, 0.4);
    --jn-text: #e0e0e0;
    --jn-dim: #8a8a9a;
    --jn-border: #2a2a4a;
    --jn-glass: rgba(22, 33, 62, 0.7);
    --discord-blurple: #5865F2;
    --discord-dark: #2b2d31;
    --discord-darker: #1e1f22;
    --discord-embed: #2b2d31;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--jn-bg);
    color: var(--jn-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ── Scroll Animations ── */

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ── Navbar ── */

.jn-navbar {
    background: rgba(22, 33, 62, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--jn-border);
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.jn-navbar.scrolled {
    background: rgba(22, 33, 62, 0.97);
}

.jn-navbar .navbar-brand img {
    border-radius: 50%;
}

.btn-discord {
    background: var(--discord-blurple);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-discord:hover {
    background: #4752c4;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

/* ── Hero Section ── */

.jn-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding-top: 60px;
}

.jn-hero .hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('/static/images/jonnai_face.jpg');
    background-size: cover;
    background-position: center top;
    filter: brightness(0.5) contrast(1.2);
    z-index: 0;
}

.jn-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(26, 26, 46, 0.6) 0%,
        rgba(26, 26, 46, 0.75) 50%,
        rgba(26, 26, 46, 0.97) 100%
    );
    z-index: 1;
}

.jn-hero .hero-content {
    position: relative;
    z-index: 3;
}

.jn-hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, var(--jn-highlight) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.jn-hero .tagline {
    font-size: 1.3rem;
    color: var(--jn-dim);
    margin-bottom: 2.5rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.btn-cta {
    background: var(--jn-highlight);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 1rem 3rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 20px var(--jn-highlight-glow);
}

.btn-cta:hover {
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--jn-highlight-glow);
}

.btn-cta-outline {
    background: transparent;
    color: var(--jn-text);
    border: 2px solid var(--jn-border);
    border-radius: 10px;
    padding: 0.9rem 2.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-cta-outline:hover {
    color: white;
    border-color: var(--jn-highlight);
    background: rgba(233, 69, 96, 0.1);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: bounce 2s ease infinite;
}

.scroll-indicator i {
    color: var(--jn-dim);
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ── Floating Particles ── */

.particles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatUp linear infinite;
}

.particle:nth-child(1) {
    width: 6px; height: 6px;
    background: var(--jn-highlight);
    left: 10%; bottom: -10%;
    animation-duration: 12s;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 4px; height: 4px;
    background: var(--discord-blurple);
    left: 25%; bottom: -10%;
    animation-duration: 15s;
    animation-delay: 2s;
}

.particle:nth-child(3) {
    width: 8px; height: 8px;
    background: rgba(233, 69, 96, 0.6);
    left: 45%; bottom: -10%;
    animation-duration: 10s;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    width: 3px; height: 3px;
    background: rgba(255, 255, 255, 0.5);
    left: 60%; bottom: -10%;
    animation-duration: 14s;
    animation-delay: 1s;
}

.particle:nth-child(5) {
    width: 5px; height: 5px;
    background: var(--jn-highlight);
    left: 75%; bottom: -10%;
    animation-duration: 11s;
    animation-delay: 3s;
}

.particle:nth-child(6) {
    width: 4px; height: 4px;
    background: var(--discord-blurple);
    left: 88%; bottom: -10%;
    animation-duration: 13s;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    width: 7px; height: 7px;
    background: rgba(233, 69, 96, 0.4);
    left: 35%; bottom: -10%;
    animation-duration: 16s;
    animation-delay: 6s;
}

.particle:nth-child(8) {
    width: 3px; height: 3px;
    background: rgba(255, 255, 255, 0.3);
    left: 55%; bottom: -10%;
    animation-duration: 9s;
    animation-delay: 7s;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-110vh) translateX(30px);
        opacity: 0;
    }
}

/* ── Stats Bar ── */

.jn-stats {
    position: relative;
    padding: 3rem 0;
    overflow: hidden;
}

.jn-stats .stats-bg {
    position: absolute;
    inset: 0;
    background-image: url('/static/images/avbanner.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: brightness(0.3);
    z-index: 0;
}

.jn-stats .stats-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 46, 0.85);
    z-index: 1;
}

.jn-stats .container {
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-item .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--jn-highlight);
    text-shadow: 0 0 20px var(--jn-highlight-glow);
}

.stat-item .stat-label {
    color: var(--jn-dim);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0.25rem;
}

/* ── Feature Showcase ── */

.jn-showcase {
    padding: 5rem 0;
}

.showcase-row {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 5rem;
}

.showcase-row:last-child {
    margin-bottom: 0;
}

.showcase-row.reverse {
    flex-direction: row-reverse;
}

.showcase-image {
    flex: 1;
    max-width: 450px;
}

.showcase-image img {
    width: 100%;
    border-radius: 16px;
    border: 1px solid var(--jn-border);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(233, 69, 96, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.showcase-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(233, 69, 96, 0.2);
}

.showcase-text {
    flex: 1;
}

.showcase-text .showcase-label {
    display: inline-block;
    color: var(--jn-highlight);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    padding: 0.3rem 0.8rem;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(233, 69, 96, 0.2);
}

.showcase-text h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.showcase-text p {
    color: var(--jn-dim);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.showcase-text .feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature-pill {
    background: var(--jn-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--jn-border);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--jn-text);
}

/* ── Capabilities Grid ── */

.jn-capabilities {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--jn-bg) 0%, rgba(15, 52, 96, 0.15) 50%, var(--jn-bg) 100%);
}

.jn-capabilities h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.jn-capabilities .section-subtitle {
    text-align: center;
    color: var(--jn-dim);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.feature-card {
    background: var(--jn-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--jn-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, var(--jn-highlight) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: 200% 200%;
    animation: gradientRotate 3s linear infinite;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(233, 69, 96, 0.15);
}

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

.feature-card .feature-icon {
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background: rgba(233, 69, 96, 0.1);
    color: var(--jn-highlight);
    font-size: 1.5rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.15);
    transition: box-shadow 0.3s ease;
}

.feature-card:hover .feature-icon {
    box-shadow: 0 0 30px rgba(233, 69, 96, 0.3);
}

.feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--jn-dim);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ── Discord Preview ── */

.jn-discord-preview {
    padding: 5rem 0;
}

.jn-discord-preview h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.jn-discord-preview .section-subtitle {
    text-align: center;
    color: var(--jn-dim);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.discord-mockup {
    background: var(--discord-darker);
    border-radius: 12px;
    max-width: 700px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.discord-header {
    background: var(--discord-dark);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.discord-header .channel-hash {
    color: var(--jn-dim);
    font-size: 1.2rem;
}

.discord-header .channel-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.discord-messages {
    padding: 1rem;
}

.discord-msg {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.discord-msg + .discord-msg {
    margin-top: 0.75rem;
}

.discord-msg .msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.discord-msg .msg-body {
    flex: 1;
}

.discord-msg .msg-author {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.discord-msg .msg-author.bot {
    color: var(--jn-highlight);
}

.discord-msg .msg-author.user {
    color: #57F287;
}

.discord-msg .msg-author .bot-badge {
    display: inline-block;
    background: var(--discord-blurple);
    color: white;
    font-size: 0.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: 600;
    vertical-align: middle;
    text-transform: uppercase;
}

.discord-msg .msg-time {
    color: var(--jn-dim);
    font-size: 0.7rem;
    margin-left: 0.5rem;
}

.discord-msg .msg-text {
    color: #dbdee1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.discord-msg .msg-embed {
    margin-top: 0.5rem;
    background: var(--discord-embed);
    border-left: 4px solid var(--jn-highlight);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    max-width: 500px;
}

.discord-msg .msg-embed .embed-title {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.discord-msg .msg-embed .embed-desc {
    color: #b5bac1;
    font-size: 0.85rem;
    line-height: 1.5;
}

.discord-msg .msg-reactions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.discord-msg .msg-reaction {
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    color: var(--jn-dim);
}

/* ── Commands Section ── */

.jn-commands {
    padding: 5rem 0;
    background: var(--jn-glass);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--jn-border);
    border-bottom: 1px solid var(--jn-border);
}

.jn-commands h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.jn-commands .section-subtitle {
    text-align: center;
    color: var(--jn-dim);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.command-search {
    background: var(--jn-bg);
    border: 1px solid var(--jn-border);
    color: var(--jn-text);
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 2.5rem;
    display: block;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.command-search:focus {
    outline: none;
    border-color: var(--jn-highlight);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.command-search::placeholder {
    color: var(--jn-dim);
}

.command-category {
    margin-bottom: 2rem;
}

.command-category h4 {
    color: var(--jn-highlight);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--jn-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.command-category h4::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jn-highlight);
    box-shadow: 0 0 8px var(--jn-highlight-glow);
}

.command-item {
    display: inline-block;
    background: var(--jn-bg);
    border: 1px solid var(--jn-border);
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    margin: 0.25rem;
    font-size: 0.85rem;
    font-family: 'Consolas', 'Courier New', monospace;
    color: var(--jn-text);
    transition: all 0.2s ease;
}

.command-item:hover {
    border-color: var(--jn-highlight);
    background: rgba(233, 69, 96, 0.05);
    box-shadow: 0 2px 10px rgba(233, 69, 96, 0.1);
}

.command-item .cmd-prefix {
    color: var(--jn-highlight);
}

/* ── Dashboard ── */

.jn-dashboard {
    padding: 2rem 0;
    padding-top: 5rem;
    flex: 1;
}

.guild-card {
    background: var(--jn-card);
    border: 1px solid var(--jn-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.guild-card:hover {
    transform: translateY(-4px);
    border-color: var(--jn-highlight);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.1);
}

.guild-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 2px solid var(--jn-border);
}

.guild-card h5 {
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.guild-card .member-count {
    color: var(--jn-dim);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ── Server Config ── */

.config-section {
    background: var(--jn-card);
    border: 1px solid var(--jn-border);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.config-section h4 {
    color: var(--jn-highlight);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--jn-border);
}

.config-section textarea,
.config-section input[type="text"] {
    background: var(--jn-bg);
    border: 1px solid var(--jn-border);
    color: var(--jn-text);
    border-radius: 8px;
}

.config-section textarea:focus,
.config-section input[type="text"]:focus {
    border-color: var(--jn-highlight);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
    background: var(--jn-bg);
    color: var(--jn-text);
}

.config-badge {
    display: inline-block;
    background: var(--jn-accent);
    color: var(--jn-text);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    font-size: 0.8rem;
    margin: 0.15rem;
}

.config-badge.danger {
    background: rgba(233, 69, 96, 0.15);
    color: var(--jn-highlight);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

/* ── Nav Tabs for Dashboard ── */

.nav-tabs.jn-tabs {
    border-bottom: 1px solid var(--jn-border);
    margin-bottom: 1.5rem;
}

.nav-tabs.jn-tabs .nav-link {
    color: var(--jn-dim);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px 8px 0 0;
    transition: color 0.2s;
}

.nav-tabs.jn-tabs .nav-link:hover {
    color: var(--jn-text);
    border-color: transparent;
}

.nav-tabs.jn-tabs .nav-link.active {
    background: var(--jn-card);
    color: var(--jn-highlight);
    border: 1px solid var(--jn-border);
    border-bottom-color: var(--jn-card);
}

/* ── User list ── */

.user-list {
    max-height: 400px;
    overflow-y: auto;
}

.user-list-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--jn-border);
    transition: background 0.2s;
}

.user-list-item:hover {
    background: rgba(233, 69, 96, 0.05);
}

.user-list-item a {
    color: var(--jn-text);
    text-decoration: none;
}

.user-list-item a:hover {
    color: var(--jn-highlight);
}

/* ── Footer ── */

.jn-footer {
    background: var(--jn-card);
    border-top: 1px solid var(--jn-border);
    padding: 2.5rem 0;
    margin-top: auto;
}

.jn-footer a {
    text-decoration: none;
    transition: color 0.2s;
}

.jn-footer a:hover {
    color: var(--jn-highlight) !important;
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--jn-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--jn-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--jn-accent);
}

/* ── Responsive ── */

@media (max-width: 992px) {
    .showcase-row,
    .showcase-row.reverse {
        flex-direction: column;
        text-align: center;
    }
    .showcase-image {
        max-width: 350px;
        margin: 0 auto;
    }
    .showcase-text .feature-pills {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .jn-hero h1 { font-size: 2.75rem; }
    .jn-hero .tagline { font-size: 1.1rem; }
    .jn-showcase { padding: 3rem 0; }
    .showcase-row { margin-bottom: 3rem; gap: 2rem; }
    .showcase-text h3 { font-size: 1.5rem; }
    .jn-capabilities { padding: 3rem 0; }
    .jn-commands { padding: 3rem 0; }
    .stat-item .stat-number { font-size: 2rem; }
}

@media (max-width: 375px) {
    .jn-hero h1 { font-size: 2rem; }
    .jn-hero .tagline { font-size: 0.95rem; }
    .btn-cta { padding: 0.75rem 2rem; font-size: 1rem; }
}
