/* =========================================
   CSS Reset & Variables (Integrated App)
   ========================================= */
:root {
    --primary: #c29c6d;
    --primary-dark: #a38258;
    --primary-light: #e0c8aa;
    --text-main: #333333;
    --text-light: #666666;
    --bg-main: #ffffff;
    --bg-light: #f4f6f8;
    --bg-dark: #1a1c20;
    --card-bg: #2a2d34;
    --border-color: #eaeaea;
    --border-dark: #3a3f4a;
    --font-heading: 'Inter', 'Noto Sans JP', sans-serif;
    --font-body: 'Inter', 'Noto Sans JP', sans-serif;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.2);
    --radius: 16px;
    --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.relative {
    position: relative;
}

.z-10 {
    z-index: 10;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mt-10 {
    margin-top: 2.5rem;
}

.mt-12 {
    margin-top: 3rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.py-10 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.pb-10 {
    padding-bottom: 4rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.bg-dark {
    background-color: var(--bg-dark);
}

.bg-light {
    background-color: var(--bg-light);
}

.bg-white {
    background-color: #fff;
}

.text-white {
    color: #fff;
}

.text-primary {
    color: var(--primary);
}

.text-primary-light {
    color: var(--primary-light);
}

.text-warning {
    color: #ffb74d;
}

.text-sm {
    font-size: 0.875rem;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-70 {
    opacity: 0.7;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.2rem;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary);
}

/* =========================================
   SPA View Logic
   ========================================= */
.view {
    display: none;
    opacity: 0;
    animation: fadeInView 0.5s forwards;
}

.view.active {
    display: block;
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* =========================================
   Buttons & Badges
   ========================================= */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(194, 156, 109, 0.3);
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

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

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.1rem;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    backdrop-filter: blur(5px);
}

.badge-success {
    background-color: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.btn-back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: none;
    /* 初期状態E非表示 */
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(194, 156, 109, 0.4);
}

.pulse-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(194, 156, 109, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(194, 156, 109, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(194, 156, 109, 0);
    }
}

/* =========================================
   Simulator Hero (View 1)
   ========================================= */
.simulator-hero {
    position: relative;
    height: 100vh;
    min-height: 750px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../assets/images/Firefly_-A\ stunning\,\ photorealistic\ interior\ photograph.\ A\ beautifully\ finished\ DIY\ acoustic\ 626974.png') center/cover no-repeat;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(26, 28, 32, 0.8), rgba(26, 28, 32, 0.95));
}

.hero-title {
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.intro-description {
    max-width: 800px;
    text-align: left;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    padding: 25px 30px;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
}

.intro-description strong {
    color: var(--primary-light);
}

.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.form-container {
    max-width: 600px;
    text-align: left;
}

.form-container h3 {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(194, 156, 109, 0.2);
}

/* =========================================
   Loading Screen (View 2)
   ========================================= */
.loading-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    color: #fff;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(194, 156, 109, 0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =========================================
   Results Dashboard (View 3)
   ========================================= */
.results-dashboard {
    min-height: 100vh;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    border: 1px solid var(--border-dark);
    box-shadow: var(--shadow-md);
}

.dashboard-card.border-primary {
    border: 2px solid var(--primary);
}

.stat-card {
    text-align: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 15px;
}

/* Three.js Canvas Container */
.three-canvas-wrapper {
    position: relative;
    width: 100%;
    height: 450px;
    background-color: #111;
    cursor: grab;
    border-radius: var(--radius);
}

.three-canvas-wrapper:active {
    cursor: grabbing;
}

.mock-overlay-text {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

/* =========================================
   DIY Guide (View 4)
   ========================================= */
.diy-hero {
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.diy-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../assets/images/Firefly_-An\ overhead\ flat\ lay\ photograph\ of\ DIY\ acoustic\ panel\ materials\ laid\ out\ on\ a\ clean\ 626974.png') center/cover;
    opacity: 0.15;
    filter: blur(5px);
}

.diy-hero h1 {
    font-size: 2.5rem;
}

.prep-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 30px;
}

.prep-grid .glass-card {
    background: #fff;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.prep-grid .glass-card h3 {
    color: var(--primary-dark);
    border-bottom-color: var(--border-color);
}

.material-list {
    list-style: none;
}

.material-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.image-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.image-card img {
    transition: transform 0.5s ease;
    width: 100%;
}

.image-card:hover img {
    transform: scale(1.03);
}

.alert {
    display: flex;
    gap: 20px;
    padding: 25px;
    border-radius: var(--radius);
    background-color: #fff9e6;
    border-left: 5px solid #ffd54f;
}

.alert-icon {
    font-size: 2rem;
}

.alert-content h3 {
    color: #b38600;
    margin-bottom: 5px;
}

.alert-content p {
    color: #665000;
    margin-bottom: 0;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.step-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
}

.step-card.reverse {
    direction: rtl;
}

.step-card.reverse>* {
    direction: ltr;
}

.step-number {
    position: absolute;
    top: -30px;
    left: -20px;
    font-size: 6rem;
    font-weight: 800;
    color: rgba(194, 156, 109, 0.1);
    z-index: 0;
    line-height: 1;
}

.step-card.reverse .step-number {
    left: auto;
    right: -20px;
}

.step-content {
    position: relative;
    z-index: 1;
}

.step-content h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .input-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .prep-grid,
    .step-card {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .prep-grid .image-card {
        order: -1;
    }

    .step-card.reverse {
        direction: ltr;
    }

    .three-canvas-wrapper {
        height: 300px;
    }
}

/* =========================================
   View 3: Results Dashboard Background
   ========================================= */
#view-results {
    position: relative;
    background: url('../assets/images/Gemini_Generated_Image_dl60c7dl60c7dl60.png') center/cover no-repeat fixed;
}
#view-results::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(26, 28, 32, 0.85); /* ダークオーバEレイ */
    z-index: 0;
}
#view-results > .results-dashboard {
    position: relative;
    z-index: 1;
    background-color: transparent !important;
}

/* =========================================
   Tips & FAQ Section
   ========================================= */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.tip-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 30px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.tip-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.tip-card h4 {
    font-size: 1.3rem;
    color: #fff;
}

.tip-card .small {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0;
}

.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 25px 30px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary);
}

.faq-question .icon {
    font-size: 1.5rem;
    font-weight: 400;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
    color: var(--primary);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: #fff;
}

.faq-answer p {
    padding: 0 30px 30px;
    margin-bottom: 0;
}

@media (max-width: 992px) {
    .tips-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* =========================================
   Audio Simulator Section
   ========================================= */
.audio-simulator-card {
    padding: 40px;
}

.audio-players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.player-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.player-box h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.player-box audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    outline: none;
}

.file-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    cursor: pointer;
}

.file-input::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.file-input::file-selector-button:hover {
    background: var(--primary-dark);
}

@media (max-width: 768px) {
    .audio-players-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* =========================================
   Audio Simulator Section
   ========================================= */
.audio-simulator-card {
    padding: 40px;
}

.audio-players-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.player-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dark);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.player-box h4 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.player-box audio {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    outline: none;
}

.file-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    cursor: pointer;
}

.file-input::file-selector-button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-right: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.file-input::file-selector-button:hover {
    background: var(--primary-dark);
}

@media (max-width: 768px) {
    .audio-players-grid {
        grid-template-columns: 1fr;
    }
}
