/* Bible VerseLink Custom Styles */

/* Footer link hover effects */
.hover-link {
    transition: color 0.3s ease, opacity 0.3s ease;
}

.hover-link:hover {
    color: #007bff !important;
    opacity: 0.8;
}

/* Override minimal Bootstrap styles only when necessary */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Modern sleek card styling */
.card {
    border-radius: 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(33, 37, 41, 0.8) !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.card-header {
    border-radius: 1rem 1rem 0 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.card-body {
    border-radius: 0 0 1rem 1rem !important;
}

/* Custom progress bar styling */
.progress {
    border-radius: 0.5rem;
}

.progress-bar {
    border-radius: 0.5rem;
}

/* Code styling for phone numbers */
code {
    background-color: var(--bs-gray-800);
    color: var(--bs-info);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

/* Responsive table improvements */
.table-responsive {
    border-radius: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    /* Enable smooth scrolling */
    scroll-behavior: smooth;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #6c757d #343a40;
}

/* WebKit scrollbar styling for tables */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #343a40;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #6366f1 0%, #818cf8 100%);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Modern button styling */
.btn {
    border-radius: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

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

.btn-sm {
    border-radius: 0.5rem;
    padding: 0.375rem 1rem;
}

/* Card header improvements */
.card-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Footer styling */
footer {
    border-top: 1px solid var(--bs-border-color);
    margin-top: auto;
}

/* Loading spinner */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Forgot password link styling */
.forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #6366f1;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 1rem;
}

.forgot-password:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
    color: #7c3aed;
    transform: translateY(-1px);
    text-decoration: none;
}

.forgot-password i {
    font-size: 0.75rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Form control text color fixes for dark theme */
.form-control {
    color: white !important;
    background-color: var(--bs-dark) !important;
    border-color: var(--bs-secondary) !important;
}

/* Custom unread row styling for better readability in dark theme */
.unread-row {
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.15), rgba(252, 211, 77, 0.08)) !important;
    border-left: 3px solid #fbbf24 !important;
    transition: all 0.3s ease !important;
}

.unread-row:hover {
    background: linear-gradient(135deg, rgba(252, 211, 77, 0.25), rgba(252, 211, 77, 0.15)) !important;
    transform: translateX(2px) !important;
}

/* Ensure text remains readable in unread rows */
.unread-row td {
    color: #e2e8f0 !important;
}

.unread-row .text-muted {
    color: #cbd5e0 !important;
}

.unread-row .text-info {
    color: #63b3ed !important;
}

.unread-row .text-light {
    color: #f7fafc !important;
}

/* Admin table improvements */
.message-preview {
    line-height: 1.4;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
}

/* Better table spacing for admin tables */
.table-sm td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
}

.table-sm th {
    padding: 0.75rem;
    font-weight: 600;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* Improve button spacing in admin tables */
.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0.125rem;
}

/* Tier statistics cards improvements */
.tier-filter-card {
    transition: all 0.3s ease;
    border: 2px solid transparent !important;
}

.tier-filter-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.tier-filter-card.bg-secondary {
    background: linear-gradient(135deg, #495057, #6c757d) !important;
}

.tier-filter-card.bg-info {
    background: linear-gradient(135deg, #0dcaf0, #31d2f2) !important;
}

.tier-filter-card.bg-warning {
    background: linear-gradient(135deg, #ffc107, #ffcd39) !important;
    color: #000 !important;
}

.tier-filter-card.bg-warning * {
    color: #000 !important;
}

.tier-filter-card.bg-success {
    background: linear-gradient(135deg, #198754, #20c997) !important;
}

.tier-filter-card h4 {
    font-size: 2.5rem !important;
    font-weight: 800 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tier-filter-card p {
    font-weight: 600 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.tier-filter-card small {
    opacity: 0.9 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.tier-filter-card i {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Enhanced table styling for better horizontal scrolling */
.table-responsive table {
    min-width: 1000px; /* Ensure table has enough width to display all columns properly */
    white-space: nowrap; /* Prevent text wrapping in cells when scrolling */
}

/* Improved column sizing for admin tables */
.table-responsive .table th,
.table-responsive .table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 100px; /* Minimum width for each column */
}

/* Specific column width adjustments */
.table-responsive .table th:nth-child(1), /* Type column */
.table-responsive .table td:nth-child(1) {
    min-width: 120px;
    max-width: 120px;
}

.table-responsive .table th:nth-child(2), /* User column */
.table-responsive .table td:nth-child(2) {
    min-width: 200px;
    max-width: 250px;
}

.table-responsive .table th:nth-child(3), /* Keywords column */
.table-responsive .table td:nth-child(3) {
    min-width: 180px;
    max-width: 220px;
}

.table-responsive .table th:nth-child(4), /* Message Preview column */
.table-responsive .table td:nth-child(4) {
    min-width: 250px;
    max-width: 350px;
}

/* Allow text in message preview to show more content when scrolling */
.table-responsive .message-preview {
    white-space: normal;
    word-break: break-word;
    display: block;
    line-height: 1.3;
    max-height: none; /* Remove height restriction when in horizontal scroll */
    -webkit-line-clamp: none; /* Remove line clamping for better visibility */
}

/* Add visual indicator for horizontal scrollability */
.table-responsive::after {
    content: "← Scroll horizontally to see more →";
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    margin-top: -1px;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Hide scroll indicator when table is fully visible */
.table-responsive.no-scroll::after {
    display: none;
}

/* Responsive table improvements for admin */
@media (max-width: 1200px) {
    .table-responsive table {
        min-width: 900px;
    }
    
    .message-preview {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .table-responsive table {
        min-width: 800px;
        font-size: 0.8rem;
    }
    
    .table-sm td, .table-sm th {
        padding: 0.4rem 0.5rem;
    }
    
    .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    .tier-filter-card h4 {
        font-size: 2rem !important;
    }
}

.form-control:focus {
    color: white !important;
    background-color: var(--bs-dark) !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Placeholder text color */
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
}

.form-control::-webkit-input-placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
}

.form-control::-moz-placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
}

.form-control:-ms-input-placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
    opacity: 1 !important;
}

/* Modern badge styling */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

/* Sleek form controls */
.form-control {
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25),
                0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.1);
}

/* Message bubbles for chat-like interface */
.message-bubble {
    border-radius: 1.25rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.message-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

.message-user {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.8), rgba(13, 110, 253, 0.6));
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.message-ai {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.8), rgba(111, 66, 193, 0.6));
    border: 1px solid rgba(111, 66, 193, 0.3);
}

/* Statistics cards styling */
.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
    padding: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.25);
}

/* Enhanced alert styling */
.alert {
    border: none;
    border-radius: 0.875rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sleek progress bars */
.progress {
    border-radius: 1rem;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-bar {
    border-radius: 1rem;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-primary-rgb));
}

/* Modern input groups */
.input-group {
    border-radius: 0.75rem;
    overflow: hidden;
}

.input-group .form-control {
    border-right: none;
    border-radius: 0.75rem 0 0 0.75rem;
}

.input-group .btn {
    border-radius: 0 0.75rem 0.75rem 0;
    border-left: none;
}

/* Ensure all text on warning backgrounds is white */
.bg-warning {
    color: white !important;
}

.bg-warning * {
    color: white !important;
}

/* Enhanced message history readability */
.message-history {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 10px;
}

.message-history.modern-chat {
    scrollbar-width: thin;
    scrollbar-color: #6c757d #343a40;
}

.message-history::-webkit-scrollbar {
    width: 8px;
}

.message-history::-webkit-scrollbar-track {
    background: #343a40;
    border-radius: 4px;
}

.message-history::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1 0%, #818cf8 100%);
    border-radius: 4px;
}

/* Enhance conversation threads */
.conversation-thread {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.conversation-thread:last-child {
    border-bottom: none;
}

/* Message pair styling for better separation */
.message-pair {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.message-pair:last-child {
    border-bottom: none;
    padding-bottom: 10px;
}

.message-pair:first-child {
    padding-top: 10px;
}

/* Improve message bubble contrast */
.message-bubble.message-user {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.9), rgba(13, 110, 253, 0.7));
}

.message-bubble.message-ai {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.9), rgba(111, 66, 193, 0.7));
}

/* Better text readability */
.message-bubble p {
    color: white !important;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.message-bubble small {
    opacity: 0.9;
}

/* Dashboard response area styling */
#dashboardResponseArea .card {
    margin-top: 20px;
    animation: fadeIn 0.5s ease-in-out;
}

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

#dashboardResponseContent {
    font-size: 1.05rem;
    line-height: 1.7;
    color: white !important;
}

#dashboardResponseContent p {
    margin-bottom: 0.5rem;
    color: white !important;
}

/* Condensed Message List Styles */
.hover-bg {
    transition: all 0.3s ease;
}

.hover-bg:hover {
    background-color: rgba(255,255,255,0.1) !important;
    transform: translateX(5px);
}

.transition-icon {
    transition: transform 0.3s ease;
}

.message-list-item {
    transition: all 0.3s ease;
}

.grace-response {
    background: linear-gradient(135deg, rgba(111, 66, 193, 0.2), rgba(111, 66, 193, 0.1));
    border: 1px solid rgba(111, 66, 193, 0.3);
}

/* Enhanced Message Input Styling */
.message-input {
    text-align: center !important;
    font-size: 0.95rem !important;
    font-weight: 400;
    padding: 15px 20px !important;
    line-height: 1.4;
    transition: all 0.3s ease;
    overflow: hidden;
    resize: none;
    min-height: 56px;
    max-height: 200px;
}

.message-input:focus {
    text-align: left !important;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25) !important;
    border-color: rgba(99, 102, 241, 0.5) !important;
}

.message-input:not(:placeholder-shown) {
    text-align: left !important;
}

/* Position label exactly where text will appear */
.form-floating > .message-input ~ label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    color: #999;
    font-weight: 400;
    opacity: 0.8;
    pointer-events: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 2;
    line-height: 1.4;
}

/* Hide label when focused or has content */
.form-floating > .message-input:focus ~ label,
.form-floating > .message-input:not(:placeholder-shown) ~ label {
    opacity: 0;
    transform: translate(-50%, -60%);
}

.form-floating > .message-input::placeholder {
    color: transparent;
}

.form-floating > .message-input:focus::placeholder {
    color: transparent;
}
