/* Analysis Page Styles */
.analysis-container {
    max-width: 100%;
    margin: 75px auto 40px;
    padding: 20px 30px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.25);
}

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

.page-title-section {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #ffffff;
}

.page-title-section i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.page-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.page-subtitle {
    margin: 5px 0 0 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

/* Selection Cards */
.selection-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.selection-card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e8ecf1 100%);
    padding: 16px 20px;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.selection-card-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.selection-card-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.selection-card-header .badge {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.selection-card-body {
    padding: 20px;
}

/* Modern Select */
.modern-select {
    border: 2px solid #e8ecf1;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #ffffff;
}

.modern-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Patient Info Box */
.patient-info-box {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e8ecf1;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e8ecf1;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

/* Task Filter */
.task-filter-container {
    background: #f8fafc;
    border: 1px solid #e8ecf1;
    border-radius: 8px;
    padding: 12px 16px;
}

.task-filter-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.task-filter-header i {
    color: #667eea;
    font-size: 1rem;
}

.task-filter-header .btn-link {
    padding: 0;
    font-size: 0.85rem;
    text-decoration: none;
    margin-left: auto;
}

.task-filter-header .btn-link:first-of-type {
    margin-left: auto;
}

.task-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ffffff;
    border: 2px solid #e8ecf1;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.task-chip:hover {
    border-color: #667eea;
    background: #f0f4f8;
}

.task-chip.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    font-weight: 600;
}

.task-chip input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.task-chip-label {
    cursor: pointer;
}

/* Session Controls */
.session-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Session List */
.session-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.session-list::-webkit-scrollbar {
    width: 8px;
}

.session-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.session-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

/* Session Group */
.session-group-header {
    margin-bottom: 8px;
}

.session-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.session-group-toggle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
    transform: translateX(2px);
}

.session-group-toggle i {
    color: #667eea;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.session-group-title {
    flex: 1;
    font-weight: 700;
    color: #1e293b;
    font-size: 1rem;
    text-transform: capitalize;
}

.session-group-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #667eea;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 12px;
}

.session-group-content {
    margin-bottom: 16px;
    padding-left: 8px;
}

.session-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 2px solid #e8ecf1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.session-item:hover {
    background: #f0f4f8;
    border-color: #667eea;
    transform: translateX(4px);
}

.session-item.selected {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.session-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #667eea;
}

.session-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-date {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.session-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #64748b;
}

.session-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 8px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

/* Stat Card Compact */
.stat-card-compact {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e8ecf1;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
}

.stat-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon i {
    font-size: 1.5rem;
    color: #ffffff;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value-sm {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Chart Section */
.chart-section {
    margin-bottom: 24px;
}

.chart-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e8ecf1;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chart-card-header {
    background: #f8fafc;
    padding: 16px 20px;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-card-title i {
    font-size: 1.25rem;
}

.chart-card-title h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-card-body {
    padding: 20px;
    min-height: 500px;
    width: 100%;
}

.chart-card-body canvas {
    max-height: 600px !important;
    height: 550px !important;
    width: 100% !important;
}

/* Statistics Section */
.statistics-section {
    margin-top: 30px;
}

.comparison-table {
    font-size: 0.9rem;
}

.comparison-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #e8ecf1 100%);
}

.comparison-table thead th {
    font-weight: 600;
    color: #1e293b;
    border-bottom: 2px solid #667eea;
    padding: 12px;
}

.comparison-table tbody td {
    padding: 12px;
    vertical-align: middle;
}

.comparison-table tbody tr:hover {
    background: #f8fafc;
}

/* Color Indicators */
.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.bg-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.bg-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.bg-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.bg-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .analysis-container {
        margin: 70px auto 20px;
        padding: 10px;
    }

    .page-header {
        padding: 20px;
    }

    .page-title-section {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .page-title-section i {
        font-size: 2.5rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .session-controls {
        flex-direction: column;
    }

    .session-controls button {
        width: 100%;
    }

    .session-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .session-meta {
        flex-direction: column;
        gap: 4px;
    }

    .chart-card-body {
        padding: 14px;
        min-height: 250px;
    }

    .comparison-table {
        font-size: 0.8rem;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 8px;
    }
}

/* Keyboard key styling */
kbd {
    background-color: #1e293b;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.875rem;
    color: #e8ecf1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.analysis-container {
    animation: fadeIn 0.4s ease-out;
}

.session-item {
    animation: fadeIn 0.3s ease-out backwards;
}

.session-item:nth-child(1) { animation-delay: 0.05s; }
.session-item:nth-child(2) { animation-delay: 0.1s; }
.session-item:nth-child(3) { animation-delay: 0.15s; }
.session-item:nth-child(4) { animation-delay: 0.2s; }
.session-item:nth-child(5) { animation-delay: 0.25s; }
