/**
 * Sisyphus AI Assistant Styles
 */

/* ==================== MODAL OVERLAY ==================== */

.sisyphus-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    padding-bottom: 20px;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sisyphus-modal.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== MODAL CONTENT ==================== */

.sisyphus-modal-content {
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.sisyphus-modal.active .sisyphus-modal-content {
    transform: translateY(0) scale(1);
}

/* Mobile: full screen */
@media (max-width: 480px) {
    .sisyphus-modal {
        padding: 0;
        padding-bottom: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .sisyphus-modal-content {
        width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ==================== HEADER ==================== */

.sisyphus-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.sisyphus-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sisyphus-avatar svg {
    width: 24px;
    height: 24px;
}

.sisyphus-title {
    flex: 1;
}

.sisyphus-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sisyphus-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.sisyphus-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sisyphus-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== MESSAGES ==================== */

.sisyphus-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    min-height: 200px;
    max-height: 350px;
}

.sisyphus-message {
    max-width: 85%;
    animation: sisyphusMessageIn 0.3s ease;
}

@keyframes sisyphusMessageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sisyphus-message.user {
    align-self: flex-end;
}

.sisyphus-message.assistant {
    align-self: flex-start;
}

.sisyphus-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.sisyphus-message.user .sisyphus-message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.sisyphus-message.assistant .sisyphus-message-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.sisyphus-message-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.sisyphus-message-content li {
    margin: 4px 0;
}

/* ==================== TYPING INDICATOR ==================== */

.sisyphus-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #f8fafc;
}

.sisyphus-typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: sisyphusTyping 1.4s infinite both;
}

.sisyphus-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.sisyphus-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes sisyphusTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ==================== INPUT AREA ==================== */

.sisyphus-input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.sisyphus-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.sisyphus-input:focus {
    outline: none;
    border-color: #6366f1;
}

.sisyphus-input::placeholder {
    color: #94a3b8;
}

.sisyphus-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.sisyphus-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sisyphus-send:active {
    transform: scale(0.95);
}

.sisyphus-send svg {
    width: 18px;
    height: 18px;
}

/* ==================== FOOTER ==================== */

.sisyphus-footer {
    padding: 8px 16px 12px;
    background: white;
    text-align: center;
}

.sisyphus-clear-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.sisyphus-clear-btn:hover {
    color: #64748b;
}

/* ==================== SCROLLBAR ==================== */

.sisyphus-messages::-webkit-scrollbar {
    width: 6px;
}

.sisyphus-messages::-webkit-scrollbar-track {
    background: transparent;
}

.sisyphus-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sisyphus-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== DARK MODE SUPPORT ==================== */

@media (prefers-color-scheme: dark) {
    .sisyphus-modal-content {
        background: #1e293b;
    }

    .sisyphus-messages {
        background: #0f172a;
    }

    .sisyphus-message.assistant .sisyphus-message-content {
        background: #334155;
        color: #f1f5f9;
        border-color: #475569;
    }

    .sisyphus-input-area {
        background: #1e293b;
        border-top-color: #334155;
    }

    .sisyphus-input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .sisyphus-input::placeholder {
        color: #64748b;
    }

    .sisyphus-footer {
        background: #1e293b;
    }

    .sisyphus-typing {
        background: #0f172a;
    }
}
