/* SPECX Custom Styles */

:root {
    --primary-color: #4f46e5;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
    line-height: 1.6;
}

/* Card Styles */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Progress Styles */
.progress {
    height: 12px;
    border-radius: 20px;
    background-color: #e2e8f0;
}

.progress-bar {
    border-radius: 20px;
    transition: all 0.6s ease;
}

.progress-excellent {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-good {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

.progress-average {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.progress-poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Goal Cards */
.goal-card {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.goal-card.fitness {
    border-left-color: #ef4444;
}

.goal-card.education {
    border-left-color: #3b82f6;
}

.goal-card.productivity {
    border-left-color: #10b981;
}

.goal-card.personal {
    border-left-color: #8b5cf6;
}

.goal-card.career {
    border-left-color: #f59e0b;
}

.goal-card.relationships {
    border-left-color: #ec4899;
}

.goal-card.hobbies {
    border-left-color: #06b6d4;
}

.goal-card.other {
    border-left-color: #6b7280;
}

/* Heatmap Styles */
.heatmap-container {
    overflow-x: auto;
    padding: 10px;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 2px;
    min-width: 600px;
}

.heatmap-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.2);
    border: 1px solid #374151;
}

.heatmap-cell.intensity-0 {
    background-color: #f1f5f9;
}

.heatmap-cell.intensity-1 {
    background-color: #bfdbfe;
}

.heatmap-cell.intensity-2 {
    background-color: #60a5fa;
}

.heatmap-cell.intensity-3 {
    background-color: #3b82f6;
}

.heatmap-cell.intensity-4 {
    background-color: #1d4ed8;
}

/* Stat Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    opacity: 0.9;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Motivational Quote Styles */
.motivational-quote {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.motivational-quote::before {
    content: '"';
    font-size: 4rem;
    position: absolute;
    top: -10px;
    left: 20px;
    opacity: 0.3;
    font-family: Georgia, serif;
}

.motivational-quote p {
    font-size: 1.125rem;
    font-style: italic;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* Goal Card Motivational Quotes */
.goal-card .motivational-quote {
    background: none;
    color: inherit;
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
    font-size: 0.875rem;
    font-style: italic;
    position: relative;
    overflow: visible;
}

.goal-card .motivational-quote::before {
    display: none;
}

.goal-card .motivational-quote.inactive {
    border-left-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.05);
}

.goal-card .motivational-quote .quote-icon {
    opacity: 0.7;
    margin-right: 0.25rem;
}

/* Streak Badge */
.streak-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.activity-item {
    position: relative;
    padding: 1rem 0;
    border-left: 2px solid transparent;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 1.5rem;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
}

/* Form Styles */
.form-floating>.form-control:focus~label {
    color: var(--primary-color);
}

.form-floating>.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

/* Flexbox Layout for Sidebar and Main Content */
.flex-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.main-area {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed~.main-area {
    margin-left: var(--sidebar-collapsed-width);
}

/* Header is not fixed, part of main content flow */
.top-header {
    position: static;
    width: 100%;
    z-index: 100;
}

@media (max-width: 768px) {
    .flex-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        width: 100%;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
    }

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .heatmap {
        grid-template-columns: repeat(26, 1fr);
    }

    .stat-card .stat-number {
        font-size: 2rem;
    }

    .motivational-quote {
        padding: 1.5rem;
    }

    .motivational-quote p {
        font-size: 1rem;
    }
}

/* Category Icons */
.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

.category-icon.fitness {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.category-icon.education {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.category-icon.productivity {
    background: linear-gradient(135deg, #10b981, #059669);
}

.category-icon.personal {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.category-icon.career {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.category-icon.relationships {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.category-icon.hobbies {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.category-icon.other {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* Welcome Section */
.welcome-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.welcome-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.welcome-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--box-shadow);
    height: 100%;
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: white;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure sidebar and footer do not clip dropdown */
.sidebar,
.sidebar-footer {
    overflow: visible;
}

/* Position dropdown menu absolutely within user-actions */
.user-actions {
    position: relative;
}

.user-actions .dropdown-menu {
    position: absolute;
    right: 0;
    bottom: 0;
    min-width: 160px;
    z-index: 1100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: none;
}

.user-actions.show .dropdown-menu {
    display: block;
}

/* Optional: prevent dropdown from being cut off on small screens */
@media (max-width: 768px) {
    .user-actions .dropdown-menu {
        left: auto;
        right: 0;
        bottom: 100%;
    }
}