/* Custom styles for Hog Production Management System */

/* Pink pig icons */
.bi-piggy-bank {
    color: #ff69b4 !important;
}

/* Smooth transitions */
.btn, .card, .alert {
    transition: all 0.2s ease-in-out;
}

/* Card hover effect */
.card:hover {
    transform: translateY(-2px);
}

/* Table row hover for better readability */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Badge styling improvements */
.badge {
    font-weight: 500;
}

/* Form control focus state */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

/* Navbar brand styling */
.navbar-brand {
    font-weight: 600;
}

/* Footer link styling */
footer a {
    color: rgba(255, 255, 255, 0.7);
}

footer a:hover {
    color: white;
}

/* Loading indicator for AJAX */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Inbox notification pulse */
.inbox-pulse {
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* =========================================================================
   Help Chat Widget
   ========================================================================= */

.help-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1080;
    padding: 0;
    border: none;
}

.help-fab:hover {
    transform: scale(1.08);
}

.help-panel {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1080;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.help-panel-header {
    background: #0d6efd;
    color: #fff;
    padding: 12px 16px;
    flex-shrink: 0;
}

.help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.help-panel-footer {
    padding: 10px 12px;
    border-top: 1px solid #dee2e6;
    flex-shrink: 0;
}

.help-msg {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.help-msg ol, .help-msg ul {
    margin: 4px 0;
    padding-left: 20px;
}

.help-msg pre {
    background: #f1f3f5;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 4px 0;
}

.help-msg code {
    font-size: 0.82rem;
}

.help-msg-user {
    align-self: flex-end;
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.help-msg-assistant {
    align-self: flex-start;
    background: #f1f3f5;
    color: #212529;
    border-bottom-left-radius: 4px;
}

/* Typing indicator */
.help-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
}

.help-typing .dot {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: help-bounce 1.2s infinite;
}

.help-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.help-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes help-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .help-panel {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 84px;
        height: 60vh;
    }

    .help-fab {
        right: 16px;
        bottom: 16px;
    }
}

/* Print styles */
@media print {
    .navbar, footer, .btn, .help-fab, .help-panel {
        display: none !important;
    }

    .card {
        border: 1px solid #dee2e6 !important;
        box-shadow: none !important;
    }
}
