/* EyeLevel-Style Chat Viewer CSS */
/* Professional speech bubble interface matching PDF format */

:root {
    --primary-blue: #4A90E2;
    --vera-blue: #4A90E2;
    --customer-gray: #F5F5F5;
    --background-gray: #f8fafc;
    --border-gray: #e2e8f0;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --white: #ffffff;
    --black: #000000;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    background: #F0F4F8;
    color: #2C3E50;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-gray);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    color: #2C3E50;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-btn, .logout-btn {
    background: #4A90E2;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.admin-btn:hover, .logout-btn:hover {
    background: #357ABD;
}

.logout-btn {
    background: #dc3545;
}

.logout-btn:hover {
    background: #c82333;
}

/* Alert Messages */
.alert {
    padding: 12px 20px;
    margin: 20px 0;
    border-radius: 6px;
    font-weight: 500;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Chat Header */
.chat-header {
    background: var(--white);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-gray);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.back-btn, .print-btn {
    background: #4A90E2;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover, .print-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.back-btn:focus, .print-btn:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.print-btn {
    background: #28a745;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.print-btn:hover {
    background: #218838;
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.print-btn:focus {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

.session-info h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.session-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.session-details p {
    margin: 5px 0;
    font-size: 0.95rem;
}

        .client-badge {
            color: white;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
            white-space: nowrap;
            display: inline-block;
            max-width: 150px;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        /* Client-specific badge colors */
        .client-badge.client-dpc { background: #28a745; color: white; }
        .client-badge.client-isu-vdl { background: #dc3545; color: white; }
        .client-badge.client-zamira { background: #6f42c1; color: white; }
        .client-badge.client-ai-chicken-doctors--free-tier- { background: #fd7e14; color: white; }
        .client-badge.client-ai-chicken-doctors--paid-tier- { background: #e67e22; color: white; }
        .client-badge.client-hills-pet-nutrition { background: #20c997; color: white; }
        .client-badge.client-dr-fossums { background: #6610f2; color: white; }
        .client-badge.client-iacs { background: #e83e8c; color: white; }
        .client-badge.client-cvs-health { background: #dc3545; color: white; }
        .client-badge.client-bqc { background: #17a2b8; color: white; }
        .client-badge.client-the-standard { background: #343a40; color: white; }
        .client-badge.client-antelligence { background: #495057; color: white; }
        .client-badge.client-royal-canin { background: #ffc107; color: #000; }
        .client-badge.client-norbrook-main { background: #8e44ad; color: white; }
        .client-badge.client-splash-and-dash-for-dogs { background: #3498db; color: white; }
        .client-badge.client-pupwise { background: #2ecc71; color: white; }
        .client-badge.client-costco { background: #c0392b; color: white; }
        .client-badge.client-metlife { background: #34495e; color: white; }
        .client-badge.client-adventist-health { background: #16a085; color: white; }
        .client-badge.client-bideawee---adopters---staff { background: #9b59b6; color: white; }
        .client-badge.client-bideawee---fosters { background: #8e44ad; color: white; }
        .client-badge.client-cardiac-education-group { background: #e74c3c; color: white; }
        .client-badge.client-petmeds { background: #2c3e50; color: white; }
        .client-badge.client-rover { background: #e67e22; color: white; }
        .client-badge.client-merck-numelvi { background: #2980b9; color: white; }
        .client-badge.client-poultry-india-expo { background: #f39c12; color: white; }
        .client-badge.client-san-miguel-foods---poultry { background: #27ae60; color: white; }
        .client-badge.client-balto-usa { background: #8e44ad; color: white; }
        .client-badge.client-petpartners-onepackplan { background: #9b59b6; color: white; }
        .client-badge.client-onepack-plan { background: #9b59b6; color: white; }
        .client-badge.client-supertails { background: #17a2b8; color: white; }
        
        /* Default and Unknown Client styling */
        .client-badge.client-default { background: #343a40; color: white; }
        .client-badge.client-unknown-client { background: #000000; color: white; }
        
        /* Escalation Badge Styles */
        .escalation-badge {
            color: white;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            text-align: center;
            display: inline-block;
            min-width: 40px;
        }
        
        .escalation-badge.escalation-yes { 
            background: #28a745; 
            color: white; 
        }
        
        .escalation-badge.escalation-no { 
            background: #6c757d; 
            color: white; 
        }

/* Session List Styles */
.filters {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-form label {
    font-weight: 600;
    color: var(--text-dark);
}

.filter-form select {
    padding: 8px 15px;
    border: 2px solid var(--border-gray);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--white);
}

.session-list {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats {
    padding: 15px 25px;
    background: var(--background-gray);
    border-bottom: 1px solid var(--border-gray);
    font-weight: 600;
    color: var(--text-light);
}

.table-container {
    overflow-x: auto;
}

.sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.sessions-table th {
    background: var(--text-dark);
    color: var(--white);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sessions-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-gray);
    vertical-align: middle;
}

.session-row:hover {
    background: var(--background-gray);
}

.date-cell {
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-light);
}

.id-cell code {
    background: var(--background-gray);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-dark);
}

.view-chat-btn {
    background: #4A90E2;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 90px;
    text-align: center;
    white-space: nowrap;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
}

.view-chat-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.view-chat-btn:focus {
    outline: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.3);
}

/* Chat Message Styles - EyeLevel Format */
.chat-container {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.messages-header {
    background: var(--background-gray);
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-gray);
}

.messages-header h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.chat-messages {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
    background: linear-gradient(to bottom, #fafbfc, #f1f5f9);
}

/* Speech Bubble Styles */
.message-wrapper {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.vera-message {
    justify-content: flex-start;
    margin-left: 20px;
}

.customer-message {
    justify-content: flex-end;
    margin-right: 20px;
}

.message-bubble {
    max-width: 70%;
    position: relative;
    cursor: pointer;
}

/* Removed hover and selection effects for cleaner design */

/* VERA Messages (Left side, Blue) */
.vera-message .message-bubble {
    background: #4A90E2;
    color: white;
    border-radius: 20px 20px 20px 5px;
}

.vera-message .message-bubble::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #4A90E2;
    border-left: none;
}

/* Customer Messages (Right side, Light Gray) */
.customer-message .message-bubble {
    background: #F5F5F5;
    color: black;
    border-radius: 20px 20px 5px 20px;
}

.customer-message .message-bubble::before {
    content: '';
    position: absolute;
    right: -10px;
    bottom: 10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-left-color: #F5F5F5;
    border-right: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px 8px 18px;
    font-size: 14px;
    font-weight: bold;
}

.vera-message .message-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.customer-message .message-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.speaker-name {
    font-weight: bold;
    font-size: 14px;
}

.message-time {
    font-family: inherit;
    opacity: 0.8;
    margin-left: 15px;
}

.message-content {
    padding: 15px 18px;
    font-size: 1rem;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Message numbers removed per request */

/* Chat Footer */
.chat-footer {
    background: var(--white);
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.conversation-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.conversation-stats p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.export-options {
    display: flex;
    gap: 15px;
    align-items: center;
}

.export-btn {
    background: var(--vera-green);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.back-btn-footer {
    background: #4A90E2;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.back-btn-footer:hover {
    background: #357abd;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Professional Site Footer */
.site-footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 20px 30px;
    margin-top: 40px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.site-footer p {
    margin: 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.footer-links a:not(:last-child)::after {
    content: "|";
    margin-left: 20px;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .session-details {
        grid-template-columns: 1fr;
    }
    
    .message-bubble {
        max-width: 95%;
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .vera-message .message-bubble {
        border-radius: 16px 16px 16px 4px;
    }
    
    .customer-message .message-bubble {
        border-radius: 16px 16px 4px 16px;
    }
    
    .chat-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .site-footer {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 15px 20px;
    }
    
    .footer-links {
        gap: 15px;
    }
    
    .footer-links a:not(:last-child)::after {
        margin-left: 15px;
    }
    
    .conversation-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Better table responsiveness */
    .session-table {
        font-size: 13px;
    }
    
    .session-table th,
    .session-table td {
        padding: 8px 4px;
    }
    
    .client-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .view-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Stack table cells on very small screens */
    @media (max-width: 480px) {
        .session-table,
        .session-table thead,
        .session-table tbody,
        .session-table th,
        .session-table td,
        .session-table tr {
            display: block;
        }
        
        .session-table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }
        
        .session-table tr {
            border: 1px solid #ccc;
            margin-bottom: 10px;
            padding: 10px;
            border-radius: 8px;
        }
        
        .session-table td {
            border: none;
            position: relative;
            padding-left: 50%;
            text-align: left;
        }
        
        .session-table td:before {
            content: attr(data-label) ": ";
            position: absolute;
            left: 6px;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            font-weight: bold;
        }
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .chat-header, .chat-footer {
        break-inside: avoid;
    }
    
    .message-wrapper {
        break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .back-btn, .export-btn {
        display: none;
    }
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 2px solid var(--primary-blue);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 1000;
    display: none;
    font-size: 0.9rem;
}

.cookie-banner.show {
    display: block;
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.cookie-banner-text {
    flex: 1;
    color: var(--text-dark);
    line-height: 1.4;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cookie-accept-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.cookie-accept-btn:hover {
    background: #3a7bc8;
}

.cookie-privacy-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.cookie-privacy-link:hover {
    text-decoration: underline;
}

/* Responsive cookie banner */
@media (max-width: 768px) {
    .cookie-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .cookie-banner-text {
        margin-bottom: 5px;
    }
}

/* Privacy Policy Page */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.privacy-section {
    margin-bottom: 30px;
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.privacy-section h2 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-gray);
    padding-bottom: 8px;
}

.privacy-section h3 {
    color: var(--text-dark);
    margin: 20px 0 10px 0;
    font-size: 1.1rem;
}

.privacy-section ul {
    margin: 10px 0 15px 20px;
    line-height: 1.6;
}

.privacy-section li {
    margin-bottom: 5px;
    color: var(--text-dark);
}

.privacy-section p {
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.contact-info {
    background: var(--background-gray);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid var(--primary-blue);
}

.contact-info a {
    color: var(--primary-blue);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Enhanced Filter Styles */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 140px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.9rem;
}

.filter-group input[type="date"],
.filter-group input[type="text"],
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.filter-group input[type="text"]:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.filter-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
}

.filter-apply {
    background: #007bff;
    color: white;
}

.filter-apply:hover {
    background: #0056b3;
}

.filter-clear {
    background: #6c757d;
    color: white;
}

.filter-clear:hover {
    background: #545b62;
    text-decoration: none;
}

/* Chat Number Column */
.number-cell {
    width: 60px;
    text-align: center;
    font-weight: 600;
    color: #666;
}

/* Responsive filter adjustments */
@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        min-width: auto;
        width: 100%;
    }
    
    .filter-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Pagination Styles */
.pagination-container {
    margin: 30px 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-btn {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #007bff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    text-decoration: none;
    color: white;
}

.pagination-btn.disabled {
    background: #e9ecef;
    color: #6c757d;
    border-color: #e9ecef;
    cursor: not-allowed;
}

.pagination-current {
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-weight: 600;
    color: #495057;
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
    
    .pagination-btn {
        padding: 10px 16px;
        font-size: 0.95rem;
    }
}
/* Stacked date/time display for sessions table */
.date-time-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.3;
}

.date-part {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.time-part {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Client Feedback Styles */
.grade-cell, .comment-cell, .admin-reply-cell {
    text-align: center;
    vertical-align: middle;
}

.grade-select {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    width: 60px;
    cursor: pointer;
}

.grade-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.grade-display {
    font-weight: bold;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}

.grade-A { color: #28a745; background-color: #d4edda; }
.grade-B { color: #6f42c1; background-color: #e2d9f3; }
.grade-C { color: #fd7e14; background-color: #ffe8d4; }
.grade-D { color: #dc3545; background-color: #f8d7da; }
.grade-F { color: #fff; background-color: #dc3545; }

.comment-btn, .admin-reply-btn, .comment-view-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.comment-btn:hover, .admin-reply-btn:hover, .comment-view-btn:hover {
    background-color: #f8f9fa;
}

.icon-comment-filled { color: #007bff; }
.icon-comment-empty { color: #6c757d; }
.icon-reply-filled { color: #28a745; }
.icon-reply-empty { color: #6c757d; }

.no-comment {
    color: #6c757d;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-body {
    padding: 20px;
}

.modal-body textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.modal-footer {
    padding: 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

#viewCommentText {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile Responsive Styles for Feedback */
@media (max-width: 768px) {
    .grade-cell, .comment-cell, .admin-reply-cell {
        min-width: 80px;
    }
    
    .grade-select {
        width: 50px;
        font-size: 12px;
    }
    
    .comment-btn, .admin-reply-btn, .comment-view-btn {
        font-size: 18px;
        padding: 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px;
    }
    
    .modal-body textarea {
        min-height: 80px;
    }
}

@media (max-width: 480px) {
    .grade-select {
        width: 45px;
        font-size: 11px;
        padding: 2px 4px;
    }
    
    .comment-btn, .admin-reply-btn, .comment-view-btn {
        font-size: 16px;
        padding: 4px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}


/* Mobile-friendly export button */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .back-btn, .print-btn {
        padding: 16px 20px;
        font-size: 16px;
        height: 36px;
        display: flex;
        justify-content: center;
        align-items: center;
        touch-action: manipulation;
    }
    
    .print-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }
}

/* Loading state for export button */
.print-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}


/* Manual Ingestion Button Styles */
.ingestion-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 8px;
    transition: all 0.3s ease;
    height: 36px; /* Touch-friendly */
}

.ingestion-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.ingestion-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.ingestion-btn.loading {
    background: #17a2b8;
    position: relative;
}

.ingestion-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translateY(-50%);
}

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

/* Ingestion Status Bar */
.ingestion-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #17a2b8;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ingestion-status-bar.show {
    transform: translateY(0);
}

.ingestion-status-bar.success {
    background: #28a745;
}

.ingestion-status-bar.error {
    background: #dc3545;
}

.ingestion-status-bar .close-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ingestion-btn {
        padding: 0 16px;
        font-size: 16px;
        height: 36px;
        line-height: 36px;
    }
    
    .user-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .ingestion-status-bar {
        padding: 16px 20px;
        font-size: 16px;
    }
}

/* Admin navigation layout adjustment */
.user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-info {
    margin-right: 8px;
}

/* Change Password Button */
.change-password-btn {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

.change-password-btn:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

}


/* Subtle button styling improvements */
.admin-btn, .logout-btn, .ingestion-btn, .change-password-btn {
    height: 36px;
    line-height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    margin-right: 8px;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-controls .user-info {
    margin-right: 16px;
}


        /* Additional client badge styles for newly mapped clients */
        .client-badge.client-client-14052 { background: #007bff; color: white; }
        .client-badge.client-legacy-client-13800 { background: #6c757d; color: white; }
        .client-badge.client-client-14041 { background: #28a745; color: white; }
        .client-badge.client-client-13752 { background: #ffc107; color: #000; }
        .client-badge.client-client-14031 { background: #dc3545; color: white; }
        .client-badge.client-client-13887 { background: #6f42c1; color: white; }
        .client-badge.client-test-environment { background: #343a40; color: white; }
