/* ==========================================
   AI Freelance Quiz - メインスタイルシート
   ========================================== */

/* Google Fonts のインポート: ヘッダー用の Outfit と本文用の Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* デザインシステムのカスタム変数定義 */
:root {
    --bg-dark: #0B0F19; /* ベースの暗い背景色 */
    --bg-card: rgba(17, 24, 39, 0.65); /* グラスモルフィズム用カード背景色 */
    --bg-card-hover: rgba(255, 255, 255, 0.03); /* オプションホバー時のカード背景色 */
    --border-color: rgba(255, 255, 255, 0.08); /* グラスモルフィズム境界線色 */
    --border-active: rgba(99, 102, 241, 0.5); /* 選択された要素の境界線色 */
    
    /* プレミアムグラデーション */
    --grad-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    --grad-text: linear-gradient(135deg, #A5B4FC 0%, #C084FC 50%, #22D3EE 100%);
    --grad-glow: 0 0 30px rgba(139, 92, 246, 0.25);
    
    /* テキストカラー */
    --text-main: #F3F4F6;
    --text-muted: #9CA3AF;
    --text-inverse: #0B0F19;
    
    /* トランジション */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全体のリセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* 背景のネオングロー効果演出 */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* スクロールバーのカスタマイズ */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ヘッダーのスタイリング */
header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -1px;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* メインコンテンツ領域 */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

/* クイズコンテナ全体のレイアウト */
.quiz-container {
    width: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

/* アニメーション用のクラス */
.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* 開始画面のスタイリング */
.start-screen {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.badge {
    background: rgba(99, 102, 241, 0.15);
    color: #A5B4FC;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(99, 102, 241, 0.3);
    margin-bottom: 0.5rem;
    animation: pulseGlow 3s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
    }
    100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
}

.main-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.start-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 550px;
    margin-bottom: 1.5rem;
}

.btn-primary {
    background: var(--grad-primary);
    color: var(--text-inverse);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--grad-glow);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* クイズ画面（設問）のスタイリング */
.quiz-screen {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.quiz-progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--grad-primary);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.question-number {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #8B5CF6;
}

.question-text {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    margin-top: 0.5rem;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.option-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--grad-primary);
    opacity: 0;
    z-index: 0;
    transition: opacity 0.3s ease;
}

.option-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.option-card.selected {
    border-color: #8B5CF6;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.2);
}

.option-card.selected::before {
    opacity: 0.04;
}

.option-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
    flex-shrink: 0;
    z-index: 1;
}

.option-card:hover .option-marker {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.option-card.selected .option-marker {
    background: var(--grad-primary);
    border-color: transparent;
    color: var(--text-inverse);
}

.option-text {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-main);
    z-index: 1;
}

/* 結果画面のスタイリング */
.results-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.score-visualization {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.circular-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3;
}

.circle-fill {
    fill: none;
    stroke: url(#scoreGrad);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-dasharray: 100 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-display {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-num {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.score-total {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-type-badge {
    background: rgba(6, 182, 212, 0.1);
    color: #22D3EE;
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.result-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    background: var(--grad-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: -0.5rem;
}

.result-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 1.05rem;
    max-width: 600px;
}

.advice-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    width: 100%;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.advice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--grad-primary);
}

.advice-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: #A5B4FC;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advice-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
}

/* フッターのスタイリング */
footer {
    border-top: 1px solid var(--border-color);
    background: rgba(7, 10, 17, 0.95);
    padding: 3rem 2rem 2rem;
    width: 100%;
    z-index: 5;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* 折り畳みアコーディオンのデザイン */
.footer-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.accordion-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.accordion-header {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.6;
}

.accordion-item.active {
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(255, 255, 255, 0.02);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: #8B5CF6;
    opacity: 1;
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
    padding: 0 1.5rem;
}

.accordion-item.active .accordion-content {
    max-height: 500px; /* アコーディオンが開く十分な高さを設定 */
    opacity: 1;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.accordion-content p, .accordion-content ul {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.accordion-content ul {
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.accordion-content li {
    margin-bottom: 0.25rem;
}

.accordion-content a {
    color: #8B5CF6;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.accordion-content a:hover {
    color: #06B6D4;
    text-decoration: underline;
}

/* フッター最下部のコピーライト */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-main);
}

/* メディアクエリ（レスポンシブ対応） */
@media (max-width: 768px) {
    header {
        padding: 1.25rem 1.25rem;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    main {
        padding: 1.5rem 1rem;
    }
    
    .quiz-container {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }
    
    .main-title {
        font-size: 2.2rem;
    }
    
    .question-text {
        font-size: 1.15rem;
    }
    
    .option-card {
        padding: 1rem 1.25rem;
    }
    
    .option-marker {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .results-screen {
        gap: 1.5rem;
    }
    
    .result-title {
        font-size: 1.75rem;
    }
    
    .footer-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
