/* ===== Base Styles ===== */
:root {
    --primary-color: #ff6b6b;
    --primary-hover: #ff5252;
    --secondary-color: #4ecdc4;
    --background: #1a1a2e;
    --surface: #16213e;
    --surface-light: #1f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-yellow: #ffd93d;
    --accent-green: #6bcb77;
    --accent-purple: #9b59b6;
    --accent-blue: #3498db;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,107,107,0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.kiro-mascot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.kiro-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--surface);
    padding: 10px;
    box-shadow: 0 4px 20px rgba(255,107,107,0.3);
    transition: var(--transition);
    animation: float 3s ease-in-out infinite;
}

/* Kiro mood variations based on selected model */
.kiro-icon.mood-claude {
    filter: hue-rotate(0deg);
    box-shadow: 0 4px 20px rgba(255,107,107,0.5);
}

.kiro-icon.mood-nova {
    filter: hue-rotate(180deg);
    box-shadow: 0 4px 20px rgba(78,205,196,0.5);
}

.kiro-icon.mood-titan {
    filter: hue-rotate(45deg);
    box-shadow: 0 4px 20px rgba(255,217,61,0.5);
}

.kiro-icon.mood-llama {
    filter: hue-rotate(270deg);
    box-shadow: 0 4px 20px rgba(155,89,182,0.5);
}

.kiro-icon.mood-mistral {
    filter: hue-rotate(210deg);
    box-shadow: 0 4px 20px rgba(52,152,219,0.5);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.kiro-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.speech-bubble {
    background: var(--accent-yellow);
    color: var(--background);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    position: relative;
    animation: bounce 2s ease-in-out infinite;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border: 10px solid transparent;
    border-right-color: var(--accent-yellow);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

/* ===== Countdown Timer ===== */
.countdown-timer {
    background: linear-gradient(135deg, rgba(255,107,107,0.15) 0%, rgba(78,205,196,0.15) 100%);
    border: 2px solid rgba(255,107,107,0.3);
    border-radius: 12px;
    padding: 15px 25px;
    margin: 15px auto;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.countdown-timer.urgent {
    border-color: var(--primary-color);
    animation: urgentPulse 1s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,107,107,0.3); }
    50% { box-shadow: 0 0 20px rgba(255,107,107,0.6); }
}

.countdown-timer.ended {
    background: rgba(128,128,128,0.2);
    border-color: rgba(128,128,128,0.3);
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.countdown-display {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.countdown-unit {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.countdown-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 2ch;
    text-align: right;
}

.countdown-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.countdown-deadline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.8;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* ===== Analytics Counter ===== */
.analytics-counter {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
    position: relative;
    z-index: 1;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.counter-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--accent-yellow), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.counter-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Progress Bar ===== */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--border-radius);
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--surface-light);
    transform: translateY(-50%);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: var(--transition);
}

.step.active .step-number,
.step.completed .step-number {
    background: var(--primary-color);
}

.step.completed .step-number {
    background: var(--accent-green);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.step.active .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Form Sections ===== */
.form-section {
    display: none;
    background: var(--surface);
    padding: 30px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease;
}

.form-section.active {
    display: block;
}

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

.form-section h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ===== Chips ===== */
.category-selector,
.problem-selector,
.idea-templates {
    margin-bottom: 30px;
}

.category-selector h3,
.problem-selector h3,
.idea-templates h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.category-chips,
.problem-chips,
.service-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    background: var(--surface-light);
    border: 2px solid transparent;
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    background: var(--surface);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.chip.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.chip.service-chip.selected {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.chip.other-service.selected {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

/* ===== AI Suggestion Section ===== */
.ai-suggestion-section {
    background: linear-gradient(135deg, rgba(155,89,182,0.1), rgba(78,205,196,0.1));
    border: 2px solid var(--accent-purple);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.ai-suggestion-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.ai-suggestion-section .hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-ai-suggest {
    background: linear-gradient(135deg, var(--accent-purple), #8e44ad);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ai-suggest:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(155,89,182,0.4);
}

.btn-ai-suggest:disabled {
    opacity: 0.9;
    cursor: wait;
    transform: none;
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px rgba(155,89,182,0.4); }
    50% { box-shadow: 0 0 25px rgba(155,89,182,0.8); }
}

.btn-ai-suggest .btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ai-suggest .btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ai-suggestion-result {
    margin-top: 20px;
    text-align: left;
}

.suggestion-card {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.suggestion-card h4 {
    background: var(--surface);
    padding: 15px 20px;
    font-size: 1rem;
}

.suggestion-content {
    padding: 20px;
    font-size: 0.95rem;
    line-height: 1.8;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* ===== Press Release Style for AI Suggestions ===== */
.suggestion-content.press-release {
    white-space: normal;
    padding: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.press-release-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.press-release-header .project-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.press-release-header .big-idea {
    font-size: 1.1rem;
    opacity: 0.95;
    line-height: 1.6;
}

.press-release-body {
    padding: 30px;
    color: #333;
}

.press-release-section {
    margin-bottom: 25px;
}

.press-release-section:last-child {
    margin-bottom: 0;
}

.press-release-section h5 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #667eea;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.press-release-section h5::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.press-release-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.press-release-section.vision-section {
    background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.press-release-section.impact-section {
    background: linear-gradient(135deg, rgba(255,107,107,0.08) 0%, rgba(255,142,83,0.08) 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.press-release-section.gameplan-section {
    background: linear-gradient(135deg, rgba(78,205,196,0.08) 0%, rgba(107,203,119,0.08) 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.press-release-footer {
    background: #f1f3f5;
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
}

.aws-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.aws-service-tag {
    background: linear-gradient(135deg, #ff9900 0%, #ff6600 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-use-suggestion {
    display: block;
    width: 100%;
    background: var(--secondary-color);
    color: var(--background);
    border: none;
    padding: 15px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-use-suggestion:hover {
    background: #45b7aa;
}

/* ===== Template Cards ===== */
.template-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.template-card {
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.template-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.template-card.selected {
    border-color: var(--secondary-color);
    background: rgba(78,205,196,0.1);
}

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

.template-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.template-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Form Groups ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.form-group .hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group select {
    cursor: pointer;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.char-count.warning {
    color: var(--accent-yellow);
}

.char-count.error {
    color: var(--primary-color);
}

.hidden {
    display: none !important;
}

/* Custom Problem Textarea */
#custom-problem {
    width: 100%;
    background: var(--surface-light);
    border: 2px solid var(--accent-purple);
    border-radius: var(--border-radius);
    padding: 15px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
    margin-top: 15px;
    transition: var(--transition);
}

#custom-problem:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255,107,107,0.2);
}

#custom-problem::placeholder {
    color: var(--text-secondary);
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary {
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,107,107,0.3);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 2px solid var(--surface-light);
}

.btn-secondary:hover {
    border-color: var(--secondary-color);
    background: transparent;
}

.btn-group {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 30px;
}

.next-btn {
    margin-left: auto;
}

/* ===== API Settings ===== */
.api-settings {
    background: var(--surface-light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 25px;
}

.bedrock-settings {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--surface);
}

/* Model selector for Bedrock */
.model-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.model-chip {
    background: var(--surface);
    border: 2px solid transparent;
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 120px;
}

.model-chip:hover {
    border-color: var(--secondary-color);
}

.model-chip.selected {
    border-color: var(--secondary-color);
    background: rgba(78,205,196,0.1);
}

.model-chip .model-name {
    font-weight: 500;
}

.model-chip .model-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ===== Translation Preview ===== */
.translation-preview {
    margin-bottom: 25px;
}

.translation-preview h3 {
    margin-bottom: 15px;
}

.preview-card {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.preview-header {
    background: var(--surface);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.preview-lang {
    font-weight: 500;
}

.preview-arrow {
    color: var(--secondary-color);
}

.preview-content {
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
    max-height: 200px;
    overflow-y: auto;
}

/* ===== Kiro Encouragement ===== */
.kiro-encouragement,
.kiro-celebration {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(78,205,196,0.1));
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 25px 0;
}

.kiro-small {
    width: 60px;
    height: 60px;
}

.kiro-large {
    width: 100px;
    height: 100px;
}

.kiro-encouragement p,
.kiro-celebration p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===== Result Cards ===== */
.result-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--surface-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.result-header {
    background: var(--surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h4 {
    font-size: 1rem;
}

.copy-btn {
    background: var(--secondary-color);
    border: none;
    color: var(--background);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    transform: scale(1.05);
}

.copy-btn.copied {
    background: var(--accent-green);
}

.result-content {
    padding: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.char-indicator {
    padding: 10px 20px;
    background: var(--surface);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.char-indicator.warning {
    color: var(--accent-yellow);
}

.char-indicator.error {
    color: var(--primary-color);
}

/* ===== Final Actions ===== */
.final-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.disclaimer {
    margin-top: 10px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ===== Loading State ===== */
.translate-btn .btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.translate-btn .btn-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.translate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-green);
    color: var(--background);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: var(--primary-color);
    color: white;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .kiro-mascot {
        flex-direction: column;
    }

    .speech-bubble::before {
        display: none;
    }

    .progress-bar {
        padding: 15px 10px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .step-number {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .form-section {
        padding: 20px;
    }

    .template-cards {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn-secondary,
    .btn-group .btn-primary {
        width: 100%;
    }

    .final-actions {
        flex-direction: column;
    }

    .kiro-encouragement,
    .kiro-celebration {
        flex-direction: column;
        text-align: center;
    }
}
