<% if @city.latest_weather_art&.image&.attached? %>
<%= image_tag @city.latest_weather_art.image, class: "absolute w-full h-full object-cover scale-110 filter blur-2xl opacity-25" %>
<% end %>
<%= link_to cities_path, class: "btn btn-ghost btn-lg gap-2 bg-base-100/50 backdrop-blur-sm hover:bg-base-100/70 transition-all duration-300" do %> Back to Cities <% end %>

<%= @city.localized_name %>

<%= @city.country.name %>, <%= @city.region %>
<%= Time.current.in_time_zone(@city.timezone).strftime("%Y-%m-%d %H:%M") %>
<%= weather_stat_icon("temperature") %>
Latest Weather
<%= @city.latest_weather_art&.temperature %>°C
<%= @city.latest_weather_art&.description %>
<%= weather_stat_icon("location") %>
Coordinates
<%= @city.latitude %>°N, <%= @city.longitude %>°E
Geographical Location
<%= weather_stat_icon("history") %>
Records
<%= @city.weather_arts.count %>
Total Weather Arts

Weather Art History

Last Updated: <%= time_ago_in_words(@city.last_weather_fetch) if @city.last_weather_fetch %>
<% @city.weather_arts.order(weather_date: :desc).each do |art| %>
<% if art.image.attached? %> <%= image_tag art.image, class: "w-full h-full object-cover transform hover:scale-105 transition-transform duration-500" %>
<%= art.temperature %>°C
<%= art.weather_date.strftime("%H:%M") %>
<%= art.weather_date.strftime("%B %d, %Y") %>
<% end %>

<%= weather_description_icon(art.description) %> <%= art.description %>

<%= weather_stat_icon("humidity") %> Humidity: <%= art.humidity %>%
<%= weather_stat_icon("wind") %> Wind: <%= art.wind_scale %>
<%= link_to city_weather_art_path(@city, art), class: "btn btn-primary btn-block" do %> View Details <% end %>
<% end %>