/*
Theme Name: Cyber AI
Theme URI: https://wordpress.org/themes/cyber-ai/
Author: Antigravity
Description: A hybrid theme combining Digital Agency structures with Cyber/AI aesthetics.
Version: 1.1 (Hybrid V3)
*/

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    /* --- COLOR PALETTE (Cyber AI Original) --- */
    --bg-dark: #0d0d0d;
    /* Deepest Black */

    /* Glassmorphism Backgrounds */
    --bg-card: rgba(20, 20, 20, 0.7);
    /* Semi-transparent dark */
    --bg-header: rgba(13, 13, 13, 0.8);
    /* Semi-transparent header */
    --glass-blur: blur(10px);
    /* Standard blur amount */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);

    --text-main: #ffffff;
    /* Pure White */
    --text-muted: #b0b0b0;
    /* Light Gray */

    --border-color: #333333;
    /* Fallback border */

    /* Accents (Original Cyber AI Neons) */
    --accent-primary: #00f3ff;
    /* Cyber Cyan (Primary) */
    --accent-cyan: #00f3ff;
    /* Alias */
    --accent-purple: #bc13fe;
    /* Neon Purple */
    --accent-green: #0aff0a;
    /* Neon Green */
    --accent-warning: #ff003c;
    /* Cyber Red/Pink for warnings */

    /* Digital Agency Accents (Mapped to Cyber) */
    --accent-success: var(--accent-green);

    /* Cyber AI Variables (Legacy Support) */
    --cyber-blue: var(--accent-cyan);
    --cyber-purple: var(--accent-purple);
    --cyber-green: var(--accent-green);
    --white: #ffffff;

    /* Spacing & Sizes */
    --max-width: 1080px;
    --spacing-unit: 8px;
    --font-base: 'Noto Sans JP', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
}

/* --- BASE STYLES --- */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-base);
    line-height: 1.6;
    margin: 0;
    /* Cyber Grid Background */
    background-image:
        linear-gradient(rgba(0, 20, 30, 0.8), rgba(0, 10, 20, 0.9)),
        url('images/bg.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-cyan);
    text-decoration: underline;
}

/* --- STRUCTURE (Digital Agency Layout) --- */
.main-container {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

.content-area {
    flex: 3;
}

.sidebar {
    flex: 1;
}

/* --- HEADER (Glass) --- */
.header {
    background-color: var(--bg-header);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    /* Cyan border hint */
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.ai-badge {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.site-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0 1rem;
    border-left: 1px solid var(--border-color);
    padding-left: 1rem;
}

/* --- NAVIGATION (Cyber) --- */
.nav ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav a {
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    text-shadow: 0 0 8px var(--accent-cyan);
}

/* Desktop Dropdowns */
.nav ul li {
    position: relative;
}

.nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 999;
    flex-direction: column;
    padding: 0.5rem 0;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.nav ul li:hover>ul {
    display: flex;
}

.nav ul ul li {
    width: 100%;
}

.nav ul ul a {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.nav ul ul a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 1.5rem;
    /* Slide effect */
}

/* Hide Mobile Toggle on Desktop */
.dropdown-toggle {
    display: none;
}

/* --- CARDS (Glassmorphism) --- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-item {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Left Indicator Strip (Neon Glow) */
.post-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    opacity: 0.8;
}

.post-item:hover {
    background-color: rgba(30, 30, 30, 0.8);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 243, 255, 0.15);
}

/* Thumbnails */
.post-thumbnail {
    flex: 0 0 120px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content Typography */
.post-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.post-title a {
    color: #fff;
}

.post-title a:hover {
    color: var(--accent-cyan);
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.post-meta {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* --- TAGS (Hybrid Neon) --- */
.tag {
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.tag.jra {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: rgba(10, 255, 10, 0.1);
}

.tag.nar {
    color: #ffa500;
    border-color: #ffa500;
    background: rgba(255, 165, 0, 0.1);
}

.tag.g1 {
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #000;
    border: none;
    font-weight: 700;
    text-shadow: none;
}

.tag.turf {
    background: rgba(10, 255, 10, 0.2);
    color: var(--accent-green);
}

.confidence-score {
    margin-left: auto;
    color: var(--accent-purple);
    font-weight: 700;
    text-shadow: 0 0 5px rgba(188, 19, 254, 0.6);
}

/* --- SIDEBAR & WIDGETS (Glass) --- */
.widget {
    background-color: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1rem;
    border-bottom: 2px solid var(--accent-purple);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.widget li:last-child {
    border-bottom: none;
}

/* Children Indentation */
.widget ul ul.children {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.2);
    width: 100%;
}

/* Cyber AI compatibility for sidebar children */
.sidebar ul ul.children {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.2);
    width: 100%;
}

/* --- PREMIUM & PAID STYLES --- */
.tag.premium {
    background: #FFD700;
    /* Vivid Gold */
    background: linear-gradient(135deg, #FFD700, #FFC107);
    /* Brighter Gradient */
    color: #000;
    border: 1px solid #FFD700;
    font-weight: 800;
    text-shadow: none;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    /* Stronger Glow */
}

.tag.paid {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Premium Card Glow */
.post-item.premium-post {
    border: 1px solid #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.post-item.premium-post::before {
    background-color: #FFD700;
    box-shadow: 0 0 15px #FFD700;
}

/* Status Indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.online {
    background-color: var(--accent-success);
    box-shadow: 0 0 5px var(--accent-success);
}

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

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* --- BUTTONS & PAGINATION --- */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 4px;
    margin: 0 2px;
}

.pagination .current {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 700;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* --- FOOTER --- */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4rem;
}

.codoc-bottom,
.codoc-buy {
    background-color: #000 !important;
    color: #fff;
}

/* =========================================
   WORDPRESS FUNCTIONAL EXTENSIONS
   (Preserved from Original Cyber AI Theme)
   ========================================= */

/* Gate Numbers */
.gate-num {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 2px;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-right: 2px;
}

.gate-num.gate-1 {
    background-color: #FFFFFF;
    color: #222;
    border: 1px solid #ccc;
    text-shadow: none;
}

.gate-num.gate-2 {
    background-color: #222222;
    border: 1px solid #555;
}

.gate-num.gate-3 {
    background-color: #C7243A;
}

.gate-num.gate-4 {
    background-color: #0067C0;
}

.gate-num.gate-5 {
    background-color: #E6B422;
    color: #000;
    text-shadow: none;
}

.gate-num.gate-6 {
    background-color: #008D4C;
}

.gate-num.gate-7 {
    background-color: #ED6D1F;
}

.gate-num.gate-8 {
    background-color: #E95295;
}

/* Rank Colors */
.rank_f {
    color: #999;
}

.rank_e {
    color: #006400;
}

.rank_d {
    color: #1e90ff;
}

.rank_c {
    color: #ffa500;
}

.rank_b {
    color: #dc143c;
}

.rank_a {
    color: #ff1493;
}

.rank_s {
    color: #ff69b4;
}

.rank_ss {
    color: #ff69b4;
}

/* Box Notes & Kaime Box */
.box_note {
    padding: 0.5em 1em;
    margin: 1em 0;
    border-left: solid 6px #5bb7ae;
    box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.33);
    background: rgba(255, 255, 255, 0.05);
}

.box_note p {
    margin: 0;
    padding: 0;
}

.box_note p:nth-child(n+1) {
    margin-top: 10px;
}

.box_note ul {
    list-style-type: none;
    padding-left: 0;
}

.box_note ul li {
    margin-bottom: 10px;
}

.kaime-box p {
    margin: 5px 0;
    padding: 5px;
    border-bottom: 1px dotted #ccc;
}

.kaime-box span {
    display: inline-block;
    background-color: #e7f3ff;
    color: #005a9c;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9em;
    margin-left: 10px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-main);
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.3);
    outline: none;
}

/* AI Forecast Table */
.ai-forecast table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.ai-forecast th {
    padding: 12px;
    border: 1px solid var(--border-color);
    font-weight: 700;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
}

.ai-forecast td {
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: transparent;
}

/* --- RESPONSIVE & MOBILE FIXES --- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 0 1rem;
    }

    .header-container {
        flex-wrap: nowrap;
    }

    .site-description {
        display: none;
    }

    /* Mobile Nav Overlay & Accordion Logic */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
    }

    .menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: var(--accent-cyan);
        margin-bottom: 5px;
        transition: all 0.3s;
        box-shadow: 0 0 5px var(--accent-cyan);
    }

    .nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(13, 13, 13, 0.98);
        backdrop-filter: blur(15px);
        padding-top: 80px;
        z-index: 999;
        overflow-y: auto;
    }

    .nav.active {
        display: block;
        animation: fadeIn 0.3s ease-out;
    }

    .nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0 20px;
    }

    .nav li {
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: left;
        position: relative;
    }

    .nav a {
        padding: 15px 0;
        font-size: 1.1rem;
        display: inline-block;
        width: calc(100% - 50px);
    }

    /* Accordion Submenus */
    .nav ul ul {
        display: none;
        position: static;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        box-shadow: none;
        padding: 0;
        min-width: auto;
        border-left: 2px solid var(--border-color);
        padding-left: 1rem;
    }

    .nav li.toggled-on>ul {
        display: block;
    }

    /* Toggle Buttons */
    .dropdown-toggle {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        width: 44px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--accent-cyan);
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 10;
        line-height: 40px;
    }

    .icon-plus::before {
        content: '+';
    }

    .icon-minus::before {
        content: '-';
        font-weight: bold;
    }

    /* Compact Layout for Mobile */
    .main-container {
        flex-direction: column;
        padding: 0 8px !important;
        /* Minimal container padding */
        gap: 10px;
        /* Reduce gap between content and sidebar */
    }

    .post-item,
    .post-detail,
    .widget {
        padding: 10px !important;
        /* Reduce from 1.5rem/1rem to 10px */
        margin-bottom: 10px !important;
        /* Reduce spacing between cards */
        gap: 10px !important;
        /* Reduce flex gap */
    }

    /* Tighter Typography & Spacing */
    .post-title {
        font-size: 1rem !important;
        /* Slightly smaller title */
        margin-bottom: 5px !important;
        line-height: 1.3 !important;
    }

    .post-meta {
        margin-bottom: 5px !important;
        font-size: 0.75rem !important;
        flex-wrap: nowrap !important;
        /* Force single line */
        white-space: nowrap;
        overflow: hidden;
        /* Cut off if too long */
        text-overflow: ellipsis;
    }

    /* Limit Categories to 2 on Mobile */
    .post-meta a.tag:nth-of-type(n+3) {
        display: none !important;
    }

    .post-excerpt {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        /* Limit excerpt to 2 lines to save height */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Ensure Thumbnail is constrained */
    .post-thumbnail {
        flex: 0 0 100px !important;
        /* Slightly reduced from 120px for better text fit */
        align-self: flex-start;
        /* Ensure it stays at top */
    }

    /* Score Rank Table Fix (CRITICAL) */
    div.score-rank-table table {
        table-layout: fixed;
        width: 100%;
        font-size: 0.75rem;
        border-collapse: collapse;
    }

    div.score-rank-table table th,
    div.score-rank-table table td {
        padding: 3px 2px;
        word-break: break-all;
        overflow-wrap: break-word;
        text-align: center;
        border: 1px solid var(--border-color);
    }

    div.score-rank-table table th:nth-child(1),
    div.score-rank-table table th:nth-child(2),
    div.score-rank-table table th:nth-child(4),
    div.score-rank-table table th:nth-child(5),
    div.score-rank-table table th:nth-child(6),
    div.score-rank-table table th:nth-child(7),
    div.score-rank-table table th:nth-child(8),
    div.score-rank-table table th:nth-child(9),
    div.score-rank-table table th:nth-child(10) {
        width: 35px !important;
        min-width: 35px !important;
        max-width: 35px !important;
        box-sizing: border-box;
    }

    .ai-forecast table {
        font-size: 0.75rem;
        table-layout: auto;
    }

    .ai-forecast th,
    .ai-forecast td {
        padding: 3px 4px;
        word-break: break-all;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}