/* ===============================
   CHAT FAB & OVERLAY - CLAUDE STYLE
   =============================== */
#main-chat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #d97706;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1200;
    transition: all 0.2s ease;
}

#main-chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#main-chat-fab:active {
    transform: scale(0.95);
}

#main-chat-overlay {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 360px;
    height: 70vh;
    max-height: 520px;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #3a3a3a;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1200;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    padding: 14px 16px;
    background: #2a2a2a;
    color: #e5e5e5;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
}

.chat-header button {
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    font-size: 14px;
}

.chat-header button:hover {
    color: #e5e5e5;
}

.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
}

.chat-msg.sent {
    align-self: flex-end;
    background: #d97706;
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-right: 3px solid #ea580c;
    position: relative;
}

.chat-msg.sent::before {
    content: "You";
    font-weight: 600;
    font-size: 0.7rem;
    opacity: 0.9;
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-msg.received {
    align-self: flex-start;
    background: #2a2a2a;
    color: #e5e5e5;
    border-bottom-left-radius: 4px;
    border: 1px solid #3a3a3a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border-left: 3px solid #3a3a3a;
    position: relative;
}

.chat-msg.received::before {
    content: "Assistant";
    font-weight: 600;
    font-size: 0.7rem;
    opacity: 0.8;
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-input {
    display: flex;
    padding: 12px;
    background: #2a2a2a;
    border-top: 1px solid #3a3a3a;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px 16px;
    background: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid #3a3a3a;
    border-radius: 20px;
    outline: none;
}

.chat-input input::placeholder {
    color: #737373;
}

.chat-input input:focus {
    border-color: #d97706;
}

.chat-input button {
    background: none;
    border: none;
    color: #d97706;
    font-weight: 600;
    cursor: pointer;
}

#main-chat-overlay.fullscreen {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
}

/* ===============================
   LOG & REPORT PAGES - MODERN DESIGN
   =============================== */

/* Gradient Title - Claude Style */
.text-gradient {
    background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modern Cards - Claude Style */
.modern-card {
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    overflow: hidden;
    background: #2a2a2a;
    transition: all 0.2s ease;
    animation: fadeInUp 0.3s ease-out;
    color: #f5f5f5;
}

.modern-card:hover {
    transform: translateY(-2px);
    border-color: #d97706;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Card Headers - Claude Style */
.gradient-header {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid #d97706;
}

.gradient-header-dark {
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid #3a3a3a;
}

/* Upload Box - Claude Style */
.upload-box {
    padding: 2rem;
    border: 2px dashed #3a3a3a;
    border-radius: 12px;
    background: #2a2a2a;
    transition: all 0.2s ease;
    text-align: center;
}

.upload-box:hover {
    border-color: #d97706;
    background: #343434;
    transform: translateY(-2px);
}

/* Monospace Textarea - Claude Style */
.monospace-textarea {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    background: #1a1a1a;
    color: #e5e5e5;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    transition: all 0.2s ease;
    resize: vertical;
}

.monospace-textarea:focus {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Empty State */
.empty-state-box {
    padding: 5rem 2rem;
    text-align: center;
}

/* Modern Table Styling - Claude Style */
.modern-table {
    font-size: 0.9rem;
    background: #2a2a2a;
}

.modern-table thead {
    background: #1a1a1a;
    border-bottom: 1px solid #3a3a3a;
}

.modern-table thead th {
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    border: none;
}

.modern-table tbody tr {
    background: #2a2a2a;
}

.modern-table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #3a3a3a;
    color: #f5f5f5;
    background: transparent;
}

.modern-table tbody td.fw-semibold {
    color: #ffffff;
    font-weight: 600;
}

.table-row-hover {
    transition: all 0.2s ease;
    background: #2a2a2a;
}

.table-row-hover:hover {
    background: #343434 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Badge Custom - Claude Style */
.badge-custom {
    background: #3a3a3a;
    color: #e5e5e5;
    font-weight: 600;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Button Enhancements */
.btn-group .btn {
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background: #10b981;
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-success:hover {
    background: #059669;
}

.btn-info {
    background: #3b82f6;
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-info:hover {
    background: #2563eb;
}

.btn-danger {
    background: #ef4444;
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-primary {
    background: #d97706;
    border: none;
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary:hover {
    background: #ea580c;
}

/* ===============================
   CUSTOM MODAL SYSTEM (PROPER OVERLAY)
   =============================== */

/* Modal Backdrop - Dark overlay */
.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

/* Modal Container */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Dialog */
.custom-modal-dialog {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    position: relative;
}

.custom-modal-dialog-sm {
    max-width: 500px;
}

/* Modal Content - Claude Dark Theme */
.custom-modal-content {
    background: #2a2a2a;
    border-radius: 12px;
    border: 1px solid #3a3a3a;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* Modal Header - Claude Dark Theme */
.custom-modal-header {
    background: #1a1a1a;
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3a3a3a;
    flex-shrink: 0;
}

.custom-modal-header.bg-danger {
    background: #ef4444;
    color: #ffffff;
}

.custom-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: inherit;
}

/* Modal Close Button */
.custom-modal-close {
    background: transparent;
    border: 1px solid #3a3a3a;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.custom-modal-close:hover {
    background: #343434;
}

/* Modal Body - Claude Dark Theme with Scrolling */
.custom-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #1a1a1a;
    color: #f5f5f5;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.custom-modal-body::-webkit-scrollbar {
    width: 10px;
}

.custom-modal-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.custom-modal-body::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 5px;
}

.custom-modal-body::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Code Blocks in Modal */
.custom-modal-body pre {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.custom-modal-body code {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.custom-modal-body h1,
.custom-modal-body h2,
.custom-modal-body h3 {
    color: #ffffff;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.custom-modal-body p {
    margin-bottom: 1rem;
    color: #d4d4d4;
}

.custom-modal-body ul,
.custom-modal-body ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #d4d4d4;
}

/* Modal Footer - Claude Dark Theme */
.custom-modal-footer {
    background: #1a1a1a;
    padding: 1rem 1.5rem;
    border-top: 1px solid #3a3a3a;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-shrink: 0;
}

.custom-modal-footer .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 768px) {
    .custom-modal-dialog {
        max-width: 95%;
    }

    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding: 1rem;
    }

    .modern-card {
        border-radius: 12px;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .upload-box {
        padding: 1.5rem 1rem;
    }

    .empty-state-box {
        padding: 3rem 1rem;
    }
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

.shadow-sm {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.rounded-pill {
    border-radius: 50rem !important;
}

/* Smooth transitions for all interactive elements */
a, button, .btn, .card, .badge {
    transition: all 0.3s ease;
}

/* Focus states - Claude Style */
:focus-visible {
    outline: 2px solid #d97706;
    outline-offset: 2px;
}
