:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #8b5cf6;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 100%);
    z-index: -1;
}

.background-gradient::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    animation: float 10s infinite ease-in-out;
}

.background-gradient::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    animation: float 15s infinite ease-in-out reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 20px);
    }
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.center-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

section.active {
    display: block;
    opacity: 1;
}

/* Typography */
h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 3rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

/* Components */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card {
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
}

.description {
    color: #cbd5e1;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Inputs & Buttons */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-text {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-decoration: underline;
}

.btn-secondary {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Interface */
.chat-header {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    font-weight: 700;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.chat-window {
    height: 60vh;
    overflow-y: auto;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message.ai {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.message.system {
    align-self: center;
    max-width: 90%;
    text-align: center;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin: 1rem 0;
}

.message-content {
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.ai .message-content {
    background: rgba(255, 255, 255, 0.05);
    border-top-left-radius: 2px;
}

.message.user .message-content {
    background: var(--primary-color);
    border-top-right-radius: 2px;
}

.input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    align-items: flex-end;
}

.input-area textarea {
    background: transparent;
    border: none;
    resize: none;
    padding: 0.8rem;
}

.btn-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--primary-hover);
}

/* Loader */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Results */
.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.summary-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
}

.summary-section h3 {
    margin: 0 0 1rem 0;
    color: #3b82f6;
    font-size: 1.2rem;
}

.summary-section p {
    margin: 0;
    line-height: 1.8;
    color: #e2e8f0;
}

.chart-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.score-item h4 {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
}

.score-item p {
    font-size: 1.2rem;
    font-weight: 700;
}

.action-area {
    margin-top: 2rem;
    text-align: center;
}

/* Slider Chart Styles */
#slider-chart {
    width: 100%;
}

.category-section {
    margin-bottom: 3rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
}

.category-header.decision {
    border-bottom-color: #3b82f6;
}

.category-header.communication {
    border-bottom-color: #8b5cf6;
}

.category-header.organization {
    border-bottom-color: #14b8a6;
}

.category-header.evaluation {
    border-bottom-color: #f59e0b;
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.category-icon.decision {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.category-icon.communication {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.category-icon.organization {
    background: linear-gradient(135deg, #14b8a6, #2dd4bf);
}

.category-icon.evaluation {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.category-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.category-count {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-left: auto;
}

/* Axis Items */
.axis-item {
    margin-bottom: 2rem;
}

.axis-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
}

.axis-name {
    font-weight: 600;
    font-size: 1rem;
    color: #e2e8f0;
}

.axis-score {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.axis-description {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.axis-description .left-label {
    text-align: left;
}

.axis-description .right-label {
    text-align: right;
}

/* Slider Container */
.slider-container {
    position: relative;
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
}

.slider-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right,
            rgba(239, 68, 68, 0.3) 0%,
            rgba(100, 116, 139, 0.3) 50%,
            rgba(34, 197, 94, 0.3) 100%);
    border-radius: 4px;
    overflow: visible;
}

.slider-center-line {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.4);
}

.slider-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid;
    transition: all 0.3s ease;
    cursor: pointer;
}

.slider-indicator:hover {
    transform: translate(-50%, -50%) scale(1.2);
}

.slider-indicator.decision {
    border-color: #3b82f6;
}

.slider-indicator.communication {
    border-color: #8b5cf6;
}

.slider-indicator.organization {
    border-color: #14b8a6;
}

.slider-indicator.evaluation {
    border-color: #f59e0b;
}

/* Reason Tooltip */
.axis-reason {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.6;
    display: none;
}

.axis-item:hover .axis-reason {
    display: block;
}