/* Root Variables */
:root {
    --background: #ffffff;
    --foreground: #333333;
    --card-bg: rgba(255, 255, 255, 0.6);
    --primary: #0891b2;
    --primary-foreground: #ffffff;
    --secondary: #ea580c;
    --secondary-foreground: #ffffff;
    --muted: #f9f9f9;
    --muted-foreground: #555555;
    --accent: #ea580c;
    --accent-foreground: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --radius: 1rem;
    --font-open-sans: "Open Sans", sans-serif;
    --font-montserrat: "Montserrat", sans-serif;
    --font-noto: "Noto Sans JP", sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a1a;
        --foreground: #f0f0f0;
        --card-bg: rgba(0, 0, 0, 0.6);
        --primary: #0ea5e9;
        --primary-foreground: #0f172a;
        --secondary: #f97316;
        --secondary-foreground: #0f172a;
        --muted: #2a2a2a;
        --muted-foreground: #a0a0a0;
        --accent: #f97316;
        --accent-foreground: #0f172a;
        --border: rgba(255, 255, 255, 0.1);
    }
}

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

body {
    font-family: var(--font-open-sans);
    background-color: transparent;
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

.fixed-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../public/bg_image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: -1;
}

@media (prefers-color-scheme: dark) {
    .bg-overlay {
        background-color: rgba(0, 0, 0, 0.7);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-container {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
    .glass {
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.site-title {
    font-family: var(--font-noto);
    font-weight: 900;
    color: var(--primary);
    font-size: 1.5rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--foreground);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Section & Cards */
.main-content {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.section {
    padding: 2rem;
    scroll-margin-top: 5rem;
}

.card {
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.section-title {
    font-family: var(--font-noto);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--secondary);
    font-size: 0.8em;
}

.detail-label i {
    color: var(--primary);
    margin-right: 0.25rem;
    width: 1.5rem;
    text-align: center;
}

/* About Section */
.about-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .profile-header {
        flex-direction: row;
        align-items: flex-start;
    }
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(8, 145, 178, 0.2);
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-family: var(--font-noto);
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-label {
    font-family: var(--font-noto);
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.list {
    list-style: none;
    margin-left: 0.5rem;
}

.list li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.25rem;
}

.list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6rem;
    width: 6px;
    height: 6px;
    background-color: var(--secondary);
    border-radius: 50%;
}

.sub-list {
    list-style: none;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
}

.premium-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(8, 145, 178, 0.2);
    color: var(--primary);
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(8, 145, 178, 0.3);
}

/* Tabs */
.tabs {
    width: 100%;
}

.tabs-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-trigger {
    background: transparent;
    border: none;
    color: var(--foreground);
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: all 0.2s;
    font-family: var(--font-noto);
}

.tab-trigger.active {
    background: var(--background);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: bold;
}

.tabs-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .tabs-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .tabs-content {
        grid-template-columns: repeat(5, 1fr);
    }
}

.chara-card {
    cursor: pointer;
    transition: transform 0.2s;
    text-align: center;
    padding: 0.25rem;
}

.chara-card:hover {
    transform: scale(1.05);
}

.chara-icon {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 0.5rem;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.chara-name {
    font-family: var(--font-noto);
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

/* Accordion */
.accordion {
    display: flex;
    flex-direction: column;
}

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: var(--font-noto);
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    font-size: 1.1rem;
}

.accordion-trigger:hover {
    opacity: 0.8;
}

.accordion-trigger::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.accordion-item.active .accordion-trigger::after {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
    padding-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn i {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
}

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

.btn.primary:hover {
    opacity: 0.9;
}

.btn.outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--foreground);
}

.btn.outline:hover {
    border-color: var(--primary);
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.center-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 95vw;
    width: auto;
    max-height: 90vh;
    padding: 1.5rem;
    border-radius: var(--radius);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-family: var(--font-noto);
    color: var(--primary);
    font-weight: bold;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--foreground);
}

.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-container img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 0.5rem;
    object-fit: contain;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

#prev-img { left: 0.5rem; }
#next-img { right: 0.5rem; }

.slider-dots {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.dot.active {
    background: var(--primary);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: none;
    z-index: 99;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 1.25rem;
}

.back-to-top.show {
    display: flex;
}
