/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8c0 50%, #7fcdcd 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 50%, #a7e0d4 100%);
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;        background: #26a69a;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.badge i {
    font-size: 1rem;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00695c 0%, #00897b 50%, #26a69a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Main Content */
.main-content {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 50%, #e0f2f1 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 2rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: linear-gradient(135deg, #f3e5f5 0%, #e8f5e8 50%, #e0f7fa 100%);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(178, 223, 219, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #26a69a, #00897b);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.cicd-icon {
    background: linear-gradient(135deg, #26a69a, #00897b);
}

.iac-icon {
    background: linear-gradient(135deg, #26a69a, #00695c);
}

.automation-icon {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item {
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
}

.question-item:hover {
    border-left-color: #26a69a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.question-item p {
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Chat Section */
.chat-section {
    margin-top: 3rem;
}

.chat-container {
    background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e8 50%, #e0f2f1 100%);
    border-radius: 16px;
    border: 1px solid rgba(178, 223, 219, 0.3);
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #26a69a, #00897b);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.chat-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.chat-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.chat-messages {
    padding: 1.5rem;
    background: white;
    scroll-behavior: smooth;
    /* Remove max-height to allow full content display */
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message:last-child {
    margin-bottom: 0;
}

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #26a69a, #00897b);
    color: white;
}

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

.user-message .message-avatar {
    background: #26a69a;
    color: white;
}

.message-content {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.message-content-wrapper {
    flex: 1;
}

.user-message .message-content {
    background: #eff6ff;
    border-color: #dbeafe;
}

.message-content p {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Message Actions (PDF Button) */
.message-actions {
    margin-top: 8px;
    display: flex;
    justify-content: flex-start;
}

.user-message .message-actions {
    justify-content: flex-end;
}

.save-pdf-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
    font-weight: 500;
    min-height: auto;
    height: auto;
    width: auto;
    max-width: 140px;
}

.save-pdf-btn:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.save-pdf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.save-pdf-btn i {
    font-size: 11px;
}

.chat-input-container {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
}

.chat-input {
    flex: 1;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #26a69a;
    box-shadow: 0 0 0 3px rgba(38, 166, 154, 0.1);
}

.send-button {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #26a69a, #00897b);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(38, 166, 154, 0.3);
}

.send-button:active {
    transform: translateY(0);
}

/* Loading Animation */
.typing-indicator {
    display: inline-block;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #26a69a;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Toast Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Chat History Controls */
.chat-history-controls {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.history-btn {
    background: linear-gradient(135deg, #26a69a, #00897b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.3);
}

.history-btn:active {
    transform: translateY(0);
}

.history-btn.clear-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.history-btn.clear-btn:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.history-btn.new-chat-btn {
    background: #059669;
}

.history-btn.new-chat-btn:hover {
    background: #047857;
}

.history-btn i {
    font-size: 13px;
}

/* History Modal */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.history-modal-content {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.history-modal-header h3 {
    color: #1f2937;
    font-size: 1.5rem;
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.history-conversation {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.history-timestamp {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.history-user-msg {
    margin-bottom: 1rem;
}

.history-user-msg strong {
    color: #1f2937;
}

.history-bot-msg strong {
    color: #26a69a;
}

.history-bot-msg {
    padding-left: 1rem;
    border-left: 3px solid #26a69a;
}

/* Chat History Modal Styles */
.chat-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.no-history {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

.history-conversation {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #26a69a;
}

.history-message {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.history-message.user {
    color: #1f2937;
}

.history-message.bot {
    color: #374151;
    padding-left: 1rem;
}

.history-message strong {
    font-weight: 600;
}

.history-timestamp {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    text-align: right;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn.close-btn {
    background: #6b7280;
    color: white;
}

.modal-btn.close-btn:hover {
    background: #4b5563;
}

/* Collapsible Response Styles for Chat History */
.user-prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.show-response-btn {
    background: #059669;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 10px;
    white-space: nowrap;
}

.show-response-btn:hover {
    background: #047857;
}

.show-response-btn i {
    margin-right: 4px;
}

.bot-response-container {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 3px solid #059669;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        overflow: visible;
    }
}

.response-content {
    line-height: 1.5;
    word-wrap: break-word;
}

/* Responsive modal */
@media (max-width: 768px) {
    .chat-history-modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}