/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
}

.logo i {
    font-size: 2rem;
    color: #3498db;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex: 1;
}

.nav-link {
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: #3498db;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    margin-left: auto;
}

.live-indicator {
    display: none; /* Initially hidden */
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: #27ae60;
    border-radius: 15px;
    font-size: 0.8rem;
    color: white;
    font-weight: 500;
}

.live-indicator i {
    font-size: 0.6rem;
    animation: pulse 2s infinite;
}

/* Auth section styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-link {
    color: #ecf0f1;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.auth-link:hover {
    color: white;
    background: #3498db;
    text-decoration: none;
}

.auth-separator {
    color: #7f8c8d;
    font-weight: 300;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    background: #34495e;
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.user-dropdown-btn:hover {
    background: #3498db;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid #eee;
}

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

/* Beta Tester Badge */
.beta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
    animation: betaPulse 3s ease-in-out infinite;
}

@keyframes betaPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.dropdown-item:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.dropdown-item.active {
    background: #e3f2fd;
    color: #1976d2;
}

/* Authentication page styles */
.auth-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-width: 500px;
    width: 100%;
}

.auth-tabs {
    display: flex;
    background: #f8f9fa;
}

.auth-tab {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-tab.active {
    background: white;
    color: #2c3e50;
    border-bottom: 3px solid #3498db;
}

.auth-form-container {
    display: none;
    padding: 2rem;
}

.auth-form-container.active {
    display: block;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.auth-card p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0.25rem;
}

.password-strength {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.password-strength.weak { color: #e74c3c; }
.password-strength.fair { color: #f39c12; }
.password-strength.good { color: #27ae60; }
.password-strength.strong { color: #2ecc71; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    margin: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    z-index: -1;
}

.checkmark {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.checkbox-label:hover .checkmark {
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: #3498db;
    border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    display: block;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus ~ .checkmark {
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Text content inside checkbox label */
.checkbox-text {
    flex: 1;
    display: inline-block;
    line-height: 20px;
    vertical-align: middle;
}

.checkbox-label a {
    color: #3498db;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
    color: #7f8c8d;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #333;
    font-weight: 500;
}

.google-signin-btn:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Preferences page styles */
.preferences-main {
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
}

.preferences-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.preferences-header {
    text-align: center;
    margin-bottom: 3rem;
}

.preferences-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.preferences-header p {
    color: #7f8c8d;
}

.preferences-section {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h3 {
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preferences-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.danger-zone {
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 1.5rem;
    background: #fdf2f2;
}

.danger-zone h4 {
    color: #e74c3c;
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: #c0392b;
    margin-bottom: 1rem;
}

.danger-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Modal enhancements */
.warning-content {
    text-align: center;
}

.warning-content i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.warning-content h4 {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.warning-content ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 2rem;
}

.warning-content input {
    margin-top: 1rem;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    width: 200px;
    text-align: center;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .auth-main {
        padding: 1rem;
    }
    
    .preferences-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .danger-actions {
        flex-direction: column;
    }
    
    .user-dropdown-menu {
        right: -50px;
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Main Content */
.main {
    padding: 2rem;
    flex: 1;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    margin-bottom: 3rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.hero-content p {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.feature p {
    color: #7f8c8d;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ecf0f1;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-content {
    position: relative;
    overflow: hidden;
}

.card-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: #3498db;
}

/* Form Styles */
.form {
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* Button Styles */
.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Get Started Section */
.get-started {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.get-started .card {
    text-align: center;
    padding: 3rem 2rem;
}

.get-started .card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.get-started .card p {
    margin-bottom: 2rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* API Info Section */
.get-started {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* API Info */
.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.method {
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.method.get {
    background: #2ecc71;
    color: white;
}

.method.post {
    background: #3498db;
    color: white;
}

.path {
    font-family: 'Courier New', monospace;
    background: #ecf0f1;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    flex: 1;
}

.description {
    color: #7f8c8d;
    flex: 2;
}

/* Dashboard Specific Styles */
.dashboard {
    padding: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 1.5rem;
    grid-template-areas: 
        "stats stats"
        "tracking charts" 
        "activities activities"
        "tasks tasks";
}

.stats-section {
    grid-area: stats;
}

.tasks-section {
    grid-area: tasks;
}

.tracking-section {
    grid-area: tracking;
}

.charts-section {
    grid-area: charts;
}

.activities-section {
    grid-area: activities;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 1;
    color: rgba(255, 255, 255, 0.95);
}

/* Task Management */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.task-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.task-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ecf0f1;
}

.task-details h4 {
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.task-details p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

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

/* Task Merge Functionality */
.task-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.task-item.selectable {
    cursor: pointer;
    position: relative;
}

.task-item.selected {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.task-item.selected::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: #3498db;
    font-size: 1.2rem;
}

.selected-tasks-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ecf0f1;
    border-radius: 5px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

.selected-task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 3px;
    background-color: #f8f9fa;
    margin-bottom: 0.5rem;
}

.selected-task-item:last-child {
    margin-bottom: 0;
}

.selected-task-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.selected-task-name {
    flex: 1;
    font-weight: 500;
}

.merge-mode-indicator {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Time Tracking */
.tracking-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.task-select {
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    min-width: 150px;
    flex: 1;
}

.tracking-section .card-content {
    padding-top: 0;
    transition: all 0.3s ease;
}

.tracking-section .card-content.active-tracking {
    transition: all 0.3s ease !important;
}

.current-activity {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.activity-timer {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.activity-task {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.activity-start {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* No Task Card */
.no-task-card {
    background: white !important;
    color: #7f8c8d !important;
    border: 2px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.no-task-card .activity-task {
    color: #95a5a6;
    font-weight: 500;
}

.no-task-card .activity-timer {
    color: #bdc3c7;
    opacity: 0.8;
}

.no-task-card .activity-start {
    color: #95a5a6;
    font-style: italic;
}

/* Charts */
.date-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.date-input {
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    min-width: 150px;
}

.time-range-select {
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    min-width: 150px;
    background-color: white;
    color: #2c3e50;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.time-range-select:focus {
    outline: none;
    border-color: #3498db;
}

.charts-section .card-content {
    min-height: 300px;
    position: relative;
}

/* Activities List */
.activities-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

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

.activity-info {
    flex: 1;
}

.activity-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.activity-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.activity-item:hover .activity-actions {
    opacity: 1;
}

.activity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-task {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.activity-time {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.activity-duration {
    font-weight: bold;
    color: #3498db;
    font-family: 'Courier New', monospace;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
}

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

.close {
    color: #7f8c8d;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #2c3e50;
}

.modal .form {
    padding: 1.5rem;
    max-width: none;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Form help text */
.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Enhanced modal actions with danger button on left */
.form-actions .btn.btn-danger {
    margin-right: auto;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #2ecc71;
}

.notification.error {
    background: #e74c3c;
}

.notification.info {
    background: #3498db;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        background: white;
    }

    .container {
        margin: 0;
        box-shadow: none;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin: 0;
        padding: 1rem;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        white-space: normal;
    }

    .nav {
        justify-content: center;
        margin: 0;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .user-info {
        align-self: center;
    }

    .main {
        padding: 0;
        margin: 0;
    }

    .hero {
        margin: 0;
        border-radius: 0;
        padding: 3rem 1rem;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .get-started {
        padding: 2rem 1rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 0 auto;
        max-width: none;
    }

    .feature {
        padding: 1rem;
    }

    .get-started {
        grid-template-columns: 1fr;
        padding: 2rem 1rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "stats"
            "tracking"
            "charts"
            "activities"
            "tasks";
        padding: 1rem;
        gap: 1rem;
    }

    .card {
        margin: 0 0 1rem 0;
        padding: 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tracking-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .task-select {
        min-width: auto;
        width: 100%;
    }

    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input {
        min-width: auto;
        width: 100%;
    }
    
    .time-range-select {
        min-width: auto;
        width: 100%;
    }

    .endpoint {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .task-actions {
        align-self: flex-end;
    }

    .activity-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Statistics Page Styles */
.statistics {
    padding: 2rem;
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
}

.statistics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.statistics-header h2 {
    color: #2c3e50;
    font-size: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    min-width: 150px;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
    align-items: stretch;
    grid-template-areas:
        "metrics metrics"
        "time-dist daily-activity"
        "productivity heatmap"
        "task-performance trends";
}

.metrics-section { grid-area: metrics; }
.time-distribution-section { grid-area: time-dist; }
.daily-activity-section { grid-area: daily-activity; }
.productivity-section { grid-area: productivity; }
.heatmap-section { grid-area: heatmap; }
.task-performance-section { grid-area: task-performance; }
.trends-section { grid-area: trends; }

/* Add height constraints for statistics cards */
.statistics .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 500px; /* Consistent maximum height */
}

.statistics .card-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Key Metrics Styles */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card.primary { background: linear-gradient(135deg, #3498db, #2980b9); }
.metric-card.success { background: linear-gradient(135deg, #27ae60, #219a52); }
.metric-card.warning { background: linear-gradient(135deg, #f39c12, #e67e22); }
.metric-card.info { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.metric-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Productivity Insights Styles */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.insight-icon {
    font-size: 2rem;
    color: #3498db;
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.insight-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Activity Heatmap Styles */
.heatmap-container {
    padding: 1rem;
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.8rem;
}

.heatmap-hour-labels {
    display: flex;
    margin-left: 40px;
    margin-bottom: 5px;
}

.hour-label {
    flex: 2;
    text-align: center;
    color: #6c757d;
    font-size: 0.7rem;
}

.heatmap-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.day-label {
    width: 35px;
    text-align: right;
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 500;
}

.heatmap-cell {
    flex: 1;
    height: 15px;
    border-radius: 2px;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    border-color: #3498db;
    transform: scale(1.1);
}

/* Task Performance Styles */
.task-performance-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Reduced from 1rem for more compact spacing */
    max-height: 350px; /* Limit height to prevent excessive growth */
    overflow-y: auto; /* Add scrolling if content exceeds height */
    flex: 1;
}

.task-performance-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.task-performance-item:hover {
    background-color: #e9ecef;
}

.task-name-with-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0; /* Allow text to truncate if needed */
}

.task-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.task-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: #7f8c8d;
}

.task-percentage {
    font-weight: bold;
    color: #3498db;
    font-size: 0.9rem;
    min-width: 35px;
    text-align: right;
}

.task-duration {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: #2c3e50;
    min-width: 60px;
    text-align: center;
}

.task-sessions {
    color: #7f8c8d;
    min-width: 80px;
    text-align: center;
}

/* Chart Container Styles */
.card-content canvas {
    max-height: 300px !important;
}

/* Responsive Design for Statistics */
@media (max-width: 1200px) {
    .statistics-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "metrics"
            "time-dist"
            "daily-activity"
            "productivity"
            "heatmap"
            "task-performance"
            "trends";
    }
}

@media (max-width: 768px) {
    .statistics {
        padding: 1rem;
    }
    
    .statistics-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .date-range-selector {
        flex-direction: column;
        width: 100%;
    }
    
    .period-select {
        width: 100%;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .task-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .heatmap-hour-labels {
        margin-left: 30px;
    }
    
    .day-label {
        width: 25px;
        font-size: 0.7rem;
    }
    
    /* Mobile heatmap adjustments */
    .heatmap-container {
        padding: 1rem;
        overflow-x: auto;
    }
    
    .heatmap-grid {
        min-width: 600px;
    }
    
    .heatmap-hour-labels {
        padding-left: 50px;
    }
    
    .hour-label {
        width: 18px;
        height: 12px;
        font-size: 0.5rem;
    }
    
    .day-label {
        width: 50px;
        font-size: 0.65rem;
    }
    
    .heatmap-cell {
        width: 18px;
        height: 12px;
    }
}

/* Activity Heatmap Styles */
.heatmap-container {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    overflow-x: auto;
    width: 100%;
}

.heatmap-hour-labels {
    display: flex;
    gap: 2px;
    margin-bottom: 5px;
    padding-left: 70px;
}

.hour-label {
    width: 20px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #586069;
    font-weight: 500;
    flex-shrink: 0;
}

.heatmap-row {
    display: flex;
    gap: 2px;
    align-items: center;
}

.day-label {
    width: 70px;
    text-align: right;
    color: #586069;
    font-size: 0.75rem;
    font-weight: 500;
    padding-right: 8px;
    flex-shrink: 0;
}

.heatmap-cell {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e1e4e8;
    background-color: #ebedf0;
    flex-shrink: 0;
}

.heatmap-cell:hover {
    border-color: #586069;
    transform: scale(1.2);
    z-index: 1;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #586069;
    padding-right: 8px;
}

.legend-scale {
    display: flex;
    gap: 3px;
    margin: 0 0.5rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    border: 1px solid #e1e4e8;
}

.legend-color[data-level="0"] {
    background-color: #ebedf0;
}

.legend-color[data-level="1"] {
    background-color: #c6e48b;
}

.legend-color[data-level="2"] {
    background-color: #7bc96f;
}

.legend-color[data-level="3"] {
    background-color: #239a3b;
}

.legend-color[data-level="4"] {
    background-color: #196127;
}

.heatmap-placeholder {
    text-align: center;
    padding: 3rem;
    color: #586069;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #d1d5da;
}

/* Enhanced color scheme for better visibility */
.heatmap-cell[data-level="0"] {
    background-color: #ebedf0;
}

.heatmap-cell[data-level="1"] {
    background-color: #c6e48b;
}

.heatmap-cell[data-level="2"] {
    background-color: #7bc96f;
}

.heatmap-cell[data-level="3"] {
    background-color: #239a3b;
}

.heatmap-cell[data-level="4"] {
    background-color: #196127;
}

/* Enhanced Productivity Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    height: 100%; /* Fill the card height */
}

.insight-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease;
    height: 100%; /* Fill the grid item height */
    min-height: 80px; /* Ensure minimum height for better appearance */
}

.insight-card:hover {
    transform: translateY(-2px);
}

.insight-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    background: linear-gradient(135deg, #3498db, #2980b9);
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.insight-content {
    flex: 1;
}

.insight-title {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.insight-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

/* User Ranking Styles */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px; /* Match the task performance max height */
    overflow-y: auto;
    flex: 1; /* Allow it to grow within the card container */
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.ranking-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ranking-item.current-user {
    background: linear-gradient(135deg, #f8f9fa, #e3f2fd);
    border-color: #2196f3;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.ranking-position {
    display: flex;
    align-items: center;
    margin-right: 1rem;
    min-width: 60px;
}

.crown-icon {
    color: #ffd700;
    font-size: 1.5rem;
    margin-right: 0.5rem;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, 0 0 15px #ffd700;
    }
    to {
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffd700;
    }
}

.rank-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    min-width: 20px;
    text-align: center;
}

.user-info {
    /* flex: 1; */
}

.username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.today-time {
    color: #27ae60;
    font-weight: 500;
}

.month-time {
    color: #7f8c8d;
}

.no-data, .error-message {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    color: #e74c3c;
}

@media (max-width: 768px) {
    .ranking-item {
        padding: 0.75rem;
    }
    
    .user-stats {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .crown-icon {
        font-size: 1.2rem;
    }
}
