/**
 * Entry Screen Styles
 * 
 * Styling for the initial kAI-powered entry experience including:
 * - Entry screen container and layout
 * - Chat interface (messages, input, avatars)
 * - Template selection cards
 * - Understanding panel (showing extracted info)
 * - File upload components
 */

/* ===== ENTRY SCREEN ===== */

.entry-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 3000;
    overflow-y: auto;
}

.entry-screen.active {
    display: flex;
    flex-direction: column;
}

.entry-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.entry-container {
    flex: 1;
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    padding: 48px 32px;
    gap: 32px;
    align-items: stretch;
}

.entry-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
}

.entry-hero {
    text-align: center;
    margin-bottom: 32px;
    max-width: 700px;
}

.kai-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--purple-light) 100%);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
}

.kai-icon {
    font-size: 18px;
}

.entry-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.entry-subtitle {
    font-size: 16px;
    color: var(--gray-600);
    line-height: 1.6;
}

/* ===== CHAT SECTION ===== */

.chat-section {
    width: 100%;
    max-width: 700px;
    margin-bottom: 48px;
}

.chat-messages {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.chat-messages.active {
    display: block;
}

.chat-message {
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

.chat-message.kai {
    display: flex;
    gap: 12px;
    align-items: start;
}

.chat-message.user {
    display: flex;
    gap: 12px;
    align-items: start;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.message-avatar.kai {
    background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
}

.message-avatar.user {
    background: var(--gray-300);
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    font-size: 14px;
    line-height: 1.6;
    flex: 1;
}

.chat-message.user .message-content {
    background: var(--primary);
    color: white;
}

.file-extraction-notice {
    background: var(--blue-light);
    border-left: 3px solid var(--blue);
    padding: 10px 12px;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #1e40af;
}

/* ===== CHAT INPUT ===== */

.chat-input-wrapper {
    position: relative;
}

.chat-input-container {
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all 0.2s;
    box-shadow: var(--shadow-lg);
}

.chat-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-lg);
}

.chat-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 120px;
}

.chat-input::placeholder {
    color: var(--gray-400);
}

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.uploaded-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.file-chip.uploaded {
    background: var(--success-light);
    border-color: var(--success);
}

.file-icon {
    font-size: 16px;
}

.file-name {
    font-weight: 500;
    color: var(--gray-900);
}

.file-progress {
    font-size: 11px;
    color: var(--gray-600);
    font-weight: 600;
}

.file-chip-remove {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    color: var(--gray-500);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.file-chip-remove:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
    transform: scale(1.1);
}

.chat-send-btn {
    padding: 8px 20px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.chat-send-btn:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

/* ===== TEMPLATES SECTION ===== */

.templates-section {
    width: 100%;
    max-width: 700px;
    transition: all 0.3s ease;
    margin-bottom: 32px;
}

.templates-section.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
}

.templates-header {
    text-align: center;
    margin-bottom: 16px;
}

.templates-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.templates-subtitle {
    font-size: 13px;
    color: var(--gray-500);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.template-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.template-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.template-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.template-icon {
    font-size: 20px;
}

.template-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
}

.template-description {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.4;
}

/* ===== UNDERSTANDING PANEL ===== */

.understanding-panel {
    width: 380px;
    flex-shrink: 0;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 24px;
    display: none;
    flex-direction: column;
}

.understanding-panel.active {
    display: flex;
}

.understanding-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.understanding-icon {
    font-size: 20px;
}

.understanding-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.understanding-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.understanding-item {
    background: white;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transition: all 0.3s ease;
}

.understanding-item-content {
    flex: 1;
}

.understanding-item-remove {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.understanding-item-remove:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
    transform: scale(1.1);
}

.understanding-item-remove .remove-icon {
    font-weight: 700;
}

.understanding-item-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}

.understanding-item-value {
    font-size: 14px;
    color: var(--gray-900);
    font-weight: 500;
    line-height: 1.4;
}

/* Info tooltip */
.info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    margin-left: 6px;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--gray-700);
    font-size: 10px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.info-tooltip:hover .info-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.understanding-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-200);
}

.progress-label {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 6px;
}

.create-btn {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
}

.create-btn.ready {
    display: block;
}

.create-btn:hover {
    background: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
