/* Ikigai Discovery App - Main Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #2d3748;
    overflow-x: hidden;
}

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

.app-header {
    text-align: center;
    padding: 40px 20px;
    color: white;
    animation: fadeInDown 0.8s ease;
}

.app-header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 300;
    letter-spacing: 2px;
}

.app-header .subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    font-weight: 300;
}

.japanese-text {
    font-size: 2em;
    margin: 20px 0;
    opacity: 0.8;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

.btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    margin: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #f7fafc;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 30px 0;
    overflow: hidden;
}

.progress-bar-segmented {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: #E5E7EB;
    margin: 30px 0;
    position: relative;
}

.progress-segment {
    flex: 1;
    position: relative;
    border-right: 2px solid white;
    background: #F3F4F6;
    transition: all 0.3s ease;
}

.progress-segment:last-child {
    border-right: none;
}

.segment-love, .segment-good, .segment-need, .segment-paid { 
    background: #5A4FCF;
}

.segment-fill {
    height: 100%;
    width: 0%;
    background: inherit;
    transition: width 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.segment-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 6px;
    transition: width 0.5s ease;
    width: 0%;
}

.question-card {
    margin: 30px 0;
}

.question-card h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.4em;
}

.option-grid {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.option {
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option:hover {
    border-color: #667eea;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.textarea-input {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1em;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.textarea-input:focus {
    outline: none;
    border-color: #667eea;
}

#visualization {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 50px 0 50px 0;
    
    /* Purple background integration */
    background: radial-gradient(circle at center, 
        rgba(90, 79, 207, 0.08) 0%, 
        rgba(167, 139, 250, 0.04) 50%, 
        transparent 100%);
}

.ikigai-image {
    max-width: 60%;
    height: auto;
    border-radius: 15px;
    margin-top: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    
    /* No tint - let the purple image show naturally */
    box-shadow: 0 15px 40px rgba(90, 79, 207, 0.25);
    transition: all 0.3s ease;
}

.ikigai-image:hover {
    /* Clean hover effect without tint */
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(90, 79, 207, 0.35);
}

.venn-svg { max-width: 540px; max-height: 540px; }
.venn-label { font-weight: 700; fill: #ffffff; font-size: 14px; text-anchor: middle; dominant-baseline: middle; }
.venn-stroke { stroke: rgba(0,0,0,0.15); stroke-width: 2; }
.venn-center { fill: url(#ikigaiGrad); }
.venn-circle-hover { cursor: pointer; transition: opacity .2s ease, transform .2s ease; }
.venn-circle-hover:hover { opacity: .9; }

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.results-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.results-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    margin-top: 30px;
    font-size: 1.6em;
}

.results-section h3:first-child {
    margin-top: 0;
}

.ikigai-statement {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 30px;
    border-radius: 15px;
    font-size: 1.3em;
    line-height: 1.6;
    color: #2d3748;
    text-align: center;
    margin: 30px 0;
    border-left: 5px solid #667eea;
}

.insight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.insight-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 3px solid #5A4FCF;
}

.insight-card h4 {
    color: #5A4FCF;
    margin-bottom: 10px;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.insight-card .zen-icon-wrapper {
    background: transparent;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.insight-card .zen-icon-wrapper:hover {
    transform: scale(1.1);
}

.action-items {
    background: #f7fafc;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.action-items h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.action-items ul {
    list-style: none;
    padding: 0;
}

.action-items li {
    padding: 10px 0;
    padding-left: 30px;
    position: relative;
}

.action-items li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Export mode: increase contrast, remove shadows/animations, white background */
body.exporting {
    background: #ffffff !important;
}
body.exporting .card,
body.exporting .insight-card,
body.exporting .action-items {
    box-shadow: none !important;
}
body.exporting .venn-container {
    display: none !important; /* hide visualization to focus on text content */
}
body.exporting .ikigai-statement {
    background: #ffffff !important;
    border-left: 5px solid #667eea !important;
}

/* Alternative border approach for PDF export */
body.exporting .card {
    border-top: 5px solid #667eea !important;
}
body.exporting .btn,
body.exporting button {
    display: none !important; /* hide all buttons during export */
}
body.exporting .card::before {
    display: none !important; /* Hide the original pseudo-element border during export */
}
body.exporting * {
    color: #1a202c !important; /* high-contrast text */
    animation: none !important;
    transition: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    min-height: 60px;
}

.tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Zen Icon System Styles */
.zen-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zen-icon {
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

/* Clean purple theme icon styling */
.zen-icon-love,
.zen-icon-good,
.zen-icon-need,
.zen-icon-paid {
    filter: drop-shadow(0 2px 6px rgba(90, 79, 207, 0.25)) 
            drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
}

/* High contrast purple mode for better accessibility */
.zen-icon-wrapper.high-contrast .zen-icon {
    filter: drop-shadow(0 0 0 1px #5A4FCF) 
            drop-shadow(0 2px 4px rgba(90, 79, 207, 0.2));
}

/* Purple theme integration */
.zen-icon {
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Active state for selected categories - clean style */
.zen-icon-wrapper.active .zen-icon {
    filter: drop-shadow(0 6px 16px rgba(90, 79, 207, 0.4)) 
            drop-shadow(0 3px 8px rgba(0, 0, 0, 0.15))
            brightness(1.2);
    transform: scale(1.12);
}

/* Enhanced purple hover states for clean icons */
.zen-icon-wrapper:hover .zen-icon-love,
.zen-icon-wrapper:hover .zen-icon-good,
.zen-icon-wrapper:hover .zen-icon-need,
.zen-icon-wrapper:hover .zen-icon-paid {
    filter: drop-shadow(0 4px 12px rgba(90, 79, 207, 0.35)) 
            drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2))
            brightness(1.15);
    transform: scale(1.08);
}

/* Enhanced Icon Animations with better visibility */
.zen-breathe {
    animation: zenBreathe 3s ease-in-out infinite;
}

@keyframes zenBreathe {
    0%, 100% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.08); 
        filter: brightness(1.1);
    }
}

.zen-float {
    animation: zenFloat 4s ease-in-out infinite;
}

@keyframes zenFloat {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-3px) scale(1.02); 
    }
}

.zen-pulse {
    animation: zenPulse 2s ease-in-out infinite;
}

@keyframes zenPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.85; 
        transform: scale(0.98);
    }
}

/* New animation for active states */
.zen-glow {
    animation: zenGlow 2s ease-in-out infinite alternate;
}

@keyframes zenGlow {
    0% { 
        filter: brightness(1) saturate(1);
    }
    100% { 
        filter: brightness(1.15) saturate(1.2);
    }
}

/* Enhanced Question Header with better icon contrast */
.question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.question-header:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

.category-icon-container {
    flex-shrink: 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.category-icon-container:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.question-info {
    flex-grow: 1;
}

.question-category {
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

/* Clean purple option icons - matching category icon style */
.option-icon {
    flex-shrink: 0;
    opacity: 0.85;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 8px;
    border-radius: 10px;
    background: transparent;
    border: 2px solid #5A4FCF;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.purple-option-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(90, 79, 207, 0.2));
}

.option:hover .option-icon {
    opacity: 1;
    background: transparent;
    border-color: #7C3AED;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(90, 79, 207, 0.15);
}

.option:hover .purple-option-icon {
    filter: drop-shadow(0 2px 4px rgba(90, 79, 207, 0.3)) brightness(1.1);
}

.option.selected .option-icon {
    opacity: 1;
    background: transparent;
    border-color: #5A4FCF;
    border-width: 3px;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(90, 79, 207, 0.25);
}

.option.selected .purple-option-icon {
    filter: drop-shadow(0 3px 6px rgba(90, 79, 207, 0.4)) brightness(1.2) saturate(1.1);
}

.option-text {
    flex-grow: 1;
}

/* Navigation buttons with icons */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Enhanced progress indicator with bigger icons */
.progress-categories {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    padding: 15px;
    border-radius: 15px;
    min-width: 80px;
    position: relative;
    cursor: pointer;
    
    /* Default state - Transparent background with light border and shadow */
    background: transparent;
    border: 2px solid #E9D5FF;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    opacity: 0.7;
}

/* Clickable categories */
.progress-category.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-category.clickable:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(90, 79, 207, 0.3);
}

/* Non-clickable (locked) categories */
.progress-category.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.progress-category.locked:hover {
    transform: none;
    box-shadow: none;
}

/* Hover effect for default state */
.progress-category:hover:not(.active):not(.completed):not(.locked) {
    border-color: #D8B4FE;
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.25);
    opacity: 0.85;
    transform: translateY(-2px);
}

.progress-category.active {
    /* Active state - Light purple border for gentler look */
    opacity: 1;
    background: transparent;
    border-color: #A78BFA;
    box-shadow: 0 10px 35px rgba(167, 139, 250, 0.4);
    transform: scale(1.15);
    animation: activePulse 2.5s ease-in-out infinite;
}

.progress-category.completed {
    /* Completed state - Medium purple border */
    opacity: 1;
    background: transparent;
    border-color: #8B5CF6;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.3);
    transform: scale(1.05);
}

/* Completed checkmark indicator */
.progress-category.completed::after {
    content: '✓';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #5A4FCF, #7C3AED);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(90, 79, 207, 0.4);
    animation: checkmarkPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid white;
    z-index: 10;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    80% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Pulse animation for active state with lighter shadow effects */
@keyframes activePulse {
    0%, 100% {
        box-shadow: 0 10px 35px rgba(167, 139, 250, 0.4);
        transform: scale(1.15);
    }
    50% {
        box-shadow: 0 12px 45px rgba(167, 139, 250, 0.6);
        transform: scale(1.18);
    }
}

.progress-category .zen-icon-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 10px;
    border: 2px solid rgba(233, 213, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 68px;
    height: 68px;
    transition: all 0.4s ease;
    filter: brightness(0.8) opacity(0.7);
}

.progress-category:hover:not(.active):not(.completed) .zen-icon-wrapper {
    border-color: rgba(167, 139, 250, 0.5);
    filter: brightness(0.9) opacity(0.85);
    transform: scale(1.02);
}

.progress-category.active .zen-icon-wrapper {
    border-color: rgba(90, 79, 207, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 25px rgba(90, 79, 207, 0.25);
    filter: brightness(1) opacity(1);
    transform: scale(1.05);
}

.progress-category.completed .zen-icon-wrapper {
    border-color: rgba(124, 58, 237, 0.5);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.2);
    filter: brightness(1) opacity(1);
}

.progress-category-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    text-align: center;
    transition: all 0.4s ease;
    
    /* Default state - Light purple text */
    color: #C4B5FD;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-category:hover:not(.active):not(.completed) .progress-category-label {
    color: #A78BFA;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.progress-category.active .progress-category-label {
    /* Active state - Full purple text */
    color: #5A4FCF;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(90, 79, 207, 0.3), 0 0 6px rgba(255, 255, 255, 0.8);
}

.progress-category.completed .progress-category-label {
    /* Completed state - Medium purple text */
    color: #7C3AED;
    font-weight: 650;
    text-shadow: 0 1px 3px rgba(124, 58, 237, 0.3);
}

@media (max-width: 768px) {
    .app-header h1 {
        font-size: 2em;
    }
    
    .question-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .option {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .progress-categories {
        gap: 15px;
        padding: 15px;
    }
    
    .progress-category {
        min-width: 60px;
        padding: 12px;
    }
    
    .progress-category .zen-icon-wrapper {
        width: 52px;
        height: 52px;
        padding: 8px;
    }
    
    .progress-category-label {
        font-size: 0.75em;
    }
    
    .progress-category.completed::after {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: -6px;
        right: -6px;
    }
    
    .progress-category.active {
        transform: scale(1.1);
    }
    
    .progress-category:hover:not(.active):not(.completed) {
        transform: translateY(-1px);
    }
}