/**
 * Atina Conversational SDK Stylesheet
 * Premium Design System & Responsive UI Tokens
 */

:root {
    --atina-primary: #164085;
    --atina-primary-dark: #0f2f65;
    --atina-primary-light: rgba(22, 64, 133, 0.08);
    --atina-primary-light-border: rgba(22, 64, 133, 0.12);
    
    --atina-bg: #fafcff;
    --atina-card-bg: #ffffff;
    --atina-border: #dde3ec;
    
    --atina-text-dark: #101828;
    --atina-text-muted: #667085;
    --atina-text-white: #ffffff;
    
    --atina-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    --atina-shadow-lg: 0 10px 30px rgba(22, 64, 133, 0.06);
    --atina-radius: 5px;
    --atina-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#atina-root {
    position: relative;
    overflow: hidden;
}

/* =========================================
   CONTAINER
========================================= */

.atina-text-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: atinaFadeIn 0.35s ease;
    border-radius: var(--atina-radius);
    background: var(--atina-card-bg);
    border: 1px solid var(--atina-border);
}

.atina-chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    background: var(--atina-bg);
}

/* =========================================
   HEADER
========================================= */

.atina-chat-header {
    height: 65px;
    padding: 0 20px;
    background: var(--atina-card-bg);
    border-bottom: 1px solid var(--atina-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.atina-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.atina-status-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: atinaPulse 2s infinite;
}

.atina-header-title h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--atina-text-dark);
}

.atina-header-title small {
    display: block;
    color: var(--atina-text-muted);
    font-size: 11px;
    margin-top: 1px;
}

/* =========================================
   MESSAGES AREA
========================================= */

.atina-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
    background: var(--atina-bg);
}

.atina-msg-row {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    width: fit-content;
    animation: atinaMessageSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.atina-user-row {
    align-self: flex-end;
    margin-left: auto;
}

.atina-ai-row {
    align-self: flex-start;
    margin-right: auto;
}

.atina-msg-bubble {
    padding: 14px 18px;
    border-radius: var(--atina-radius);
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    box-shadow: var(--atina-shadow);
}

.atina-user-bubble {
    background: var(--atina-primary-light);
    border: 1px solid var(--atina-primary-light-border);
    color: var(--atina-text-dark);
    border-bottom-right-radius: 2px;
}

.atina-ai-bubble {
    background: var(--atina-card-bg);
    border: 1px solid var(--atina-border);
    color: var(--atina-text-dark);
    border-bottom-left-radius: 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.atina-msg-bubble p {
    margin: 0;
}

.atina-message-system {
    align-self: center;
    background: rgba(22, 64, 133, 0.04);
    border: 1px solid rgba(22, 64, 133, 0.06);
    color: var(--atina-text-muted);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    text-align: center;
    margin: 8px auto;
}

/* =========================================
   TYPING INDICATOR
========================================= */

.atina-typing-bubble {
    padding: 14px 20px !important;
}

.atina-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

.atina-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--atina-text-muted);
    border-radius: 50%;
    display: inline-block;
    opacity: 0.4;
    animation: atinaBounce 1.4s infinite ease-in-out both;
}

.atina-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.atina-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

/* =========================================
   ACTIONS
========================================= */

.atina-msg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--atina-border);
}

.atina-action-btn {
    border: none;
    background: rgba(22, 64, 133, 0.04);
    color: var(--atina-text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--atina-transition);
}

.atina-action-btn:hover {
    background: var(--atina-primary);
    color: white;
    transform: translateY(-1px);
}

/* =========================================
   RECOMMENDATIONS CHIPS
========================================= */

.atina-chat-recommendations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: var(--atina-card-bg);
    border-top: 1px solid var(--atina-border);
}

.atina-recommendation-chip {
    border: 1px solid var(--atina-border);
    background: var(--atina-card-bg);
    color: var(--atina-text-dark);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--atina-transition);
}

.atina-recommendation-chip:hover {
    background: var(--atina-primary-light);
    border-color: var(--atina-primary-light-border);
    color: var(--atina-primary);
    transform: translateY(-1px);
}

.atina-primary-chip {
    background: var(--atina-primary) !important;
    color: white !important;
    border-color: var(--atina-primary) !important;
}

.atina-primary-chip:hover {
    background: var(--atina-primary-dark) !important;
}

/* =========================================
   INPUT AREA
========================================= */

.atina-chat-input-area {
    padding: 16px 20px;
    background: var(--atina-card-bg);
    border-top: 1px solid var(--atina-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.atina-input-wrapper {
    width: 100%;
    background: var(--atina-bg);
    border: 1px solid var(--atina-border);
    border-radius: var(--atina-radius);
    box-shadow: var(--atina-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--atina-transition);
}

.atina-input-wrapper:focus-within {
    border-color: var(--atina-primary);
    background: var(--atina-card-bg);
    box-shadow: 0 0 0 3px rgba(22, 64, 133, 0.08);
}

.atina-chat-input-area textarea {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    resize: none;
    overflow-y: auto;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 14px 16px 10px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--atina-text-dark);
    transition: var(--atina-transition);
    box-shadow: none !important;
}

.atina-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(221, 227, 236, 0.7);
    background: transparent;
}

.atina-toolbar-left,
.atina-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.atina-upload-action,
.atina-mic-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: none;
    background: transparent;
    border-radius: var(--atina-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--atina-text-muted);
    transition: var(--atina-transition);
}

.atina-upload-action svg,
.atina-mic-btn svg,
.atina-send-btn svg {
    color: currentColor;
    fill: currentColor;
    stroke: currentColor;
    display: block;
}

.atina-upload-action:hover,
.atina-mic-btn:hover {
    background: var(--atina-primary-light);
    color: var(--atina-primary);
}

.atina-mic-recording {
    background: var(--atina-primary-light) !important;
    border-color: var(--atina-primary) !important;
    color: var(--atina-primary) !important;
}

.atina-send-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border: 1px solid var(--atina-border);
    background: var(--atina-bg);
    color: var(--atina-text-dark);
    border-radius: var(--atina-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--atina-transition);
}

.atina-send-btn:hover:not(:disabled) {
    background: var(--atina-primary-light);
    border-color: var(--atina-primary-light-border);
    color: var(--atina-primary);
}

.atina-send-btn:disabled {
    background: var(--atina-bg);
    color: var(--atina-text-muted);
    border-color: var(--atina-border);
    opacity: 0.5;
    cursor: not-allowed;
}

.atina-pulse {
    animation: atinaPulseSlow 1.5s infinite ease-in-out;
}

@keyframes atinaPulseSlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

/* =========================================
   FILE UPLOAD TAG
========================================= */

.atina-upload-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--atina-primary-light);
    border: 1px solid var(--atina-primary-light-border);
    border-radius: var(--atina-radius);
    padding: 8px 12px;
    width: fit-content;
    animation: atinaMessageSlide 0.25s ease;
}

.atina-upload-indicator i {
    color: var(--atina-primary);
    font-size: 13px;
}

.atina-upload-indicator span {
    font-size: 12px;
    font-weight: 600;
    color: var(--atina-primary);
}

.atina-btn-remove-file {
    border: none;
    background: transparent;
    color: var(--atina-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-left: 6px;
    line-height: 1;
}

/* =========================================
   ANIMATIONS
========================================= */

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

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

@keyframes atinaPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes atinaBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* =========================================
   RESPONSIVE OVERLAY
========================================= */

@media (max-width: 991px) {
    .atina-chat-messages {
        padding: 16px;
    }
    
    .atina-msg-row {
        max-width: 92%;
    }
}
