/**
 * Date: 2025-12-21
 * Update Date: 2025-12-21
 * Author Name: Aahaan
 * File Name: styles.css
 * Purpose: Custom styles for credHabit application
 */

/* =====================
   CSS Variables
   ===================== */
:root {
    --sidebar-width: 250px;
    --navbar-height: 56px;
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --sidebar-bg: #212529;
    --sidebar-hover: #343a40;
}

/* =====================
   Base Styles
   ===================== */
body {
    padding-top: var(--navbar-height);
    background-color: #f8f9fa;
}

/* =====================
   Sidebar Styles
   ===================== */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar-content {
    padding: 1rem 0;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 10px;
}

.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.sidebar hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1rem;
}

/* =====================
   Main Content Area
   ===================== */
.main-wrapper.with-sidebar .main-content {
    margin-left: var(--sidebar-width);
}

.main-content {
    padding: 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
}

/* =====================
   Sidebar Overlay (Mobile)
   ===================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* =====================
   Mobile Responsive
   ===================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-wrapper.with-sidebar .main-content {
        margin-left: 0;
    }
}

/* =====================
   Card Styles
   ===================== */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

/* =====================
   Balance Display
   ===================== */
.balance-display {
    font-size: 2.5rem;
    font-weight: 700;
}

.balance-positive {
    color: var(--success-color);
}

.balance-negative {
    color: var(--danger-color);
}

/* =====================
   Status Badges
   ===================== */
.status-pending {
    background-color: var(--warning-color);
    color: #212529;
}

.status-approved {
    background-color: var(--success-color);
}

.status-rejected {
    background-color: var(--danger-color);
}

/* =====================
   Habit Checkboxes
   ===================== */
.habit-check {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.habit-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.habit-item:last-child {
    border-bottom: none;
}

/* =====================
   Timer Display
   ===================== */
.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: bold;
}

.timer-running {
    color: var(--success-color);
}

.timer-stopped {
    color: #6c757d;
}

.timer-warning {
    color: var(--warning-color);
}

.timer-danger {
    color: var(--danger-color);
}

/* =====================
   Lock Status
   ===================== */
.lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: #fff;
    border-radius: 0.5rem;
}

/* =====================
   Sparkline Container
   ===================== */
.sparkline-container {
    height: 50px;
    width: 100%;
}

/* =====================
   Empty State
   ===================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* =====================
   Loading Spinner
   ===================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* =====================
   Action Buttons
   ===================== */
.btn-action {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* =====================
   Transaction List
   ===================== */
.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-amount {
    font-weight: 600;
}

.transaction-earn {
    color: var(--success-color);
}

.transaction-penalty {
    color: var(--danger-color);
}

/* =====================
   Toast Customization
   ===================== */
.toast.success .toast-header {
    background: var(--success-color);
    color: #fff;
}

.toast.error .toast-header {
    background: var(--danger-color);
    color: #fff;
}

.toast.warning .toast-header {
    background: var(--warning-color);
    color: #212529;
}

.toast.info .toast-header {
    background: var(--primary-color);
    color: #fff;
}

/* =====================
   Form Styles
   ===================== */
.form-label {
    font-weight: 500;
}

.required::after {
    content: ' *';
    color: var(--danger-color);
}

/* =====================
   Login Page
   ===================== */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding-top: 5rem;
}

.login-card {
    border-radius: 1rem;
}

/* =====================
   Utility Classes
   ===================== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}