/* ==========================================================================
   Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    background: #ffffff;
    color: #171717;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
    min-height: 100vh;
    background: white;
    padding: 3rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 1.5rem;
    font-weight: 300;
    color: #171717;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 400;
}

/* ==========================================================================
   Search Section
   ========================================================================== */

.search-section {
    margin-bottom: 2rem;
}

.search-container {
    max-width: 32rem;
    margin: 0 auto;
}

.search-help {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

/* ==========================================================================
   Autocomplete Styles
   ========================================================================== */

.autocomplete {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border-bottom: 1px solid #d1d5db;
    background: transparent;
    color: #171717;
    outline: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: 1.125rem;
    transition: border-bottom-color 0.2s ease;
}

.search-input:focus {
    border-bottom-color: #171717;
}

.search-input::placeholder {
    color: #6b7280;
}

.autocomplete-items {
    position: absolute;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    z-index: 50;
    max-height: 15rem;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0 0 0.375rem 0.375rem;
}

.autocomplete-items.show {
    display: block;
}

.autocomplete-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    color: #171717;
    transition: background-color 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item[aria-selected="true"] {
    background: #f9fafb;
}

.autocomplete-item .highlight {
    font-weight: 500;
    color: #1f2937;
}

/* ==========================================================================
   Loading Indicators
   ========================================================================== */

.loading-spinner {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid transparent;
    border-bottom: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

.loading-spinner.show {
    display: block;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.clear-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    display: none;
    border-radius: 0.25rem;
}

.clear-button:hover {
    color: #6b7280;
    background: #f3f4f6;
}

.clear-button.show {
    display: block;
}

.clear-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ==========================================================================
   Loader Section
   ========================================================================== */

.loader-section {
    margin: 2rem 0;
}

.loader-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.loader {
    width: fit-content;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Truck Animation
   ========================================================================== */

.truckWrapper {
    width: 200px;
    height: 100px;
    display: flex;
    flex-direction: column;
    position: relative;
    align-items: center;
    justify-content: flex-end;
    overflow-x: hidden;
}

.truckBody {
    width: 130px;
    height: fit-content;
    margin-bottom: 6px;
    animation: motion 1s linear infinite;
}

@keyframes motion {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(3px);
    }
    100% {
        transform: translateY(0px);
    }
}

.truckTires {
    width: 130px;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 10px 0px 15px;
    position: absolute;
    bottom: 0;
}

.truckTires svg {
    width: 24px;
}

.road {
    width: 100%;
    height: 1.5px;
    background-color: #282828;
    position: relative;
    bottom: 0;
    align-self: flex-end;
    border-radius: 3px;
}

.road::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 100%;
    background-color: #282828;
    right: -50%;
    border-radius: 3px;
    animation: roadAnimation 1.4s linear infinite;
    border-left: 10px solid white;
}

.road::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 100%;
    background-color: #282828;
    right: -65%;
    border-radius: 3px;
    animation: roadAnimation 1.4s linear infinite;
    border-left: 4px solid white;
}

.lampPost {
    position: absolute;
    bottom: 0;
    right: -90%;
    height: 90px;
    animation: roadAnimation 1.4s linear infinite;
}

@keyframes roadAnimation {
    0% {
        transform: translateX(0px);
    }
    100% {
        transform: translateX(-350px);
    }
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.results-section {
    margin-top: 2rem;
}

.output-container {
    max-width: 48rem;
    margin: 2rem auto 0;
    color: #171717;
    line-height: 1.75;
    opacity: 1;
    transition: opacity 0.75s ease-in;
    display: block;
}

.output-container h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* ==========================================================================
   Collection Boxes
   ========================================================================== */

.generalWasteBox,
.recyclingBox {
    position: relative;
    padding: 16px 20px;
    margin: 16px 0;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    flex-wrap: nowrap;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border-left: 4px solid;
    transition: border-left-width 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.generalWasteBox {
    border-left-color: #ef4444;
}

.generalWasteBox::before {
    content: "General Waste";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 15;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

.recyclingBox {
    border-left-color: #eab308;
}

.recyclingBox::before {
    content: "Recycling";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #eab308;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 15;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    overflow: hidden;
}

/* ==========================================================================
   Animated Box Overlay
   ========================================================================== */

.box-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.generalWasteBox .box-overlay {
    background: #ef4444;
}

.recyclingBox .box-overlay {
    background: #eab308;
}

.box-label {
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.box-content {
    position: relative;
    z-index: 5;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    flex-wrap: nowrap;
}

.main-text {
    transition: transform 0.3s ease;
}

/* ==========================================================================
   Animation States
   ========================================================================== */

.animated-box {
    opacity: 0;
    transform: translateY(20px);
    animation: boxEntrance 0.75s ease-out forwards;
}

.animated-box:nth-child(2) {
    animation-delay: 0.1s;
}

@keyframes boxEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Swipe animation - starts 2s after box entrance */
.animated-box .box-overlay {
    transform: translateX(0);
    animation: swipeOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) 2s forwards;
}

@keyframes swipeOut {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Fade out the label during swipe */
.animated-box .box-label {
    animation: labelFadeOut 0.4s ease-out 2s forwards;
}

/* ==========================================================================
   Hover Effects
   ========================================================================== */

/* Disable hover effects by default - only enable after animations complete */
.generalWasteBox:hover,
.recyclingBox:hover {
    /* Hover effects disabled until animations complete */
}

/* Enable hover effects only after animations complete */
.generalWasteBox.animations-complete:hover,
.recyclingBox.animations-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generalWasteBox.animations-complete:hover,
.recyclingBox.animations-complete:hover {
    border-left-width: 0;
    transition: border-left-width 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.generalWasteBox.animations-complete:hover {
    border-left-color: #ef4444;
}

.generalWasteBox.animations-complete:hover::before {
    content: "General Waste";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 120px;
    background-color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 15;
    opacity: 1;
    transition: all 0.3s ease;
}

.recyclingBox.animations-complete:hover {
    border-left-color: #eab308;
}

.recyclingBox.animations-complete:hover::before {
    content: "Recycling";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 120px;
    background-color: #eab308;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 15;
    opacity: 1;
    transition: all 0.3s ease;
}

/* Move the main text when hovering, but keep week indicator in place */
.generalWasteBox.animations-complete:hover .main-text,
.recyclingBox.animations-complete:hover .main-text {
    transform: translateX(116px);
    transition: transform 0.3s ease;
}



@keyframes labelFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.newBox {
    border-left: 4px solid #ef4444;
    padding: 16px 20px;
    margin: 16px 0;
    background: #f9fafb;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.week-indicator {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-left: 1em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   Messages and Notifications
   ========================================================================== */

.no-results {
    max-width: 32rem;
    margin: 0 auto;
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.no-results-help {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.loading-message {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
}

.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    color: white;
    font-size: 0.875rem;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    animation: slideIn 0.3s ease-out;
}

.notification-info {
    background: #3b82f6;
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 640px) {
    .container {
        padding: 2rem 1rem;
    }
    
    .title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }
    
    .subtitle {
        font-size: 0.875rem;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.875rem;
    }
    
    .autocomplete-item {
        padding: 0.875rem;
    }
    
    .generalWasteBox,
    .recyclingBox,
    .newBox {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .box-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .week-indicator {
        margin-left: 0;
        margin-top: 0.25rem;
    }
    
    .notification {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem 0.75rem;
    }
    
    .title {
        font-size: 1.125rem;
    }
    
    .search-container {
        max-width: none;
    }
}

/* ==========================================================================
   Notification Styles
   ========================================================================== */

/* Notification containers */
.notifications-container {
    margin: 1.5rem 0;
}

.top-notifications {
    margin-bottom: 2rem;
}

.bottom-notifications {
    margin-top: 2rem;
}

/* General notification base styles */
.general-notification,
.schedule-change-notification {
    border-radius: 12px;
    padding: 1rem;
    margin: 0.75rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Notification type styles */
.notification-urgent {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    animation: urgentPulse 2s ease-in-out infinite;
}

.notification-warning,
.schedule-change-notification {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    animation: warningPulse 2s ease-in-out infinite;
}

.notification-note {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 2px solid #8b5cf6;
}

/* Notification content styles */
.notification-urgent .notification-content {
    color: #b91c1c;
    font-weight: 600;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notification-warning .notification-content,
.schedule-change-notification .notification-content {
    color: #92400e;
    font-weight: 500;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

.notification-note .notification-content {
    color: #6b21a8;
    font-weight: 500;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

.new-schedule-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
}

.new-schedule-info h4 {
    color: #1e40af;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.new-schedule-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    color: #1e40af;
    font-size: 0.9rem;
    border-left: 4px solid #3b82f6;
}

/* Animation keyframes */
@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3), 0 0 25px rgba(239, 68, 68, 0.15);
        transform: scale(1.02);
    }
}

@keyframes warningPulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
    }
    50% {
        box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2), 0 0 20px rgba(245, 158, 11, 0.1);
    }
}

@keyframes notificationPulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.1);
    }
    50% {
        box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2), 0 0 20px rgba(245, 158, 11, 0.1);
    }
}

/* Responsive adjustments for notifications */
@media (max-width: 640px) {
    .notifications-container {
        margin: 1rem 0;
    }

    .general-notification,
    .schedule-change-notification,
    .new-schedule-info {
        padding: 0.75rem;
        margin: 0.5rem 0;
    }

    .notification-urgent .notification-content,
    .notification-warning .notification-content,
    .notification-note .notification-content,
    .schedule-change-notification .notification-content {
        font-size: 0.85rem;
    }

    .new-schedule-info h4 {
        font-size: 0.9rem;
    }

    .new-schedule-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
} 