/* IVY Tutor Public Styles */

/* Tutor Widget */
.ivy-tutor-widget {
    position: fixed;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ivy-tutor-widget.ivy-open {
    transform: translateY(0);
    opacity: 1;
}

.ivy-position-bottom-right {
    bottom: 90px;
    right: 20px;
}

.ivy-position-bottom-left {
    bottom: 90px;
    left: 20px;
}

.ivy-widget-header {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ivy-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ivy-header-content {
    flex: 1;
}

.ivy-header-content h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ivy-status {
    font-size: 12px;
    opacity: 0.9;
}

.ivy-minimize,
.ivy-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.ivy-minimize:hover,
.ivy-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.ivy-chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f6f7f7;
}

.ivy-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ivy-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.ivy-message-user {
    align-self: flex-end;
}

.ivy-message-assistant {
    align-self: flex-start;
}

.ivy-message-content {
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
}

.ivy-message-user .ivy-message-content {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ivy-message-assistant .ivy-message-content {
    background: #fff;
    border-bottom-left-radius: 4px;
}

.ivy-message-time {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    padding: 0 8px;
}

.ivy-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 12px;
    width: fit-content;
}

.ivy-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: ivyTyping 1.4s infinite;
}

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

.ivy-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ivyTyping {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

.ivy-quick-actions {
    padding: 12px 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ivy-quick-btn {
    background: #f0f6fc;
    border: 1px solid #dfe5eb;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.ivy-quick-btn:hover {
    background: #e8f2fc;
    border-color: #2271b1;
}

.ivy-input-container {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    align-items: flex-end;
    border-radius: 0 0 12px 12px;
}

.ivy-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
}

.ivy-input:focus {
    outline: none;
    border-color: #2271b1;
}

.ivy-send-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ivy-send-btn:hover {
    background: #135e96;
}

.ivy-send-btn:disabled {
    background: #ddd;
    cursor: not-allowed;
}

/* Toggle Button */
.ivy-widget-toggle {
    position: fixed;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ivy-widget-toggle:hover {
    transform: scale(1.1);
}

.ivy-widget-toggle.ivy-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ivy-widget-toggle.ivy-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ivy-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #d63638;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 480px) {
    .ivy-tutor-widget {
        width: 100%;
        height: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
    }
    
    .ivy-widget-header {
        border-radius: 0;
    }
    
    .ivy-input-container {
        border-radius: 0;
    }
}
