/* TaskFlow - Modern Compact Design */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --sidebar-bg: #1a1d29;
    --sidebar-hover: #252836;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

/* Override Bootstrap defaults for compact design */
body {
    font-size: 14px !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

h2 {
    font-size: 1.25rem !important;
}

h3 {
    font-size: 1.1rem !important;
}

h4 {
    font-size: 1rem !important;
}

h5 {
    font-size: 0.95rem !important;
}

h6 {
    font-size: 0.9rem !important;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f7fa;
}

/* Sidebar */
.sidebar {
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar .brand i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.sidebar nav {
    padding: 0.5rem 0;
}

.sidebar a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 0.65rem 1.25rem;
    display: block;
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar a:hover {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar a.active {
    background: var(--sidebar-hover);
    color: white;
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.1);
    margin: 0.5rem 0;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    background: #f5f7fa;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.page-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.25rem;
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 0.875rem;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border-left: 4px solid;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.stat-card h5 {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.4rem 0;
    opacity: 0.85;
}

.stat-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.stat-card.bg-primary { 
    border-left-color: #3498db; 
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}
.stat-card.bg-success { 
    border-left-color: #27ae60; 
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}
.stat-card.bg-warning { 
    border-left-color: #f39c12; 
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}
.stat-card.bg-danger { 
    border-left-color: #e74c3c; 
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}
.stat-card.bg-info { 
    border-left-color: #17a2b8; 
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}
.stat-card.bg-secondary { 
    border-left-color: #6c757d; 
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

/* Tables */
.table {
    font-size: 0.8rem;
    margin: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    padding: 0.6rem 0.75rem;
}

.table tbody td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    font-size: 0.85rem;
}

.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* Buttons */
.btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

/* Forms */
.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control, .form-select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
}

/* Alerts */
.alert {
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

/* Thread Messages */
.message-item {
    border-left: 3px solid #3498db;
    padding-left: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.message-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.message-item.internal {
    border-left-color: #e74c3c;
    background: #fff5f5;
    padding: 0.75rem 1rem;
    border-radius: 6px;
}

.message-item strong {
    font-size: 0.9rem;
    color: #2c3e50;
}

.message-item p {
    font-size: 0.875rem;
    margin: 0.5rem 0 0 0;
    color: #555;
    line-height: 1.6;
}

.message-item small {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Thread Container */
.thread-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem 0;
}

.thread-container::-webkit-scrollbar {
    width: 6px;
}

.thread-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.thread-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.thread-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* History Items */
.history-item {
    font-size: 0.8rem;
    color: #666;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.history-item:last-child {
    border-bottom: none;
}

/* Login/Register Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 2rem;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.auth-card-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.auth-card-header i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.auth-card-header h2 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
}

.auth-card-body {
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-header h2 {
        font-size: 1.25rem;
    }
    
    .stat-card h2 {
        font-size: 1.5rem;
    }
}

/* Utilities */
.text-muted {
    color: #6c757d !important;
    font-size: 0.85rem;
}

/* Notification Badge in Sidebar */
.sidebar a .badge {
    font-size: 0.65rem !important;
    padding: 0.2rem 0.4rem !important;
    margin-left: 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
}

/* Slide-in Notification Alert */
.notification-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-left: 4px solid #3498db;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 1rem;
    z-index: 9999;
    animation: slideInRight 0.3s ease-out;
    cursor: pointer;
}

.notification-alert.new-message {
    border-left-color: #e74c3c;
    background: #fff5f5;
}

.notification-alert .alert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.notification-alert .alert-header strong {
    font-size: 0.9rem;
    color: #2c3e50;
}

.notification-alert .alert-body {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.5rem;
}

.notification-alert .alert-footer {
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-alert .close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-alert .close-btn:hover {
    color: #333;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification-alert.hiding {
    animation: slideOutRight 0.3s ease-out forwards;
}

code {
    font-size: 0.85rem;
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #e83e8c;
}

/* Overdue highlighting */
.table-danger {
    background-color: #fff5f5 !important;
}

.table-danger:hover {
    background-color: #ffe5e5 !important;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.welcome-card h2 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem 0;
}

.welcome-card p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.8rem;
}

/* Step Cards */
.step-card {
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 0.75rem;
}

/* Modal */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* Compact spacing */
.mb-compact {
    margin-bottom: 0.75rem !important;
}

.mt-compact {
    margin-top: 0.75rem !important;
}

.p-compact {
    padding: 0.75rem !important;
}
