/**
 * Finance Gateway Chatbot - Styles
 * Dark theme matching the main application design
 */

/* Chatbot Container */
#chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Button */
.chatbot-button {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #00ffff, #00cccc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.3);
    color: #0a0b0d;
    position: relative;
    overflow: hidden;
}

.chatbot-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 255, 0.4);
}

.chatbot-button.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

.chatbot-button-text {
    position: absolute;
    bottom: -8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: #1a1d21;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #2d3138;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #1a1d21 0%, #0f1419 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #2d3138;
    position: relative;
}

.chatbot-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ffff, #00cccc);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #00ffff, #00cccc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0b0d;
}

.chatbot-title {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.chatbot-status {
    color: #00ffff;
    font-size: 12px;
    font-weight: 500;
}

.chatbot-close {
    background: none;
    border: none;
    color: #a0a0a0;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #0a0b0d;
}

/* Custom Scrollbar */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #2d3138;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #3d4148;
}

/* Message Styles */
.chatbot-message {
    display: flex;
    gap: 8px;
    animation: messageSlideIn 0.3s ease;
}

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

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

.user-message .message-content {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    color: #0a0b0d;
    max-width: 80%;
}

.bot-message {
    justify-content: flex-start;
}

.bot-message .message-content {
    background: #1a1d21;
    border: 1px solid #2d3138;
    color: white;
    max-width: 85%;
}

.message-avatar {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #00ffff, #00cccc);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0b0d;
    flex-shrink: 0;
    margin-top: 4px;
}

.message-content {
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.4;
}

.message-text {
    word-wrap: break-word;
}

.message-text strong {
    color: #00ffff;
    font-weight: 600;
}

.message-text em {
    color: #a0a0a0;
    font-style: italic;
}

/* Message Actions */
.message-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.action-btn.primary {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    color: #0a0b0d;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #00cccc, #009999);
    transform: translateY(-1px);
}

.action-btn.info {
    background: transparent;
    color: #00ffff;
    border: 1px solid #00ffff;
}

.action-btn.info:hover {
    background: rgba(0, 255, 255, 0.1);
}

/* Typing Indicator */
.chatbot-typing {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0a0b0d;
    border-top: 1px solid #2d3138;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #00ffff;
    border-radius: 50%;
    animation: typingPulse 1.4s infinite;
}

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

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

@keyframes typingPulse {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.typing-text {
    color: #a0a0a0;
    font-size: 12px;
    font-style: italic;
}

/* Input Container */
.chatbot-input-container {
    padding: 16px;
    background: #1a1d21;
    border-top: 1px solid #2d3138;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
}

.chatbot-input-wrapper.focused {
    transform: translateY(-1px);
}

.chatbot-input {
    flex: 1;
    background: #0a0b0d;
    border: 1px solid #2d3138;
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.chatbot-input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.1);
}

.chatbot-input::placeholder {
    color: #6b7280;
}

.chatbot-send {
    background: linear-gradient(135deg, #00ffff, #00cccc);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #0a0b0d;
}

.chatbot-send:hover {
    background: linear-gradient(135deg, #00cccc, #009999);
    transform: translateY(-1px);
}

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

/* Quick Suggestions */
.chatbot-quick-suggestions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.suggestion-btn {
    background: transparent;
    border: 1px solid #2d3138;
    color: #a0a0a0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    border-color: #00ffff;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.05);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #chatbot-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .chatbot-button {
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        width: 100%;
        height: 80vh;
        max-height: 600px;
        bottom: 72px;
        right: 0;
        left: 0;
        margin: 0 auto;
    }

    .chatbot-messages {
        padding: 12px;
    }

    .message-content {
        font-size: 13px;
        padding: 10px 14px;
    }

    .chatbot-input-container {
        padding: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .chatbot-window,
    .chatbot-button,
    .chatbot-message,
    .action-btn,
    .chatbot-send {
        transition: none;
        animation: none;
    }

    .typing-indicator span {
        animation: none;
        opacity: 0.7;
    }
}

/* Focus styles for accessibility */
.chatbot-button:focus-visible,
.chatbot-close:focus-visible,
.chatbot-send:focus-visible,
.action-btn:focus-visible,
.suggestion-btn:focus-visible {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

.chatbot-input:focus-visible {
    outline: none; /* Already handled by border and box-shadow */
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chatbot-window {
        border: 2px solid #fff;
    }
    
    .message-content {
        border: 1px solid #fff;
    }
    
    .chatbot-input {
        border: 2px solid #fff;
    }
}

/* ========================================
   TIME SAVED FOOTER STYLES
   ======================================== */

/* Footer Container */
.time-saved-footer {
    background: linear-gradient(135deg, #1a1d21 0%, #0f1419 100%);
    border-top: 2px solid #00ffff;
    padding: 50px 20px 40px;
    margin-top: 60px;
    position: relative;
}

.time-saved-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #00cccc, #00ffff);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Time Saved Section */
.time-saved-section {
    text-align: center;
}

.footer-title {
    color: white;
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-title svg {
    color: #00ffff;
}

/* Time Counter */
.time-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0 30px;
    flex-wrap: wrap;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.counter-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #00ffff;
    background: linear-gradient(135deg, #00ffff, #00cccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    min-height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.counter-number.updating {
    transform: scale(1.1);
    filter: brightness(1.3);
}

.unit-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.time-separator {
    color: #00ffff;
    font-size: 2rem;
    font-weight: bold;
    opacity: 0.7;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 0.7; }
    51%, 100% { opacity: 0.3; }
}

/* Footer Text */
.footer-subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 400;
}

.footer-note {
    color: #6b7280;
    font-size: 0.9rem;
    font-style: italic;
}

/* Apps Stats */
.apps-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: rgba(0, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: #1a1d21;
    border-radius: 8px;
    border: 1px solid #2d3138;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.05);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #00ffff;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pulse Animation for Numbers */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.counter-number {
    animation: pulse 4s ease-in-out infinite;
}

.counter-number.milliseconds {
    font-size: 2.5rem;
    min-width: 100px;
    color: #00cccc;
    animation: pulse 2s ease-in-out infinite;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .time-saved-footer {
        padding: 40px 15px 30px;
        margin-top: 40px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }

    .time-counter {
        gap: 15px;
        margin: 30px 0 25px;
    }

    .time-unit {
        min-width: 70px;
    }

    .counter-number {
        font-size: 2.8rem;
        min-height: 2.8rem;
    }

    .counter-number.milliseconds {
        font-size: 2.2rem;
        min-width: 80px;
    }

    .time-separator {
        font-size: 1.5rem;
    }

    .apps-stats {
        flex-direction: row;
        gap: 15px;
        padding: 20px;
    }

    .stat-item {
        padding: 15px 10px;
        flex: 1;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .time-saved-footer {
        padding: 30px 10px 25px;
    }

    .footer-title {
        font-size: 1.5rem;
    }

    .time-counter {
        gap: 10px;
        margin: 25px 0 20px;
    }

    .time-unit {
        min-width: 60px;
    }

    .counter-number {
        font-size: 2.2rem;
        min-height: 2.2rem;
    }

    .counter-number.milliseconds {
        font-size: 1.8rem;
        min-width: 70px;
    }

    .time-separator {
        font-size: 1.2rem;
    }

    .unit-label {
        font-size: 0.8rem;
    }

    .footer-subtitle {
        font-size: 1rem;
    }

    .footer-note {
        font-size: 0.8rem;
    }

    .apps-stats {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .stat-item {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }
}

/* High contrast mode support for footer */
@media (prefers-contrast: high) {
    .time-saved-footer {
        border-top: 3px solid #fff;
    }
    
    .counter-number {
        color: #fff;
        text-shadow: none;
    }
    
    .stat-item {
        border: 2px solid #fff;
    }
}

/* Reduced motion for footer */
@media (prefers-reduced-motion: reduce) {
    .time-saved-footer::before,
    .counter-number,
    .time-separator,
    .stat-item {
        animation: none;
        transition: none;
    }
    
    .counter-number.updating {
        transform: none;
        filter: none;
    }
}