/* Force positioning context on the header */
.chat_head {
    position: relative !important;
}

/* Header Integrated Widget Container - MOVED TO SIDEBAR */
.weather-widget {
    position: absolute; /* Relative to sidebar wrapper */
    left: 0; 
    right: 0;
    top: 5px; /* Add some spacing from top of wrapper */
    bottom: auto;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    width: 100%;
    height: auto;
    pointer-events: none; /* Allow clicks to pass through around the widget */
    white-space: nowrap;
}

/* Re-enable pointer events for the card itself */
.weather-glass-card {
    pointer-events: auto;
}

.weather-widget[data-weather-type] {
    background: transparent;
    border: none;
    padding: 0;
}

.weather-column-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px; 
    width: auto;
}

.weather-credit {
    display: none; /* Hide credit in compact vertical mode */
}

/* Compact 3D Glass Card */
.weather-content {
    perspective: 1000px;
    padding: 0;
    width: 90%; /* Fit within sidebar width */
    height: auto;
}

.weather-glass-card {
    display: flex;
    flex-direction: column; /* VERTICAL LAYOUT for sidebar */
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    height: auto;
    width: 100%;
    
    /* Premium Glassmorphism */
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    /* Refined 3D Borders */
    border-top: 1px solid rgba(255, 255, 255, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(0, 0, 0, 0.4);
    
    /* Deep Shadow */
    box-shadow: 
        0 5px 10px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.15);
    
    border-radius: 15px;
    
    /* 3D Transform */
    transform-style: preserve-3d;
    transform: translateZ(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    
    /* Subtle Float Animation */
    animation: floatHeader 6s ease-in-out infinite;
}

/* Hover Effect */
.weather-glass-card:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 16px rgba(0, 0, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

@keyframes floatHeader {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Weather Elements Styling */
.weather-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8); 
    transform: translateZ(15px);
    width: 100%;
}

.loc-item i { 
    font-size: 12px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    color: #ff5252;
}
.weather-loc { font-size: 11px; font-weight: 800; letter-spacing: 0px; text-align: center; }

.temp-item i { 
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}
.weather-temp { font-size: 14px; font-weight: 900; }

.desc-item { 
    display: flex; 
    justify-content: center;
}
.weather-desc { font-size: 9px; font-weight: bold; text-align: center; white-space: normal; line-height: 1.2; }

.wind-item { display: none; } /* Hide wind in compact sidebar mode */
.wind-item i { font-size: 10px; }

.weather-divider {
    width: 80%; /* Horizontal divider */
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
    margin: 2px 0;
}

/* Dynamic Gradients */
.weather-widget[data-weather-type="clear"] .weather-glass-card { 
    background: linear-gradient(135deg, rgba(255, 160, 0, 0.4), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 215, 64, 0.8);
}
.weather-widget[data-weather-type="clear"] .temp-item i { color: #ffd740; }

.weather-widget[data-weather-type="cloudy"] .weather-glass-card { 
    background: linear-gradient(135deg, rgba(84, 110, 122, 0.5), rgba(255, 255, 255, 0.1));
    border-color: rgba(176, 190, 197, 0.8); 
}
.weather-widget[data-weather-type="cloudy"] .temp-item i { color: #cfd8dc; }

.weather-widget[data-weather-type="rainy"] .weather-glass-card { 
    background: linear-gradient(135deg, rgba(2, 119, 189, 0.5), rgba(255, 255, 255, 0.1));
    border-color: rgba(64, 196, 255, 0.8); 
}
.weather-widget[data-weather-type="rainy"] .temp-item i { color: #40c4ff; }

.weather-widget[data-weather-type="snowy"] .weather-glass-card { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(224, 247, 250, 0.2));
    border-color: rgba(255, 255, 255, 0.9); 
}
.weather-widget[data-weather-type="snowy"] .temp-item i { color: #e0f7fa; }

.weather-widget[data-weather-type="stormy"] .weather-glass-card { 
    background: linear-gradient(135deg, rgba(38, 50, 56, 0.7), rgba(255, 87, 34, 0.3));
    border-color: rgba(255, 87, 34, 0.8); 
}
.weather-widget[data-weather-type="stormy"] .temp-item i { color: #ff5722; }

/* Responsive adjustments */
@media screen and (min-width: 768px) {
    .desc-item { display: flex; }
    /* Keep wind hidden or show if desired, but might be too tall */
}

@media screen and (max-width: 480px) {
    /* Mobile styles now mirror desktop styles (sidebar placement) */
    /* Only minor scaling adjustments if necessary */
    .weather-widget { 
        transform: scale(0.9); /* Slightly smaller on very small screens */
        transform-origin: top center;
    }
}
