:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --text-color: #333;
    --light-text: #666;
    --bg-color: #fff;
    --light-bg: #f9fafb;
    --sidebar-bg: #1a202c;
    --sidebar-text: #e2e8f0;
    --border-color: #e5e7eb;
    --card-bg: #fff;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-bg);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

.sidebar-nav {
    padding: 1.5rem 0;
    flex-grow: 1;
}

.sidebar-nav ul li {
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.sidebar-nav ul li.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--primary-color);
}

.sidebar-nav ul li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
}

.sidebar-nav ul li a i {
    margin-right: 10px;
    font-size: 1.2rem;
}

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

.user-info {
    display: flex;
    align-items: center;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: var(--box-shadow);
    width: 400px;
}

.search-bar i {
    color: var(--light-text);
    margin-right: 10px;
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
}

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

.sync-button {
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
}

.sync-button:hover {
    background-color: var(--primary-dark);
}

.sync-button i {
    margin-right: 5px;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 1.2rem;
    color: var(--light-text);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ef4444;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dashboard Styles */
.dashboard h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.last-login {
    color: var(--light-text);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
}

.stat-details h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

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

.dashboard-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.case-analyzer {
    background-color: var(--bg-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5rem;
}

.analyzer-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.case-input {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Chat Container Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
}

.chat-header {
    padding: 1rem;
    background-color: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1rem;
}

.completeness-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--light-text);
}

.progress-bar {
    width: 100px;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: messageAppear 0.3s ease;
}

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

.message.ai {
    align-self: flex-start;
    background-color: var(--light-bg);
    color: var(--text-color);
    border-bottom-left-radius: 0;
}

.message.user {
    align-self: flex-end;
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0;
}

.message.thinking {
    align-self: flex-start;
    background-color: var(--light-bg);
    color: var(--light-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.thinking-dots {
    display: flex;
    gap: 3px;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: var(--light-text);
    border-radius: 50%;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

.message-time {
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.8;
    align-self: flex-end;
}

.message.ai .message-time {
    color: var(--light-text);
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    background-color: var(--light-bg);
}

.chat-input textarea {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    height: 40px;
    max-height: 120px;
    overflow-y: auto;
    transition: height 0.2s ease;
}

.chat-input textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.record-button, .upload-button, .send-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.record-button {
    background-color: #f3f4f6;
    color: var(--text-color);
}

.record-button:hover {
    background-color: #e5e7eb;
}

.record-button.recording {
    background-color: #ef4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.upload-button {
    background-color: #f3f4f6;
    color: var(--text-color);
}

.upload-button:hover {
    background-color: #e5e7eb;
}

.send-button {
    background-color: var(--primary-color);
    color: white;
}

.send-button:hover {
    background-color: var(--primary-dark);
}

.send-button:disabled {
    background-color: #e5e7eb;
    color: var(--light-text);
    cursor: not-allowed;
}

.analysis-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.analyze-button, .reset-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 5px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.analyze-button {
    background-color: var(--primary-color);
    color: white;
    flex: 1;
}

.analyze-button:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.analyze-button:disabled {
    background-color: #e5e7eb;
    color: var(--light-text);
    cursor: not-allowed;
}

.reset-button {
    background-color: #f3f4f6;
    color: var(--text-color);
}

.reset-button:hover {
    background-color: #e5e7eb;
}

.analyze-button i, .reset-button i {
    margin-right: 0.5rem;
}

.analysis-coverage {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1.2rem;
}

.analysis-coverage h4 {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.analysis-coverage p {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 1rem;
}

.code-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.code-type {
    font-size: 0.85rem;
    color: var(--light-text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.2rem;
}

.view-all {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.recent-sessions, .quick-actions {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item.sample-case {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
}

.history-item.sample-case .history-icon {
    color: #e6a100;
}

.history-item.sample-case:hover {
    background-color: rgba(255, 193, 7, 0.2);
}

.session-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--light-bg);
    transition: var(--transition);
}

.session-item:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.session-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.session-details {
    flex-grow: 1;
}

.session-details h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.session-details p {
    color: var(--light-text);
    font-size: 0.8rem;
}

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

.btn-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--light-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    border: none;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background-color: rgba(37, 99, 235, 0.1);
    transform: translateY(-3px);
}

.action-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.action-btn span {
    font-size: 0.9rem;
    text-align: center;
}

.new-features {
    margin-top: 2rem;
}

.feature-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.feature-content {
    flex: 2;
    padding-right: 2rem;
}

.feature-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.feature-content p {
    color: var(--light-text);
    margin-bottom: 1.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.feature-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.feature-image img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        width: 300px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        overflow: hidden;
    }
    
    .sidebar-header h1,
    .user-name,
    .user-role {
        display: none;
    }
    
    .sidebar-nav ul li a span {
        display: none;
    }
    
    .sidebar-nav ul li {
        display: flex;
        justify-content: center;
        padding: 1rem 0;
    }
    
    .sidebar-nav ul li a i {
        margin-right: 0;
        font-size: 1.5rem;
    }
    
    .main-content {
        margin-left: 80px;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .avatar {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .header-actions {
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-card {
        flex-direction: column;
    }
    
    .feature-content {
        padding-right: 0;
        margin-bottom: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
}
