/* Professional VoC Tool Styling with Enhanced Polish */
:root {
    --primary-teal: #14b8a6;
    --primary-teal-dark: #0f766e;
    --primary-teal-light: #5eead4;
    --primary-teal-bg: #f0fdfa;
    --secondary-teal: #0d9488;
    --accent-teal: #2dd4bf;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.95);

    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-subtle: rgba(226, 232, 240, 0.6);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Enhanced shadow system */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);

    /* Professional transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
    color: white;
    z-index: 1000;
    box-shadow: var(--shadow-2xl);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.logo i {
    font-size: 1.75rem;
    color: var(--primary-teal-light);
}

.logo .brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    transition: var(--transition-base);
}

.logo .brand-link:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0;
}

.sidebar-menu li {
    padding: 0.875rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    margin: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    position: relative;
    overflow: hidden;
}

.sidebar-menu li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-100%);
    transition: var(--transition-base);
}

.sidebar-menu li:hover::before {
    transform: translateX(0);
}

.sidebar-menu li:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.sidebar-menu li.active {
    background: rgba(255, 255, 255, 0.18);
    border-right: 3px solid var(--primary-teal-light);
    box-shadow: var(--shadow-lg);
}

.sidebar-menu li i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 2.5rem;
    background: transparent;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding: 2rem 0 1.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.header-left h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.7;
}

.widget-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 1rem;
    font-weight: 500;
    color: var(--primary-teal-dark);
    margin-top: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

.widget-status:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.dashboard-subtitle {
    color: #6b7280;
    font-size: 1.12rem;
    font-weight: 400;
    margin-bottom: 0;
}


.dashboard-card {
    background: #fff;
    box-shadow: 0 2px 16px 0 rgba(60,72,88,0.08);
    border-radius: 14px;
    padding: 32px 28px 28px 28px;
    border: 1px solid #ececec;
    min-width: 0;
    width: 100%;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transition: box-shadow 0.18s;
    position: relative;
    animation: fadein 0.7s;
    margin: 0;
    justify-content: flex-start;
    box-sizing: border-box;
    overflow: hidden;
}
@media (max-width: 900px) {
    .dashboard-card {
        padding: 22px 10px 22px 10px;
        min-height: 260px;
    }
}
.card-title.center {
    text-align: center;
}

.card-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: #23272f;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
@media (max-width: 700px) {
    .dashboard-card {
        padding: 18px 8px 18px 8px;
        margin-bottom: 18px;
    }
}


/* Stats Summary Header */
.stats-summary {
    display: flex;
    gap: 24px;
    margin: 0 auto 32px auto;
    max-width: 1100px;
    padding: 0 20px;
    box-sizing: border-box;
}

.stat-tile {
    flex: 1;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 1.25rem;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-teal), var(--accent-teal));
    transform: scaleX(0);
    transition: var(--transition-base);
}

.stat-tile:hover::before {
    transform: scaleX(1);
}

.stat-tile:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary-teal-light);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: var(--transition-base);
}

.stat-tile:hover .stat-icon::before {
    transform: translateX(100%);
}

.stat-icon.sentiment {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-icon.comments {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
    line-height: 1;
}

.stat-description {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
}

/* Report tile specific styling */
.report-tile .stat-content {
    align-items: center;
    text-align: center;
}

.report-btn {
    background: linear-gradient(135deg, #00C2A8 0%, #0f766e 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
    min-width: 160px;
}

.report-btn:hover {
    background: linear-gradient(135deg, #0f766e 0%, #00C2A8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 194, 168, 0.3);
}

.report-btn:active {
    transform: translateY(0);
}

.report-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.stat-icon.report {
    background: linear-gradient(135deg, #00C2A8, #0f766e);
    box-shadow: 0 4px 12px rgba(0, 194, 168, 0.3);
}

@media (max-width: 768px) {
    .stats-summary {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px;
    }

    .stat-tile {
        padding: 20px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Dashboard Cards */
.dashboard-card {
    background: var(--bg-glass);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    position: relative;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.02) 0%, rgba(13, 148, 136, 0.02) 100%);
    opacity: 0;
    transition: var(--transition-base);
    pointer-events: none;
    z-index: 1;
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
    border-color: var(--primary-teal-light);
}

.card-header {
    padding: 2rem 2rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(248, 250, 252, 0.8) 100%);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.01em;
}

.card-header h2 i {
    color: var(--primary-teal);
    font-size: 1.125rem;
    padding: 0.5rem;
    background: var(--primary-teal-bg);
    border-radius: 0.5rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

.card-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: var(--transition-fast);
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-teal);
    transform: scale(0);
    transition: var(--transition-base);
    border-radius: 0.75rem;
}

.btn-icon:hover::before {
    transform: scale(1);
}

.btn-icon:hover {
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-icon i {
    position: relative;
    z-index: 1;
}

.report-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}


/* Summary Content */
.summary-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-highlight {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-teal-bg) 0%, rgba(240, 253, 250, 0.5) 100%);
    border-radius: 1rem;
    border-left: 4px solid var(--primary-teal);
    font-size: 0.9rem;
    line-height: 1.7;
    position: relative;
    overflow: hidden;
}

.summary-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

/* Query Interface */
.query-interface {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 5;
}

.query-input-container {
    display: flex;
    gap: 0.5rem;
    position: relative;
    z-index: 10;
}

.query-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-medium);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    background: var(--bg-primary);
    transition: var(--transition-base);
    box-shadow: var(--shadow-xs);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.query-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
    transform: translateY(-1px);
    z-index: 20;
}

.query-submit {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.query-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: var(--transition-fast);
}

.query-submit:hover::before {
    transform: translateX(100%);
}

.query-submit:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.suggested-queries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggestion-pill {
    padding: 0.75rem 1.25rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.suggestion-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-teal), var(--accent-teal));
    transform: scale(0);
    transition: var(--transition-base);
    border-radius: 2rem;
}

.suggestion-pill:hover::before {
    transform: scale(1);
}

.suggestion-pill:hover {
    color: white;
    border-color: var(--primary-teal);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.suggestion-pill span {
    position: relative;
    z-index: 1;
}

.query-result {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-xs);
    backdrop-filter: blur(5px);
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--primary-teal);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.result-content {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Enhanced query result formatting */
.query-intro {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.query-list {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: disc;
}

.query-ordered-list {
    margin: 0;
    padding-left: 1.5rem;
    list-style-type: decimal;
}

.query-list li,
.query-ordered-list li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.query-list li:last-child,
.query-ordered-list li:last-child {
    margin-bottom: 0;
}

.query-ordered-list li strong {
    color: var(--text-primary);
    font-weight: 600;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-teal);
    font-style: italic;
}

.loading-indicator i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.error-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border-left: 3px solid #dc2626;
}


@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
#summarySection, #querySection {
    min-width: 0;
    margin-right: 0;
}
.summary-block, .result-block {
    background: #f7f8fa;
    padding: 20px 18px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    min-height: 110px;
    max-height: 220px;
    font-size: 1.08rem;
    color: #23272f;
    margin-bottom: 10px;
    overflow-y: auto;
    box-sizing: border-box;
    width: 100%;
    resize: none;
    font-family: inherit;
    line-height: 1.6;
    box-shadow: 0 1px 4px 0 rgba(60,72,88,0.03);
    transition: all 0.2s ease;
}

/* Summary text states */
.summary-text {
    transition: all 0.2s ease;
}

.summary-text.loading {
    color: #4b5563;
    font-style: italic;
    position: relative;
}

.summary-text.loading::after {
    content: '...';
    display: inline-block;
    width: 1em;
    overflow: hidden;
    vertical-align: bottom;
    animation: ellipsis 1.5s infinite steps(4, end);
}

@keyframes ellipsis {
    0% { width: 0.2em; }
    50% { width: 1em; }
    100% { width: 0.2em; }
}

.summary-text.error {
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #dc2626;
}
.summary-block:focus, .result-block:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}


h2 {
    color: #333;
    margin-bottom: 12px;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
}


.summary-box-wrapper {
    margin-bottom: 10px;
}

.summary-box {
    width: 100%;
    min-height: 90px;
    max-height: 180px;
    resize: vertical;
    font-size: 1rem;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    box-sizing: border-box;
}

.summary-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0;
}

.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 5px;
    padding: 9px 20px;
    border: none;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(60,72,88,0.03);
}
.btn-primary {
    background: #2563eb;
    color: #fff;
    border: 1px solid #2563eb;
}
.btn-primary:hover, .btn-primary:focus {
    background: #1743a2;
    color: #fff;
    box-shadow: 0 2px 8px 0 rgba(37,99,235,0.10);
}
.btn-secondary {
    background: #f7f8fa;
    color: #23272f;
    border: 1px solid #cbd5e1;
}



.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-control {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.status-message {
    margin: 8px 0 0 0;
    min-height: 24px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.status-message.success {
    color: #059669;
}

.status-message.error {
    color: #dc2626;
}

#generateDataBtn {
    align-self: flex-start;
    margin-top: 8px;
}

#generateDataBtn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    
    .form-control {
        padding: 8px 12px;
    }
}
.btn-secondary:hover, .btn-secondary:focus {
    background: #e5e7eb;
    color: #23272f;
}


.query-tool {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.query-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
#queryInput {
    flex: 1;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
#submitQuery {
    padding: 10px 18px;
    border-radius: 4px;
    background: #2563eb;
    color: #fff;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
#submitQuery:hover {
    background: #1743a2;
}
.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.btn-pill {
    padding: 7px 18px;
    border-radius: 999px;
    background: #f3f6fa;
    border: 1.5px solid #e5e7eb;
    color: #2563eb;
    font-size: 0.97rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border 0.18s;
}
.btn-pill:hover, .btn-pill:focus {
    background: #e7edfa;
    color: #1743a2;
    border-color: #2563eb;
}

.result-box {
    width: 100%;
    min-height: 70px;
    max-height: 150px;
    resize: vertical;
    font-size: 1rem;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: #fff;
    color: #222;
    box-sizing: border-box;
}


#issuesSection, #sentimentSection {
    margin-bottom: 32px;
}

#issuesChart {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    padding: 30px 40px;
    margin: 0 auto 8px auto;
    border-radius: 8px;
    box-shadow: none;
    border: none;
    min-height: 350px;
    box-sizing: border-box;
    overflow: visible;
}

#sentimentChart {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    padding: 0;
    margin: 0 auto 8px auto;
    border-radius: 8px;
    box-shadow: none;
    border: none;
    min-height: 160px;
    box-sizing: border-box;
    overflow: auto;
}

.error-message {
    color: #dc3545;
    text-align: center;
    margin-top: 10px;
    font-size: 0.99rem;
}

.fade-in {
    animation: fadein 0.7s;
}
@keyframes fadein {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}


#suggestedQuestions {
    margin-top: 20px;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
}

.suggestion:hover {
    background-color: #e0e0e0;
}

.suggestion:disabled {
    background-color: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

/* Comments Table Styles */
.comments-table-section {
    min-height: auto;
    max-height: none;
}

.comments-table-container {
    width: 100%;
    overflow: hidden;
}

.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-radius: 1rem;
    margin: 1rem;
}

.loading-state i {
    font-size: 1.5rem;
    color: var(--primary-teal);
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Enhanced Animations */
.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* Staggered animation for multiple elements */
.stats-summary .stat-tile:nth-child(1) { animation-delay: 0.1s; }
.stats-summary .stat-tile:nth-child(2) { animation-delay: 0.2s; }
.stats-summary .stat-tile:nth-child(3) { animation-delay: 0.3s; }

.dashboard-grid .dashboard-card:nth-child(1) { animation-delay: 0.1s; }
.dashboard-grid .dashboard-card:nth-child(2) { animation-delay: 0.2s; }
.dashboard-grid .dashboard-card:nth-child(3) { animation-delay: 0.3s; }
.dashboard-grid .dashboard-card:nth-child(4) { animation-delay: 0.4s; }

.table-info {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
}

.comments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 800px;
}

.comments-table th {
    background: #f8fafc;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    font-size: 0.8rem;
}

.comments-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    max-width: 200px;
    word-wrap: break-word;
}

.comments-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.comments-table tbody tr:hover {
    background: #f1f5f9;
}

.comment-text {
    max-width: 300px;
    word-wrap: break-word;
    white-space: normal;
    color: #374151;
    line-height: 1.4;
}

.sentiment-score {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    min-width: 50px;
}

.sentiment-positive {
    background: #dcfce7;
    color: #166534;
}

.sentiment-negative {
    background: #fef2f2;
    color: #dc2626;
}

.sentiment-neutral {
    background: #f3f4f6;
    color: #374151;
}

.sample-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.date-cell {
    white-space: nowrap;
    color: #6b7280;
    font-size: 0.8rem;
}



.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 16px;
}

.pagination-controls button {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#pageInfo {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Time Filter */
.time-filter {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: 0.375rem;
    font-size: 0.75rem;
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-summary {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .top-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .stats-summary {
        flex-direction: column;
        gap: 16px;
        padding: 0 16px;
    }

    .stat-tile {
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .comments-table {
        font-size: 0.75rem;
        min-width: 600px;
    }

    .comments-table th,
    .comments-table td {
        padding: 8px 4px;
    }

    .comment-text {
        max-width: 150px;
    }
}

/* Delete Button Styles */
.actions-cell {
    text-align: center;
    width: 80px;
}

.btn-delete {
    background: var(--error);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-delete:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-delete i {
    font-size: 0.875rem;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-teal);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    animation: slideInRight 0.3s ease-out;
}

.notification-success {
    border-left-color: var(--success);
}

.notification-error {
    border-left-color: var(--error);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.notification-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
