/*
  This file contains all the custom CSS rules for the application.
  It is linked from index.html.
*/

:root {
    --font-fa: 'Vazirmatn', sans-serif;
    --font-en: 'Noto Sans', sans-serif;
    --font-ar: 'Noto Naskh Arabic', serif;
    --font-ku: 'Vazirmatn', sans-serif;
    /* Using Vazir for Kurdish as it supports the characters */
}

body {
    transition: background-color 0.3s, color 0.3s;
}

.sidebar-link.active {
    background-color: #eef2ff;
    /* indigo-100 */
    color: #4f46e5;
    /* indigo-600 */
    font-weight: 700;
}

html.dark .sidebar-link.active {
    background-color: #4f46e5;
    /* indigo-600 */
    color: #ffffff;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

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


/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Modal transition styles */
#modal-backdrop,
.modal {
    transition: opacity 0.3s ease;
}

#modal-content,
.modal-content {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Custom theme switch styles */
.theme-switch-checkbox {
    display: none;
}

.theme-switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 50px;
    height: 28px;
    background: #d1d5db;
    /* gray-300 */
    border-radius: 100px;
    position: relative;
    transition: background-color .2s;
}

html.dark .theme-switch-label {
    background: #4b5563;
    /* gray-600 */
}

.theme-switch-label .theme-switch-ball {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 45px;
    transition: 0.2s;
    background: #fff;
    box-shadow: 0 0 2px 0 rgba(10, 10, 10, 0.29);
}

.theme-switch-checkbox:checked+.theme-switch-label .theme-switch-ball {
    transform: translateX(22px);
}

/* Icon picker styles */
.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
}

.icon-picker-item {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.icon-picker-item:hover,
.icon-picker-item.selected {
    background-color: #e0e7ff;
    /* indigo-200 */
}

html.dark .icon-picker-item:hover,
html.dark .icon-picker-item.selected {
    background-color: #4338ca;
    /* indigo-700 */
}


/* --- NEW CALENDAR STYLES --- */
.calendar-day {
    position: relative;
    min-height: 100px;
    padding: 8px;
    border-radius: 0.75rem;
    /* rounded-xl */
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    /* slate-200 */
}

html.dark .calendar-day {
    border-color: #374151;
    /* slate-700 */
}

.calendar-day:hover {
    background-color: #f3f4f6;
    /* slate-100 */
    transform: translateY(-2px);
}

html.dark .calendar-day:hover {
    background-color: #334155;
    /* slate-700 */
}

.calendar-day.selected {
    background-color: #4f46e5;
    /* indigo-600 */
    color: white;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px_10px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

html.dark .calendar-day.selected {
    background-color: #6366f1;
    /* indigo-500 */
}

.calendar-day.today .day-number {
    background-color: #3b82f6;
    /* blue-500 */
    color: white;
}

.calendar-day.selected .day-number {
    color: white;
    background-color: transparent;
}

.day-number {
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

/* Dot indicator for days with transactions */
.calendar-day.has-transactions::after {
    content: '';
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #f59e0b;
    /* amber-500 */
}

.calendar-day.selected.has-transactions::after {
    background-color: white;
}

/* Scrollbar for transaction list */
#calendar-transactions-list,
#transactions-list-container {
    scrollbar-width: thin;
    scrollbar-color: #a1a1aa #e5e7eb;
}

html.dark #calendar-transactions-list,
html.dark #transactions-list-container {
    scrollbar-color: #52525b #374151;
}

#calendar-transactions-list::-webkit-scrollbar,
#transactions-list-container::-webkit-scrollbar {
    width: 6px;
}

#calendar-transactions-list::-webkit-scrollbar-track,
#transactions-list-container::-webkit-scrollbar-track {
    background: transparent;
}

#calendar-transactions-list::-webkit-scrollbar-thumb,
#transactions-list-container::-webkit-scrollbar-thumb {
    background-color: #a1a1aa;
    /* zinc-400 */
    border-radius: 10px;
}

/* Filter button styles */
.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background-color: #f1f5f9;
    /* slate-100 */
    transition: all 0.2s;
    font-weight: 500;
}

html.dark .filter-btn {
    background-color: #334155;
    /* slate-700 */
}

.filter-btn.active {
    background-color: #4f46e5;
    /* indigo-600 */
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Transaction Tab styles */
.transaction-tab-btn {
    flex-grow: 1;
    text-align: center;
    padding: 12px 0;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    color: #64748b;
    /* slate-500 */
}

html.dark .transaction-tab-btn {
    color: #94a3b8;
    /* slate-400 */
}

.transaction-tab-btn.active {
    color: #ef4444;
    /* red-500 */
}

.transaction-tab-btn.active[data-type="income"] {
    color: #22c55e;
    /* green-500 */
}

.transaction-tab-btn.active[data-type="expense"] {
    border-bottom-color: #ef4444;
    /* red-500 */
}

.transaction-tab-btn.active[data-type="income"] {
    border-bottom-color: #22c55e;
    /* green-500 */
}