/* Design System & CSS Variables - Light Theme */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --secondary-dark: #db2777;
    --accent-color: #10b981;
    --accent-light: #34d399;

    --bg-primary: #f0f4ff;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.98);

    --text-primary: #1e1b4b;
    --text-secondary: #3730a3;
    --text-muted: #6b7280;

    --border-color: rgba(99, 102, 241, 0.15);
    --border-focus: rgba(99, 102, 241, 0.5);

    --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.08);
    --shadow-md: 0 4px 12px rgba(99, 102, 241, 0.12);
    --shadow-lg: 0 10px 30px rgba(99, 102, 241, 0.18);
    --shadow-xl: 0 20px 40px rgba(99, 102, 241, 0.22);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 40%, #fdf4ff 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.07) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Header */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: inline-block;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 242, 255, 0.95) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #4f46e5 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.4));
}

.subtitle {
    font-size: 1.1rem;
    color: #6366f1;
    font-weight: 500;
}

/* Seeker Email Input */
.seeker-email-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(99, 102, 241, 0.12);
}

.seeker-email-row label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4338ca;
    white-space: nowrap;
    flex-shrink: 0;
}

.seeker-email-input {
    flex: 1;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: #f8faff;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    min-width: 0;
}

.seeker-email-input::placeholder {
    color: #9ca3af;
}

.seeker-email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: var(--spacing-lg);
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.35);
}

.card-header {
    padding: var(--spacing-md);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(236, 72, 153, 0.06) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.12);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #3730a3;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-icon {
    font-size: 1.8rem;
}

.card-body {
    padding: var(--spacing-lg);
}

.company-card {
    border-top: 3px solid var(--primary-color);
}

.seeker-card {
    border-top: 3px solid var(--secondary-color);
}

/* Input Groups */
.input-group {
    margin-bottom: var(--spacing-md);
    animation: fadeIn 0.4s ease-out;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: #4338ca;
    font-size: 0.92rem;
}

/* Interview Notes Textarea */
.interview-notes {
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: #f8faff;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
    transition: all var(--transition-base);
}

.interview-notes::placeholder {
    color: #9ca3af;
    font-size: 0.85rem;
}

.interview-notes:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* Sliders */
.slider {
    width: calc(100% - 60px);
    height: 8px;
    border-radius: 4px;
    background: #e0e7ff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-right: var(--spacing-sm);
    transition: all var(--transition-fast);
    vertical-align: middle;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-fast);
}

.value-display {
    display: inline-block;
    min-width: 45px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: var(--radius-sm);
    font-weight: 700;
    color: #4f46e5;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
    vertical-align: middle;
}

/* Analyze Button */
.analyze-section {
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

.analyze-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
}

.analyze-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.analyze-btn:hover::before {
    left: 100%;
}

.analyze-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.45);
}

.analyze-btn:active {
    transform: translateY(0) scale(1);
}

.btn-icon {
    font-size: 1.4rem;
}

/* Results Section */
.results-section {
    animation: fadeInUp 0.6s ease-out 0.6s backwards;
    display: none;
}

.results-section.show {
    display: block;
}

.results-card {
    border-top: 3px solid var(--accent-color);
}

.match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: var(--spacing-lg);
}

/* Grade badge — A / B / C / D */
.match-grade-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    animation: fadeInUp 0.5s ease-out;
    max-width: 360px;
}

.grade-letter {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 3px solid;
    flex-shrink: 0;
    letter-spacing: -2px;
}

.grade-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.grade-label {
    font-size: 1rem;
    font-weight: 700;
}

.grade-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

.overall-score {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.07) 0%, rgba(99, 102, 241, 0.07) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.score-label {
    font-size: 1.1rem;
    color: #6366f1;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #10b981 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
    animation: scaleIn 0.5s ease-out;
}

.score-bar {
    width: 100%;
    height: 12px;
    background: #e0e7ff;
    border-radius: 6px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--primary-color) 100%);
    border-radius: 6px;
    transition: width var(--transition-slow);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(238, 242, 255, 0.5);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.12);
}

/* Detailed Scores */
.detailed-scores {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Level groups in sliders */
.level-group {
    border-radius: var(--radius-md);
    padding: 14px 16px 8px;
    margin-bottom: 14px;
}

.level-group:last-child {
    margin-bottom: 0;
}

.level-group-header {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.level-sub {
    font-weight: 400;
    opacity: 0.65;
    margin-left: 4px;
}

.level-lv3 {
    background: rgba(168, 85, 247, 0.07);
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.level-lv3 .level-group-header {
    color: #7c3aed;
    border-bottom-color: rgba(168, 85, 247, 0.15);
}

.level-lv2 {
    background: rgba(59, 130, 246, 0.07);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.level-lv2 .level-group-header {
    color: #2563eb;
    border-bottom-color: rgba(59, 130, 246, 0.15);
}

.level-lv1 {
    background: rgba(16, 185, 129, 0.07);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.level-lv1 .level-group-header {
    color: #059669;
    border-bottom-color: rgba(16, 185, 129, 0.15);
}

/* score-group in results */
.score-group {
    transition: transform var(--transition-fast);
}

.score-group:hover {
    transform: translateY(-2px);
}

.score-item {
    padding: var(--spacing-md);
    background: #f8faff;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all var(--transition-base);
    animation: fadeIn 0.4s ease-out;
}

.score-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

.score-item-label {
    font-size: 0.9rem;
    color: #4338ca;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.score-item-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.score-item-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.company-value {
    color: #4f46e5;
}

.seeker-value {
    color: #db2777;
}

.match-percentage {
    font-size: 1.3rem;
    font-weight: 700;
    color: #059669;
    text-align: center;
    margin-top: var(--spacing-xs);
}

.score-item-notes {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.notes-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4338ca;
    margin-bottom: var(--spacing-xs);
}

.notes-content {
    font-size: 0.9rem;
    color: #1e1b4b;
    line-height: 1.6;
    padding: var(--spacing-sm);
    background: rgba(238, 242, 255, 0.6);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--secondary-color);
}

/* Footer */
.footer {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    border-top: 1px solid rgba(99, 102, 241, 0.15);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.footer-inner p {
    color: #6366f1;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .input-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }

    .icon {
        font-size: 2.5rem;
    }

    .container {
        padding: var(--spacing-md);
    }

    .chart-container {
        height: 300px;
    }

    .score-value {
        font-size: 3rem;
    }

    .detailed-scores {
        flex-direction: column;
    }
}

/* ========================================================
   New: Value Indicators, Level Rates, Potential Badge
   ======================================================== */

/* 価値観シンクロ率 & スキル充足率 */
.value-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out;
}

.indicator-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: 1px solid;
    transition: all var(--transition-base);
}

.indicator-card:hover {
    transform: translateY(-2px);
}

.value-sync-card {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: rgba(168, 85, 247, 0.25);
}

.value-sync-card:hover {
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.skill-rate-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

.skill-rate-card:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.indicator-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.indicator-content {
    flex: 1;
    min-width: 0;
}

.indicator-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4338ca;
    margin-bottom: 2px;
}

.indicator-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(135deg, #4f46e5, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-rate-card .indicator-value {
    background: linear-gradient(135deg, #059669, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.indicator-sub {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 2px;
}

/* 階層別マッチ率 */
.level-rates {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.level-rate-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    font-size: 0.85rem;
    transition: all var(--transition-base);
}

.level-rate-item:hover {
    transform: translateY(-2px);
}

.lv3-item {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.25);
}

.lv2-item {
    background: rgba(59, 130, 246, 0.06);
    border-color: rgba(59, 130, 246, 0.25);
}

.lv1-item {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.25);
}

.level-rate-label {
    font-weight: 600;
    color: #374151;
}

.level-rate-value {
    font-weight: 800;
    font-size: 1.05rem;
}

.lv3-item .level-rate-value { color: #7c3aed; }
.lv2-item .level-rate-value { color: #2563eb; }
.lv1-item .level-rate-value { color: #059669; }

/* ポテンシャル採用バッジ */
.potential-hire-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
    border: 2px solid #f59e0b;
    animation: pulseGlow 2s ease-in-out infinite alternate, fadeInUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.potential-hire-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    from { box-shadow: 0 0 10px rgba(245, 158, 11, 0.15); }
    to { box-shadow: 0 0 25px rgba(245, 158, 11, 0.3); }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.potential-star {
    font-size: 2.4rem;
    color: #f59e0b;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
    animation: starPulse 1.5s ease-in-out infinite alternate;
}

@keyframes starPulse {
    from { transform: scale(1); }
    to { transform: scale(1.15); }
}

.potential-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.potential-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #b45309;
}

.potential-desc {
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.4;
}

/* 算出式 */
.formula-explanation {
    padding: 10px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.12);
    animation: fadeIn 0.4s ease-out;
}

.formula-text {
    font-size: 0.82rem;
    color: #4338ca;
    font-weight: 500;
}

.formula-text sub {
    font-size: 0.7rem;
    color: #6366f1;
}

.formula-text sup {
    font-size: 0.65rem;
}

.formula-text strong {
    font-size: 0.95rem;
    color: #1e1b4b;
}

/* Responsive for new elements */
@media (max-width: 768px) {
    .value-indicators {
        grid-template-columns: 1fr;
    }

    .level-rates {
        flex-direction: column;
    }

    .indicator-value {
        font-size: 1.6rem;
    }
}