/* GPT-4 Assistant Frontend Styles */

.gpt4-assistant-container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.gpt4-assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gpt4-assistant-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.gpt4-usage-indicator {
    display: flex;
    align-items: center;
}

.usage-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.usage-badge.unlimited {
    background: rgba(34, 197, 94, 0.3);
}

.gpt4-limit-reached {
    padding: 40px 24px;
    text-align: center;
}

.gpt4-limit-reached p {
    margin: 10px 0;
    font-size: 16px;
}

.gpt4-limit-reached .button {
    margin-top: 20px;
}

.gpt4-conversation-container {
    display: flex;
    flex-direction: column;
    height: 600px;
}

.gpt4-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8f9fa;
}

.gpt4-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

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

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

.user-message .message-avatar {
    background: #3b82f6;
    color: #fff;
}

.assistant-message .message-avatar {
    background: #667eea;
    color: #fff;
}

.message-content {
    flex: 1;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.assistant-message .message-content {
    background: #f1f3f5;
}

.message-content p {
    margin: 0;
    line-height: 1.6;
    color: #1f2937;
}

.gpt4-input-container {
    border-top: 1px solid #e5e7eb;
    padding: 20px 24px;
    background: #fff;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

#gpt4-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    resize: none;
    transition: border-color 0.2s;
}

#gpt4-input:focus {
    outline: none;
    border-color: #667eea;
}

.gpt4-send-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    align-self: flex-end;
}

.gpt4-send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.gpt4-send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-loading .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gpt4-clear-button {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.gpt4-clear-button:hover {
    color: #dc2626;
}

.usage-counter {
    font-size: 13px;
    color: #6b7280;
}

.gpt4-error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 24px;
    margin: 0 24px 20px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
}

.gpt4-assistant-login-required {
    max-width: 600px;
    margin: 40px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .gpt4-assistant-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
    }

    .gpt4-conversation-container {
        height: calc(100vh - 80px);
    }

    .input-wrapper {
        flex-direction: column;
    }

    .gpt4-send-button {
        width: 100%;
    }
}
