/* Initrode Phase 1 - Components CSS */
/* Chat Interface, Cards, and Interactive Elements */

/* === CHAT INTERFACE === */

#initrode-chat {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.chat-interface {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(16, 43, 95, 0.1);
    overflow: hidden;
}

.chat-welcome {
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.chat-welcome h2 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 2em;
}

.chat-welcome p {
    color: var(--light-gray);
    font-size: 1.1em;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

.chat-messages {
    padding: 30px;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--light-gray);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--blue);
}

.chat-message {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em;
    flex-shrink: 0;
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
}

.user-message {
    flex-direction: row-reverse;
}

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

.message-content {
    background: #F8FBFD;
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 70%;
    line-height: 1.6;
}

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

.message-content strong {
    color: var(--navy);
}

.user-message .message-content strong {
    color: var(--green);
}

.message-content em {
    font-style: italic;
}

/* Chat Input Area */
.chat-input-container {
    border-top: 1px solid var(--light-gray);
    padding: 20px;
    background: #F8FBFD;
}

.chat-suggestions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-btn {
    background: white;
    border: 1px solid var(--light-gray);
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--navy);
    font-weight: 500;
}

.suggestion-btn:hover {
    background: var(--green);
    color: white;
    border-color: var(--green);
    transform: translateY(-2px);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    font-size: 1em;
    font-family: 'Open Sans', sans-serif;
    resize: none;
    transition: border-color 0.3s;
    min-height: 50px;
    max-height: 150px;
}

#chat-input:focus {
    outline: none;
    border-color: var(--blue);
}

#chat-send {
    background: var(--green);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

#chat-send:hover {
    background: var(--blue);
    transform: scale(1.05);
}

#chat-send:active {
    transform: scale(0.95);
}

.chat-status {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
    padding: 0 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.status-dot.typing {
    background: var(--blue);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* === ADAPTIVE CARDS === */

#adaptive-cards {
    animation: fadeIn 0.6s ease-out;
}

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

/* === AGENT-OPTIMIZED CONTENT === */

#agent-optimized-content {
    animation: fadeIn 0.5s ease-out;
}

/* === RESPONSIVE CHAT === */

@media (max-width: 768px) {
    .chat-welcome {
        padding: 30px 20px;
    }
    
    .chat-welcome h2 {
        font-size: 1.6em;
    }
    
    .chat-welcome p {
        font-size: 1em;
    }
    
    .chat-messages {
        padding: 20px;
        min-height: 250px;
        max-height: 400px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .chat-suggestions {
        flex-direction: column;
    }
    
    .suggestion-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #initrode-chat {
        margin: 20px 10px;
    }
    
    .chat-interface {
        border-radius: 12px;
    }
    
    .chat-welcome {
        padding: 25px 15px;
    }
    
    .chat-welcome h2 {
        font-size: 1.4em;
    }
    
    .chat-messages {
        padding: 15px;
        min-height: 200px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    #chat-input {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    #chat-send {
        width: 45px;
        height: 45px;
    }
}

/* === LOADING STATES === */

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--blue);
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* === TOOLTIPS === */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--navy);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* === BADGES === */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--blue);
    color: white;
}

.badge-success {
    background: var(--green);
    color: white;
}

.badge-info {
    background: var(--light-gray);
    color: var(--navy);
}

/* === ALERTS === */

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(67, 176, 74, 0.1);
    border: 1px solid var(--green);
    color: var(--navy);
}

.alert-info {
    background: rgba(31, 131, 193, 0.1);
    border: 1px solid var(--blue);
    color: var(--navy);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #856404;
}

/* === MODALS === */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(16, 43, 95, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--navy);
}

/* === PROGRESS BAR === */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue) 0%, var(--green) 100%);
    transition: width 0.3s ease;
}

/* === SKELETON LOADERS === */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    border-radius: 4px;
    margin: 8px 0;
}

.skeleton-title {
    height: 24px;
    border-radius: 4px;
    width: 60%;
    margin: 12px 0;
}
