@charset "UTF-8";

/* ==========================================================================
   AI Interview Styles 
   ========================================================================== */

#particles-js { display: none; }
body { background: #0a0a12; }

/* ===== LAYOUT ===== */
.iv-app { max-width: 800px; margin: 0 auto; padding: 80px 24px 48px; position: relative; z-index: 1; }
.iv-screen { display: none; }
.iv-screen.active { display: block; animation: fadeSlide .4s ease; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== SCREEN 1: CATEGORY SELECT ===== */
.iv-hero { text-align: center; margin-bottom: 40px; }
.iv-hero-emoji { font-size: 48px; margin-bottom: 12px; }
.iv-sample-link { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 600; transition: opacity .2s; }
.iv-sample-link:hover { opacity: .7; }
.iv-hero h1 { font-size: clamp(22px, 4vw, 30px); font-weight: 900; margin-bottom: 8px; background: linear-gradient(135deg, #d4a84a, #e67e22); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.iv-hero p { font-size: 14px; color: var(--fg-dim); line-height: 1.7; }
.iv-section-label { font-size: 13px; font-weight: 700; color: var(--fg); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.iv-section-label .badge { font-size: 10px; background: rgba(212,168,74,.15); color: var(--accent); padding: 2px 10px; border-radius: 20px; font-weight: 600; }

.iv-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 40px; }
.iv-cat-card { background: #0e0e18; border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; cursor: pointer; transition: all .2s; display: flex; align-items: center; gap: 12px; }
.iv-cat-card:hover { border-color: var(--accent); background: rgba(212,168,74,.03); transform: translateY(-2px); }
.iv-cat-card.selected { border-color: var(--accent); background: rgba(212,168,74,.06); box-shadow: 0 0 0 1px var(--accent); }
.iv-cat-icon { font-size: 24px; flex-shrink: 0; }
.iv-cat-info { flex: 1; min-width: 0; }
.iv-cat-name { font-size: 13px; font-weight: 700; color: var(--fg); }
.iv-cat-desc { font-size: 11px; color: var(--fg-dim); margin-top: 2px; }

.iv-start-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 16px; background: linear-gradient(135deg, #e67e22, #f39c12); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; transition: all .2s; letter-spacing: 1px; opacity: .4; pointer-events: none; }
.iv-start-btn.enabled { opacity: 1; pointer-events: auto; }
.iv-start-btn.enabled:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(230,126,34,.3); }

/* Past Interviews */
.iv-past-list { margin-top: 40px; }
.iv-past-card { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: #0e0e18; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all .15s; text-decoration: none; color: inherit; }
.iv-past-card:hover { border-color: var(--accent); background: rgba(212,168,74,.03); }
.iv-past-status { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.iv-past-status.draft { background: rgba(245,158,11,.12); color: #f59e0b; }
.iv-past-status.published { background: rgba(34,197,94,.12); color: #22c55e; }
.iv-past-title { font-size: 13px; font-weight: 600; color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-past-date { font-size: 11px; color: var(--fg-dim); flex-shrink: 0; }
.iv-past-empty { text-align: center; padding: 32px; color: var(--fg-dim); font-size: 13px; }

/* ===== SCREEN 2: CHAT ===== */
.iv-chat-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: #0e0e18; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 20px; }
.iv-chat-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #e67e22, #f39c12); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.iv-chat-header-info { flex: 1; }
.iv-chat-header-name { font-size: 13px; font-weight: 700; color: var(--fg); }
.iv-chat-header-sub { font-size: 11px; color: var(--fg-dim); }
.iv-chat-progress { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.iv-chat-progress-bar { width: 80px; height: 4px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.iv-chat-progress-fill { height: 100%; background: linear-gradient(90deg, #e67e22, #f39c12); border-radius: 4px; transition: width .5s ease; }
.iv-chat-progress-text { font-size: 11px; color: var(--fg-dim); font-weight: 600; white-space: nowrap; }

.iv-chat-messages { min-height: 300px; max-height: 50vh; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.iv-msg { max-width: 85%; padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.7; animation: msgPop .3s ease; }
@keyframes msgPop { from { opacity: 0; transform: scale(.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.iv-msg.ai { align-self: flex-start; background: #16162a; border: 1px solid var(--border); color: var(--fg-muted); border-bottom-left-radius: 4px; }
.iv-msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(212,168,74,.15), rgba(230,126,34,.1)); border: 1px solid rgba(212,168,74,.25); color: var(--fg); border-bottom-right-radius: 4px; }
.iv-msg.typing { align-self: flex-start; background: #16162a; border: 1px solid var(--border); padding: 14px 24px; }
.iv-typing-dots { display: flex; gap: 4px; }
.iv-typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-dim); animation: dotBounce 1.2s infinite; }
.iv-typing-dots span:nth-child(2) { animation-delay: .2s; }
.iv-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }

/* Voice & Text Input Area */
.iv-chat-input-wrap { display: flex; gap: 12px; margin-top: 16px; align-items: center; flex-direction: column; width: 100%; }

.iv-text-input-row { display: flex; gap: 12px; width: 100%; align-items: flex-end; background: #0e0e18; border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; transition: border-color 0.2s; }
.iv-text-input-row:focus-within { border-color: var(--accent); }
.iv-text-input { flex: 1; background: transparent; border: none; color: var(--fg); font-size: 14px; font-family: inherit; resize: none; min-height: 44px; max-height: 120px; outline: none; padding: 12px 0; line-height: 1.5; overflow-y: auto; }
.iv-submit-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; flex-shrink: 0; color: #000; font-size: 18px; }
.iv-submit-btn:disabled { opacity: 0.4; pointer-events: none; background: var(--border); }
.iv-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(212,168,74,0.3); }

.iv-voice-area { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; margin-top: 8px; }
.iv-voice-btn { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #6366f1); border: none; color: #fff; font-size: 24px; cursor: pointer; transition: all .3s; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.iv-voice-btn:hover { transform: scale(1.08); box-shadow: 0 4px 20px rgba(99,102,241,.4); }
.iv-voice-btn.recording { background: linear-gradient(135deg, #ef4444, #dc2626); animation: voicePulse 1.2s ease-in-out infinite; width: 64px; height: 64px; font-size: 28px; }
@keyframes voicePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); } 50% { box-shadow: 0 0 0 14px rgba(239,68,68,0); } }
.iv-voice-btn:disabled { opacity: .3; pointer-events: none; }
.iv-voice-hint { text-align: center; font-size: 12px; color: var(--fg-dim); opacity: .6; }
.iv-voice-status { text-align: center; font-size: 13px; color: #ef4444; font-weight: 600; animation: fadeSlide .3s ease; }
.iv-voice-transcript { width: 100%; padding: 14px 18px; background: rgba(59,130,246,.05); border: 1px solid rgba(59,130,246,.2); border-radius: 12px; color: #60a5fa; font-size: 14px; line-height: 1.6; min-height: 40px; display: none; word-wrap: break-word; font-weight: 500; }
.iv-voice-transcript.visible { display: block; }

/* Editable user messages */
.iv-msg.user { cursor: pointer; position: relative; }
.iv-msg.user:hover::after { content: '✏️'; position: absolute; top: -8px; right: -8px; font-size: 14px; background: #1e1e36; border: 1px solid var(--border); border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.iv-msg.editing { border: 1px solid var(--accent); cursor: default; }
.iv-msg.editing:hover::after { display: none; }
.iv-msg-edit-area { width: 100%; background: transparent; border: none; color: var(--fg); font-size: 14px; font-family: inherit; resize: none; outline: none; line-height: 1.6; overflow: hidden; }
.iv-msg-edit-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.iv-msg-edit-btn { padding: 4px 12px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; border: none; transition: all .15s; }
.iv-msg-edit-btn.save { background: var(--accent); color: #000; }
.iv-msg-edit-btn.cancel { background: transparent; border: 1px solid var(--border); color: var(--fg-dim); }

.iv-generate-btn { display: none; width: 100%; padding: 16px; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; transition: all .2s; margin-top: 16px; letter-spacing: 1px; }
.iv-generate-btn.visible { display: block; animation: fadeSlide .4s ease; }
.iv-generate-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(34,197,94,.3); }

/* ===== SCREEN 3: PREVIEW ===== */
.iv-preview-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.iv-preview-back { padding: 8px 14px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--fg-dim); font-size: 12px; cursor: pointer; transition: all .15s; }
.iv-preview-back:hover { border-color: var(--accent); color: var(--accent); }
.iv-preview-title-label { font-size: 14px; font-weight: 700; color: var(--fg); flex: 1; }

.iv-preview-card { background: #0e0e18; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
.iv-preview-hero-wrap { position: relative; width: 100%; min-height: 200px; background: rgba(212,168,74,.05); display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; transition: background .2s; }
.iv-preview-hero-wrap:hover { background: rgba(212,168,74,.1); }
.iv-preview-hero-wrap img { width: 100%; height: auto; max-height: 400px; object-fit: cover; display: block; }
.iv-preview-hero-placeholder { text-align: center; color: var(--fg-dim); font-size: 13px; padding: 20px; }
.iv-preview-hero-placeholder .icon { font-size: 36px; display: block; margin-bottom: 8px; }
.iv-preview-card-header { padding: 24px 32px 16px; border-bottom: 1px solid var(--border); }
.iv-preview-cat { font-size: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }
.iv-preview-title-input { width: 100%; padding: 0; background: transparent; border: none; color: var(--fg); font-size: clamp(20px, 3vw, 28px); font-weight: 800; font-family: 'Noto Serif JP', serif; line-height: 1.4; resize: none; overflow: hidden; min-height: 40px; display: block; word-break: break-all; }
.iv-preview-title-input:focus { outline: none; }
.iv-preview-title-input::placeholder { color: rgba(255,255,255,.2); }
.iv-preview-meta { display: flex; gap: 16px; font-size: 12px; color: var(--fg-dim); margin-top: 12px; align-items: center; flex-wrap: wrap; }
.iv-preview-meta .author-photo { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.iv-preview-meta a { color: var(--fg-dim); text-decoration: none; transition: color .2s; }
.iv-preview-meta a:hover { color: var(--accent); }
.iv-preview-body { padding: 32px; font-family: 'Noto Serif JP', serif; font-size: 15px; line-height: 2.4; color: var(--fg-muted); }
.iv-preview-body:focus { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.iv-preview-body h3 { font-family: 'Noto Sans JP', sans-serif; font-size: 17px; font-weight: 800; color: var(--accent); margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.iv-preview-body p { margin-bottom: 20px; }
.iv-preview-body blockquote { border-left: 3px solid var(--accent); padding: 12px 20px; margin: 20px 0; background: rgba(212,168,74,.04); border-radius: 0 8px 8px 0; font-style: italic; color: var(--fg); }
.iv-add-photo-bar { display: flex; align-items: center; justify-content: center; padding: 16px; border-top: 1px solid var(--border); }
.iv-add-photo-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: transparent; border: 1px dashed var(--border); border-radius: 8px; color: var(--fg-dim); font-size: 12px; cursor: pointer; transition: all .2s; }
.iv-add-photo-btn:hover { border-color: var(--accent); color: var(--accent); }
.iv-inline-images { padding: 0 32px 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.iv-inline-img { position: relative; width: 120px; height: 90px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.iv-inline-img img { width: 100%; height: 100%; object-fit: cover; }
.iv-inline-img .remove { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); border: none; color: #fff; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.iv-preview-actions { display: flex; gap: 10px; }
.iv-action-btn { flex: 1; padding: 14px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.iv-action-btn:hover { transform: translateY(-2px); }
.iv-action-btn.publish { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; border: none; box-shadow: 0 4px 16px rgba(34,197,94,.2); }
.iv-action-btn.publish:hover { box-shadow: 0 6px 24px rgba(34,197,94,.3); }
.iv-action-btn.draft { background: transparent; border: 1px solid var(--border); color: var(--fg-dim); }
.iv-action-btn.draft:hover { border-color: var(--accent); color: var(--accent); }
.iv-action-btn:disabled { opacity: .4; pointer-events: none; }

.iv-notice { padding: 12px 16px; background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2); border-radius: 8px; font-size: 12px; color: #93c5fd; line-height: 1.6; margin-top: 16px; }

/* Loading overlay */
.iv-loading { position: fixed; inset: 0; background: rgba(10,10,18,.85); z-index: 1000; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.iv-loading.active { display: flex; }
.iv-loading-spinner { width: 40px; height: 40px; border: 3px solid rgba(212,168,74,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iv-loading-text { font-size: 14px; color: var(--fg-dim); font-weight: 600; text-align: center; white-space: pre-line; }
.iv-loading-progress { width: 280px; margin-top: 8px; }
.iv-loading-progress-bar { height: 4px; background: rgba(212,168,74,.15); border-radius: 4px; overflow: hidden; }
.iv-loading-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #e67e22); border-radius: 4px; transition: width .5s ease; width: 0%; }
.iv-loading-progress-steps { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--fg-dim); }
.iv-loading-progress-steps .active { color: var(--accent); font-weight: 700; }
.iv-loading-progress-steps .done { color: #22c55e; }

/* Toast */
.iv-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: #16162a; border: 1px solid var(--border); padding: 12px 24px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--fg); z-index: 1100; transition: transform .3s ease; pointer-events: none; }
.iv-toast.show { transform: translateX(-50%) translateY(0); }
.iv-toast.success { border-color: rgba(34,197,94,.3); color: #22c55e; }
.iv-toast.error { border-color: rgba(239,68,68,.3); color: #ef4444; }

/* Login Modal */
.iv-modal { position: fixed; inset: 0; background: rgba(10,10,18,.9); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 24px; }
.iv-modal.active { display: flex; animation: fadeIn .3s ease; }
.iv-modal-content { background: #16162a; border: 1px solid var(--border); border-radius: 20px; padding: 40px 32px; max-width: 480px; width: 100%; text-align: center; }
.iv-modal-icon { font-size: 48px; margin-bottom: 16px; }
.iv-modal-title { font-size: 20px; font-weight: 800; color: var(--fg); margin-bottom: 12px; }
.iv-modal-text { font-size: 14px; color: var(--fg-muted); line-height: 1.8; margin-bottom: 32px; }
.iv-modal-actions { display: flex; gap: 12px; flex-direction: column; }
.iv-modal-btn { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 700; text-decoration: none; transition: all .2s; }
.iv-modal-btn.register { background: linear-gradient(135deg, #e67e22, #f39c12); color: #fff; border: none; }
.iv-modal-btn.register:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(230,126,34,.3); }
.iv-modal-btn.login { background: transparent; border: 1px solid var(--border); color: var(--fg-dim); }
.iv-modal-btn.login:hover { border-color: var(--accent); color: var(--accent); }
.iv-modal-close-link { display: inline-block; margin-top: 24px; font-size: 13px; color: var(--fg-dim); text-decoration: none; transition: color .2s; }
.iv-modal-close-link:hover { color: var(--fg); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .iv-app { padding: 64px 16px 32px; }
    .iv-cat-grid { grid-template-columns: 1fr; }
    .iv-msg { max-width: 92%; }
    .iv-preview-card-header { padding: 20px 18px 14px; }
    .iv-preview-body { padding: 20px 18px; }
    .iv-preview-actions { flex-direction: column; }
}

.iv-chat-back-btn { background:none;border:none;color:var(--fg-dim);font-size:20px;cursor:pointer;padding:4px 8px;margin-right:4px;transition:color .2s; }
.iv-chat-back-btn:hover { color:var(--accent); }

[hidden] { display: none !important; }
