@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {

    /* Move your custom component classes here */
    .form-step {
        @apply hidden opacity-0 transition-opacity duration-300 pointer-events-none;
    }

    .form-step.active {
        @apply block opacity-100 pointer-events-auto;
    }

    .map-container {
        @apply relative w-full min-h-[45vh] bg-harvest-blue rounded-xl overflow-hidden mt-6 shadow-lg;
    }
}

@layer utilities {

    /* Keep your utility classes here */
    .carrier-loading {
        animation: pulse 1.5s infinite;
    }
}

/* Keep your keyframes and other essential CSS that can't be handled by Tailwind */
@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.4;
    }
}

/* Keep other essential non-Tailwind styles */
/* Google Maps overrides */
#map {
    background-color: #171347 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 45vh !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

#step2-map {
    background-color: #171347 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 35vh !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.map-container {
    position: relative;
    width: 100%;
    min-height: 45vh;
    background-color: #171347;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 5px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Rate comparison overlay */
.map-container .absolute {
    width: 100%;
    left: 0;
    transform: none;
}

.gm-style {
    background-color: transparent !important;
    border-radius: 0.75rem !important;
}

.gm-style>div {
    background-color: transparent !important;
    border-radius: 0.75rem !important;
}

.gm-style-iw {
    padding: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0.75rem !important;
    overflow: visible !important;
}

.gm-style-iw-d {
    overflow: visible !important;
    background-color: transparent !important;
}

.gm-style-iw-t::after,
.gm-ui-hover-effect,
.gm-style-cc,
.gmnoprint {
    display: none !important;
}

/* Map price markers */
.price-marker {
    position: absolute;
    pointer-events: none;
    transform: translate(-50%, -100%);
    z-index: 1000;
}

.price-marker-content {
    position: relative;
    background-color: rgba(26, 31, 61, 0.98);
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.price-marker-arrow {
    position: absolute;
    left: 50%;
    bottom: -0.375rem;
    transform: translate(-50%, 0) rotate(45deg);
    width: 0.75rem;
    height: 0.75rem;
    background-color: rgba(26, 31, 61, 0.98);
    border-bottom: 1px solid rgba(34, 197, 94, 0.3);
    border-right: 1px solid rgba(34, 197, 94, 0.3);
}

/* Phone input spacing */
input[type="tel"].phone-input {
    letter-spacing: 0.5px;
}


/* Google Places Autocomplete customization */
.pac-container {
    background-color: #1a1f3d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

.pac-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.pac-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.pac-item-query {
    color: white;
}

.pac-matched {
    color: #60a5fa;
}

.pac-icon {
    display: none;
}

/* Loading animations */
@keyframes pulse {
    0% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.4;
    }
}

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

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

@keyframes scanCarrier {
    0% {
        opacity: 0.3;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

.carrier-loading {
    animation: pulse 1.5s infinite;
}

.carrier-scanned {
    animation: scanCarrier 0.5s ease-out forwards;
}

.rate-reveal {
    animation: slideIn 0.5s ease-out forwards;
}

.map-loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(26, 31, 61, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.map-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

@keyframes typeNumber {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes numberFlicker {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes scanningPulse {
    0% {
        background-position: -200% 0;
        opacity: 0.15;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        background-position: 200% 0;
        opacity: 0.15;
    }
}

.scanning-amount {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 25%,
            rgba(255, 255, 255, 0.06) 37%,
            rgba(255, 255, 255, 0.02) 63%);
    background-size: 200% 100%;
    animation: scanningPulse 1s infinite linear;
}

.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
    margin-left: 2px;
}

.amount-scan {
    overflow: hidden;
    display: inline-block;
    position: relative;
}

.amount-scan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 3px;
    background: #60a5fa;
    animation: typeNumber 0.5s steps(10, end);
}

.carrier-scan-progress {
    height: unset;
    background: unset;
    position: unset;
    bottom: unset;
    left: unset;
    right: unset;
    transition: unset;
    border-radius: unset;
    box-shadow: unset;
}

[data-carrier-container] {
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-carrier-container] img {
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

[data-carrier-container]:not(.opacity-30) img {
    transform: scale(1.05);
}

/* Remove carrier scanning animations */
.carrier-scan-box {
    display: unset;
    align-items: unset;
    gap: unset;
    width: unset;
}

.carrier-logo-container {
    display: unset;
    align-items: unset;
    justify-content: unset;
}

.carrier-scanning {
    animation: unset;
}

@keyframes carrierPulse {
    0% {
        opacity: unset;
        transform: unset;
    }

    50% {
        opacity: unset;
        transform: unset;
    }

    100% {
        opacity: unset;
        transform: unset;
    }
}

.number-animation {
    transition: all 0.3s ease-out;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.scanning-container {
    width: 100%;
    max-width: 32rem;
    margin: 0 auto;
    position: relative;
}

.rate-display {
    position: relative;
    min-width: 100px;
}

.final-rates {
    opacity: 0;
    transform: translateY(10px);
    display: flex;
}

/* Hide initial content */
.carrier-comparison-container {
    visibility: hidden;
}

/* Calendar Enhancements */
#dateSelect {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

#timeSlots {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.time-slot {
    position: relative;
    overflow: hidden;
}

.time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.time-slot:hover::before {
    opacity: 1;
}

.time-slot.selected {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.time-slot:active {
    transform: scale(0.95);
}

@keyframes pulseScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-pulse-scale {
    animation: pulseScale 2s infinite;
}

/* Schedule Button Enhancements */
#scheduleButton {
    transition: all 0.3s ease-out;
}

#scheduleButton:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#scheduleButton:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#scheduleButton:not(:disabled):active {
    transform: translateY(0);
}

/* Time Slot Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.time-slot {
    animation: fadeSlideIn 0.3s ease-out forwards;
}

/* Availability Indicator */
.time-slot .availability-indicator {
    font-size: 0.75rem;
    color: rgba(52, 211, 153, 1);
    transition: color 0.2s ease-out;
}

.time-slot:hover .availability-indicator {
    color: rgba(52, 211, 153, 0.8);
}

/* Period Labels */
.period-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

/* Time Display */
.time-display {
    font-weight: 500;
    color: white;
}

/* Enhanced Focus States */
#dateSelect:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.time-slot:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .time-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .time-slots-grid {
        grid-template-columns: 1fr;
    }
}

/* Calendar Animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.shimmer {
    animation: shimmer 2s infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Calendar Container */
.calendar-container {
    position: relative;
    overflow: hidden;
}

/* Time Slots Grid */
.time-slots-container {
    position: relative;
}

/* Period Labels */
.period-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Time Slots */
.time-slot {
    position: relative;
    overflow: hidden;
    transform-origin: center;
    will-change: transform, opacity;
}

.time-slot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.time-slot:hover::before {
    opacity: 1;
}

.time-slot.selected {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.time-slot:active {
    transform: scale(0.98);
}

/* Success Animation */
.success-animation {
    position: relative;
}

.success-animation i {
    animation: successPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes successPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Schedule Button */
#scheduleButton {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#scheduleButton:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

#scheduleButton:not(:disabled):active {
    transform: translateY(0);
}

#scheduleButton:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Date Select Enhancement */
#dateSelect {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

#dateSelect:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 640px) {
    .time-slots-container {
        gap: 1rem;
    }

    .period-label {
        font-size: 0.8125rem;
    }

    #morningSlots,
    #afternoonSlots {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    #morningSlots,
    #afternoonSlots {
        grid-template-columns: 1fr;
    }

    .time-slot {
        padding: 1rem;
    }
}

/* Remove carrier logo animation */
.carrier-logos-scroll {
    animation: unset;
    min-width: unset;
}

@keyframes scrollLogos {
    0% {
        transform: unset;
    }

    100% {
        transform: unset;
    }
}

.edison-logo {
    transform: scale(2);
    transition: transform 0.3s ease;
}

/* Logo Carousel Styles */
.logo-carousel-container {
    position: relative;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    border-radius: 0.5rem;
}

.logo-track {
    display: flex;
    width: fit-content;
}

.logo-slide {
    display: flex;
    align-items: center;
}

.logo-slide img {
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.logo-slide img:hover {
    transform: scale(1.1);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.animate-scroll {
    animation: scroll 30s linear infinite;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-slide img {
        height: 2.5rem !important;
        margin: 0 0.75rem !important;
    }

    .animate-scroll {
        animation-duration: 20s;
    }
}

@media (max-width: 480px) {
    .logo-slide img {
        height: 2rem !important;
        margin: 0 0.5rem !important;
    }

    .animate-scroll {
        animation-duration: 15s;
    }
}

/* Rate Animation Styles */
.number-animation {
    transition: all 0.3s ease-out;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.rate-reveal {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeSlideIn 0.5s ease-out forwards;
}

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

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

/* Carrier Logo Animation */
.carrier-logo-container {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 0.5rem;
    overflow: hidden;
    transition: all 0.5s ease-out;
}

.carrier-logo-container .logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.carrier-logo-container img {
    height: auto;
    filter: brightness(0) invert(1);
    transition: all 0.2s ease-out;
    transform: scale(0.9);
    opacity: 0.4;
}

.carrier-logo-container img.highlight {
    transform: scale(1.1);
    opacity: 1;
}

.carrier-logo-container img:not(.highlight) {
    transform: scale(0.9);
    opacity: 0.4;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .carrier-logo-container .logo-wrapper {
        gap: 1rem;
    }

    .carrier-logo-container img {
        transform: scale(0.8);
    }

    .carrier-logo-container img.highlight {
        transform: scale(0.9);
    }

    .carrier-logo-container img:not(.highlight) {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .carrier-logo-container .logo-wrapper {
        gap: 0.75rem;
    }

    .carrier-logo-container img {
        transform: scale(0.7);
    }

    .carrier-logo-container img.highlight {
        transform: scale(0.8);
    }

    .carrier-logo-container img:not(.highlight) {
        transform: scale(0.6);
    }
}