/* Custom Utilities & Overrides */
html,
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Positioning */
.inset-y-0 {
    top: 0px;
    bottom: 0px;
}

/* Spacing */
.pr-12 {
    padding-right: 3rem !important;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.pl-4 {
    padding-left: 1rem;
}

/* Flexbox utilities */
.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Colors & States */
.text-gray-400 {
    color: #9ca3af;
}

.hover\:text-green-600:hover {
    color: #16a34a !important;
}

.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

/* Red Borders (Safety Fallback) */
.border-red-500 {
    border-color: #ef4444 !important;
}

.focus\:border-red-500:focus {
    border-color: #ef4444 !important;
}

.text-red-500 {
    color: #ef4444 !important;
}

.focus\:ring-red-200:focus {
    --tw-ring-color: #fecaca !important;
}

/* Header & Stacking Context Fixes */
.header-z-index {
    z-index: 500 !important;
}

.notification-z-index {
    z-index: 999 !important;
}

/* Robust Profile Grid for 2 Columns */
.cv-grid-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

/* Force 2 columns down to 480px width */
@media (max-width: 480px) {
    .cv-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Precise Borders for the breakdown grid */
.cv-grid-2>div {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.dark .cv-grid-2>div {
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

/* Vertical Divider for odd items (left column) */
@media (min-width: 481px) {
    .cv-grid-2>div:nth-child(odd) {
        border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    .dark .cv-grid-2>div:nth-child(odd) {
        border-right-color: rgba(255, 255, 255, 0.05) !important;
    }
}

/* Remove bottom border on last row items */
.cv-grid-2>div:nth-last-child(1),
.cv-grid-2>div:nth-last-child(2) {
    border-bottom: none !important;
}

/* Card background overrides to ensure dark mode consistency */
.dark .bg-white,
.dark .bg-gray-900 {
    background-color: #111827 !important;
    /* gray-900 */
}

.dark .bg-gray-950 {
    background-color: #030712 !important;
}

/* SEMANTIC ICON TARGETING (Bulletproof) */
/* This solves the contrast issue by bypassing Tailwind utility specificity */

.dark .cv-icon-waste {
    background-color: rgba(255, 255, 255, 0.2) !important;
    /* High contrast circle */
}

.dark .cv-icon-waste svg {
    color: #ffffff !important;
}

.dark .cv-icon-gas {
    background-color: rgba(22, 163, 74, 0.2) !important;
}

.dark .cv-icon-gas svg {
    color: #4ade80 !important;
}

.dark .cv-icon-elec {
    background-color: rgba(37, 99, 235, 0.2) !important;
}

.dark .cv-icon-elec svg {
    color: #60a5fa !important;
}

.dark .cv-icon-transport {
    background-color: rgba(217, 119, 6, 0.2) !important;
}

.dark .cv-icon-transport svg {
    color: #fbbf24 !important;
}

.dark .cv-icon-water {
    background-color: rgba(37, 99, 235, 0.15) !important;
}

.dark .cv-icon-water svg {
    color: #60a5fa !important;
}

.dark .cv-icon-upstream {
    background-color: rgba(79, 70, 229, 0.2) !important;
}

.dark .cv-icon-upstream svg {
    color: #a5b4fc !important;
}

.dark .cv-icon-downstream {
    background-color: rgba(225, 29, 72, 0.2) !important;
}

.dark .cv-icon-downstream svg {
    color: #fb7185 !important;
}

.dark .cv-icon-commuting {
    background-color: rgba(5, 150, 105, 0.2) !important;
}

.dark .cv-icon-commuting svg {
    color: #34d399 !important;
}

/* Force logo circle to stay white for logo blending */
.cv-logo-circle,
.dark .cv-logo-circle {
    background-color: #ffffff !important;
    border-color: #ffffff !important;
}

/* Step Background Numbers (Professional & Cross-Browser) */
.step-bg-number {
    position: absolute !important;
    top: -3rem !important;
    right: -2rem !important;
    font-weight: 900 !important;
    font-size: 160px !important;
    line-height: 1 !important;
    pointer-events: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    user-select: none !important;
    z-index: 0 !important;
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -moz-transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.group:hover .step-bg-number {
    transform: scale(1.1) translateX(-1rem) !important;
    -webkit-transform: scale(1.1) translateX(-1rem) !important;
    -moz-transform: scale(1.1) translateX(-1rem) !important;
}