/* Habit Tracker Custom Styles - Replaces Tailwind CDN */
/* These utilities match Tailwind's naming for easy conversion */

/* === LAYOUT UTILITIES === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.grid { display: grid; }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.hidden { display: none; }
.block { display: block; }

/* === FLEXBOX & ALIGNMENT === */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* === SPACING === */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }

/* Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pt-8 { padding-top: 2rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-10 { padding-bottom: 2.5rem; }
.pb-24 { padding-bottom: 6rem; }

/* Margin */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-3 { margin-bottom: 0.75rem; }

/* === SIZING === */
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-full { width: 100%; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.h-\[4\.5rem\] { height: 4.5rem; }
.min-h-screen { min-height: 100vh; }
.min-w-\[84px\] { min-width: 84px; }
.min-w-\[140px\] { min-width: 140px; }
.max-w-\[340px\] { max-width: 340px; }
.h-2\.5 { height: 0.625rem; }

/* === TYPOGRAPHY === */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-\[11px\] { font-size: 11px; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-\[0\.015em\] { letter-spacing: 0.015em; }
.tracking-\[0\.1em\] { letter-spacing: 0.1em; }

.leading-normal { line-height: 1.5; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-none {
    user-select: none;
}

/* === COLORS === */
/* Background Colors */
.bg-white { background-color: #ffffff; }
.bg-transparent { background-color: transparent; }
.bg-primary { background-color: var(--primary); }
.bg-primary\/10 { background-color: rgba(124, 58, 237, 0.1); }
.bg-primary\/20 { background-color: rgba(124, 58, 237, 0.2); }
.bg-background-light { background-color: #f7f6f8; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-\[#f7f6f8\] { background-color: #f7f6f8; }
.bg-\[#191022\]\/50 { background-color: rgba(25, 16, 34, 0.5); }
.bg-red-50 { background-color: #fef2f2; }
.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6); }

/* Text Colors */
.text-white { color: #ffffff; }
.text-primary { color: var(--primary); }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-\[#140d1b\] { color: #140d1b; }
.text-\[#191022\] { color: #191022; }
.text-\[#f7f6f8\] { color: #f7f6f8; }
.text-red-500 { color: #ef4444; }

/* Border Colors */
.border-white { border-color: #ffffff; }
.border-gray-100 { border-color: #f3f4f6; }
.border-primary\/20 { border-color: rgba(124, 58, 237, 0.2); }

/* === DARK MODE === */
.dark .dark\:bg-background-dark { background-color: #191022; }
.dark .dark\:bg-\[#251b2e\] { background-color: #251b2e; }
.dark .dark\:bg-\[#191022\] { background-color: #191022; }
.dark .dark\:bg-\[#191022\]\/50 { background-color: rgba(25, 16, 34, 0.5); }
.dark .dark\:bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.dark .dark\:bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.dark .dark\:bg-primary\/20 { background-color: rgba(124, 58, 237, 0.2); }
.dark .dark\:bg-gray-700 { background-color: #374151; }
.dark .dark\:bg-red-900\/10 { background-color: rgba(127, 29, 29, 0.1); }
.dark .dark\:bg-red-900\/20 { background-color: rgba(127, 29, 29, 0.2); }

.dark .dark\:text-white { color: #ffffff; }
.dark .dark\:text-\[#f7f6f8\] { color: #f7f6f8; }
.dark .dark\:text-gray-300 { color: #d1d5db; }
.dark .dark\:text-gray-400 { color: #9ca3af; }

.dark .dark\:border-\[#191022\] { border-color: #191022; }
.dark .dark\:border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.dark .dark\:border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }

/* === BORDERS === */
.border { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-b { border-bottom-width: 1px; }

/* === BORDER RADIUS === */
.rounded { border-radius: 0.25rem; }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-\[20px\] { border-radius: 20px; }
.rounded-\[2\.5rem\] { border-radius: 2.5rem; }

/* === SHADOWS === */
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.shadow-primary\/30 { box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3); }

/* === TRANSITIONS === */
.transition-colors { transition-property: background-color, border-color, color; transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* === ANIMATIONS === */
@keyframes pulse {
    50% { opacity: .5; }
}
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* === TRANSFORMS === */
.scale-100 { transform: scale(1); }

/* === HOVER STATES === */
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-primary:hover { background-color: var(--primary); }
.hover\:bg-primary\/10:hover { background-color: rgba(124, 58, 237, 0.1); }
.hover\:bg-red-100:hover { background-color: #fee2e2; }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:brightness-110:hover { filter: brightness(1.1); }
.hover\:scale-105:hover { transform: scale(1.05); }

.dark .dark\:hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1); }
.dark .dark\:hover\:bg-white\/5:hover { background-color: rgba(255, 255, 255, 0.05); }
.dark .dark\:hover\:bg-red-900\/20:hover { background-color: rgba(127, 29, 29, 0.2); }

/* === ACTIVE STATES === */
.active\:scale-90:active { transform: scale(0.9); }
.active\:scale-\[0\.97\]:active { transform: scale(0.97); }

/* === FOCUS STATES === */
.focus\:outline-0:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-4:focus { box-shadow: 0 0 0 4px; }
.focus\:ring-primary\/10:focus { box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1); }
.focus\:border-primary:focus { border-color: var(--primary); }

/* === DISABLED STATES === */
.disabled\:opacity-30:disabled { opacity: 0.3; }
.disabled\:cursor-not-allowed:disabled { cursor: not-allowed; }

/* === Z-INDEX === */
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* === OVERFLOW === */
.overflow-hidden { overflow: hidden; }

/* === MISC === */
.cursor-pointer { cursor: pointer; }
.no-underline { text-decoration: none; }

/* === BACKDROP === */
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* === PLACEHOLDER === */
.placeholder\:text-gray-400::placeholder { color: #9ca3af; }

/* === FONTS === */
.font-display {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === FORM INPUTS === */
.form-input {
    display: flex;
    width: 100%;
    min-width: 0;
    resize: none;
    overflow: hidden;
}

/* === CUSTOM COMPONENTS === */

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(6rem + env(safe-area-inset-bottom));
    right: 1.25rem;
    z-index: 30;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
    color: white;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.4);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(124, 58, 237, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

/* Custom Checkbox (already defined in habit-tracker.html but keeping for completeness) */
.custom-checkbox {
    appearance: none;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    background-color: transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.dark .custom-checkbox {
    border-color: rgba(255, 255, 255, 0.1);
}

.custom-checkbox:checked {
    background-color: #7C3AED;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.custom-checkbox::after {
    content: 'check';
    font-family: 'Material Symbols Outlined';
    font-size: 18px;
    font-weight: 700;
    color: transparent;
    transition: color 0.1s;
}

.custom-checkbox:checked::after {
    color: white;
}

/* Body styles for habit tracker */
body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Ensure proper dark mode variable support */
:root {
    --primary: #7C3AED;
    --bg-light: #f7f6f8;
    --bg-dark: #191022;
}

.dark {
    --bg-card: #251b2e;
}
