/* Modern Stylesheet for Yo-kai Watch Busters Portal */
:root {
    --primary: #1e88e5;
    --primary-dark: #1565c0;
    --accent: #ff6f00;
    --accent-hover: #e65100;
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #263238;
    --text-muted: #607d8b;
    --border: #cfd8dc;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --radius: 12px;
}

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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    width: 320px;
}

.search-box input {
    width: 100%;
    padding: 8px 36px 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    outline: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(30, 136, 229, 0.3);
}

.search-box i {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 14px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.2s;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    color: white;
    padding: 50px 20px;
    text-align: center;
    position: relative;
}

.badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: 2.1rem;
    line-height: 1.3;
    margin-bottom: 14px;
    font-weight: 800;
}

.hero p {
    max-width: 650px;
    margin: 0 auto 24px;
    font-size: 0.98rem;
    opacity: 0.92;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.btn {
    padding: 10px 22px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1100px;
    margin: -25px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    padding: 16px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    font-size: 1.6rem;
    color: var(--primary);
    background: #e3f2fd;
    padding: 10px;
    border-radius: 10px;
}

.stat-info h3 {
    font-size: 0.95rem;
    color: var(--text-main);
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Card Sections */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.card-header h2 {
    font-size: 1.3rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-tag {
    background: #e1f5fe;
    color: #0288d1;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.tab-btn {
    background: #f0f4f8;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover {
    background: #e3f2fd;
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
}

.sub-title {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Table Scroll Container */
.table-scroll-container {
    max-height: 480px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table-scroll-container .data-table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #e8eaf6;
    color: var(--primary-dark);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-align: left;
    padding: 10px 14px;
    font-weight: 700;
}

.data-table th {
    background: #e8eaf6;
    color: var(--primary-dark);
    text-align: left;
    padding: 10px 14px;
    font-weight: 700;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: #f5f5f5;
}

code {
    font-family: 'Consolas', 'Courier New', monospace;
    background: #eceff1;
    padding: 2px 6px;
    border-radius: 4px;
    color: #c62828;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Tags */
.tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}
.tag-equip { background: #e8f5e9; color: #2e7d32; }
.tag-coin { background: #fff8e1; color: #f57f17; }
.tag-aura { background: #f3e5f5; color: #7b1fa2; }

/* Buttons */
.copy-btn, .copy-btn-block {
    background: #e3f2fd;
    color: var(--primary-dark);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.2s;
}

.copy-btn:hover, .copy-btn-block:hover {
    background: var(--primary);
    color: white;
}

.copy-btn-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.copy-btn-sm:hover {
    color: var(--primary);
}

/* Grid 2 Column */
.grid-2col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 14px;
}

.sub-card {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.sub-card h3 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

/* Code List */
.code-list {
    list-style: none;
}

.code-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

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

/* Code Block */
.code-block-wrapper {
    background: #263238;
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
}

.code-header {
    background: #37474f;
    color: #eceff1;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.code-block-wrapper pre {
    padding: 14px;
    color: #80cbc4;
    font-family: 'Consolas', monospace;
    font-size: 0.88rem;
    overflow-x: auto;
    line-height: 1.5;
}

.code-block-wrapper code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Feature List */
.feature-list {
    list-style: none;
}

.feature-list li {
    margin-bottom: 8px;
    font-size: 0.88rem;
}

.key {
    background: #eceff1;
    border: 1px solid #b0bec5;
    box-shadow: 0 2px 0 #b0bec5;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.78rem;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mark-item {
    background: white;
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
}

/* Sound List */
.sound-list {
    list-style: none;
}

.sound-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2e7d32;
    color: white;
    padding: 12px 22px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 0.88rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 2000;
}

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

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--primary);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Safe Fade-in (Content ALWAYS visible by default) */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* Footer */
footer {
    text-align: center;
    padding: 28px 20px;
    background: #263238;
    color: #b0bec5;
    font-size: 0.88rem;
}

.footer-sub {
    font-size: 0.75rem;
    margin-top: 6px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 10px;
    }
    .search-box {
        width: 100%;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
}
