/**
 * Kumrat Weather Engine - Frontend Styles
 * Professional weather UI matching the mockup
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --ktwe-bg: #f0f4f8;
    --ktwe-surface: #ffffff;
    --ktwe-text: #1a202c;
    --ktwe-text-secondary: #4a5568;
    --ktwe-text-muted: #718096;
    --ktwe-accent: #3182ce;
    --ktwe-accent-light: #ebf8ff;
    --ktwe-border: #e2e8f0;
    --ktwe-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --ktwe-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --ktwe-radius: 16px;
    --ktwe-radius-sm: 12px;
    --ktwe-hero-overlay: rgba(0, 0, 0, 0.35);
}

.ktwe-dark,

/* ========================================
   BASE STYLES
   ======================================== */
.ktwe-page {
    background: var(--ktwe-bg);
    color: var(--ktwe-text);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ktwe-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   HERO SECTION - Full width background
   ======================================== */
.ktwe-hero {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 50%, #3a7bd5 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 40px 0 60px;
}

/* Header Bar with Back Button */
.ktwe-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 0;
}

.ktwe-back-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.ktwe-back-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.ktwe-destination-badge {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.ktwe-hero-overlay {
    position: absolute;
    inset: 0;
    background: var(--ktwe-hero-overlay);
}

.ktwe-hero-inner {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    z-index: 2;
}

/* Date */
.ktwe-hero-date {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

/* Hero Weather Display */
.ktwe-hero-city {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 8px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.ktwe-hero-temp-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.ktwe-hero-temp {
    color: #fff;
    font-size: 72px;
    font-weight: 300;
    line-height: 1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.ktwe-hero-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.ktwe-hero-icon svg {
    width: 100%;
    height: 100%;
}

.ktwe-hero-details {
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.ktwe-divider {
    opacity: 0.6;
}

/* Search Box */
.ktwe-search-box {
    position: relative;
    max-width: 600px;
    margin-bottom: 16px;
}

.ktwe-search-form {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 50px;
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.ktwe-search-icon {
    padding: 0 12px 0 16px;
    color: #a0aec0;
    font-size: 20px;
}

.ktwe-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 16px;
    color: #2d3748;
    outline: none;
}

.ktwe-search-input::placeholder {
    color: #a0aec0;
}

.ktwe-search-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--ktwe-accent);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ktwe-search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.4);
}

/* Search Dropdown */
.ktwe-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 20px;
    right: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    z-index: 100;
}

.ktwe-search-dropdown.active {
    display: block;
}

.ktwe-search-item {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #2d3748;
    font-size: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.ktwe-search-item:hover {
    background: #f7fafc;
}

.ktwe-search-item:last-child {
    border-bottom: none;
}

/* Quick Cities */
.ktwe-quick-cities {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ktwe-city-chip {
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 50px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ktwe-city-chip:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ========================================
   CONTENT AREA
   ======================================== */
.ktwe-content {
    padding: 30px 0 60px;
}

.ktwe-section {
    margin-bottom: 30px;
}

.ktwe-section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--ktwe-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   HOURLY FORECAST
   ======================================== */
.ktwe-hourly-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ktwe-hourly-scroll::-webkit-scrollbar {
    display: none;
}

.ktwe-hour-card {
    flex-shrink: 0;
    background: var(--ktwe-surface);
    border: 1px solid var(--ktwe-border);
    border-radius: var(--ktwe-radius);
    padding: 16px 12px;
    text-align: center;
    min-width: 80px;
    transition: all 0.2s;
}

.ktwe-hour-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ktwe-shadow);
}

.ktwe-hour-time {
    display: block;
    font-size: 13px;
    color: var(--ktwe-text-muted);
    margin-bottom: 8px;
}

.ktwe-hour-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
}

.ktwe-hour-icon svg {
    width: 100%;
    height: 100%;
}

.ktwe-hour-condition {
    display: block;
    font-size: 11px;
    color: var(--ktwe-text-secondary);
    margin-bottom: 6px;
}

.ktwe-hour-temp {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--ktwe-text);
}

.ktwe-hour-rain {
    display: block;
    font-size: 11px;
    color: var(--ktwe-accent);
    margin-top: 4px;
}

/* ========================================
   TWO COLUMN LAYOUT
   ======================================== */
.ktwe-two-col {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

@media (max-width: 900px) {
    .ktwe-two-col {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   7-DAY FORECAST
   ======================================== */
.ktwe-forecast-list {
    background: var(--ktwe-surface);
    border: 1px solid var(--ktwe-border);
    border-radius: var(--ktwe-radius);
    padding: 8px 16px;
}

.ktwe-forecast-row {
    display: grid;
    grid-template-columns: 100px 50px 1fr 100px;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--ktwe-border);
}

.ktwe-forecast-row:last-child {
    border-bottom: none;
}

.ktwe-forecast-day {
    font-weight: 600;
    color: var(--ktwe-text);
}

.ktwe-forecast-icon {
    width: 36px;
    height: 36px;
}

.ktwe-forecast-icon svg {
    width: 100%;
    height: 100%;
}

.ktwe-forecast-condition {
    font-size: 14px;
    color: var(--ktwe-text-secondary);
}

.ktwe-forecast-temps {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ktwe-temp-high {
    font-weight: 700;
    color: var(--ktwe-text);
}

.ktwe-temp-low {
    color: var(--ktwe-text-muted);
}

/* ========================================
   SIDEBAR
   ======================================== */
.ktwe-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ktwe-sidebar-card {
    background: var(--ktwe-surface);
    border: 1px solid var(--ktwe-border);
    border-radius: var(--ktwe-radius);
    padding: 20px;
}

.ktwe-sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--ktwe-text);
}

.ktwe-sidebar-card p {
    font-size: 13px;
    color: var(--ktwe-text-secondary);
    margin: 0 0 16px;
}

.ktwe-detect-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--ktwe-accent);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ktwe-detect-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.ktwe-saved-locations {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--ktwe-border);
}

.ktwe-saved-locations h4 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ktwe-text-muted);
    margin: 0 0 12px;
}

.ktwe-location-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--ktwe-border);
    font-size: 14px;
}

.ktwe-location-item:last-child {
    border-bottom: none;
}

.ktwe-loc-menu {
    background: none;
    border: none;
    color: var(--ktwe-text-muted);
    cursor: pointer;
    font-size: 18px;
}

.ktwe-manage-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    border: 1px solid var(--ktwe-border);
    background: transparent;
    color: var(--ktwe-text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}

/* Destinations Card */
.ktwe-destinations-card .ktwe-dest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ktwe-dest-item {
    display: block;
    text-decoration: none;
    color: var(--ktwe-text);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.ktwe-dest-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--ktwe-shadow);
}

.ktwe-dest-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.ktwe-dest-placeholder {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.ktwe-dest-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ktwe-dest-temp {
    font-size: 12px;
    color: var(--ktwe-text-muted);
}

/* ========================================
   WEATHER ALERT
   ======================================== */
.ktwe-alert {
    display: flex;
    gap: 16px;
    background: linear-gradient(135deg, #f6e05e 0%, #d69e2e 100%);
    border-radius: var(--ktwe-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.ktwe-alert-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.ktwe-alert-content strong {
    display: block;
    font-size: 16px;
    color: #744210;
    margin-bottom: 4px;
}

.ktwe-alert-content p {
    margin: 0;
    font-size: 14px;
    color: #975a16;
}

/* ========================================
   WEATHER RADAR
   ======================================== */
.ktwe-radar-section {
    margin-top: 30px;
}

.ktwe-radar-map {
    background: var(--ktwe-surface);
    border: 1px solid var(--ktwe-border);
    border-radius: var(--ktwe-radius);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ktwe-radar-placeholder {
    text-align: center;
    color: var(--ktwe-text-muted);
}

.ktwe-radar-placeholder span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.ktwe-radar-placeholder p {
    margin: 0 0 4px;
    font-size: 16px;
    color: var(--ktwe-text);
}

.ktwe-radar-placeholder small {
    font-size: 13px;
}

/* ========================================
   WEATHER ICONS
   ======================================== */
.ktwe-icon {
    width: 64px;
    height: 64px;
}

.ktwe-icon svg {
    width: 100%;
    height: 100%;
}

.ktwe-icon-animated {
    animation: ktwe-float 3s ease-in-out infinite;
}

@keyframes ktwe-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ========================================
   DEMO NOTICE
   ======================================== */
.ktwe-demo-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 16px 24px;
    margin: 20px 0;
}

.ktwe-demo-notice p {
    margin: 0;
    color: #92400e;
}

.ktwe-demo-notice a {
    color: #92400e;
    text-decoration: underline;
    font-weight: 600;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .ktwe-hero {
        min-height: 400px;
        padding: 30px 0 40px;
    }
    
    .ktwe-hero-city {
        font-size: 36px;
    }
    
    .ktwe-hero-temp {
        font-size: 56px;
    }
    
    .ktwe-hero-icon {
        width: 60px;
        height: 60px;
    }
    
    .ktwe-forecast-row {
        grid-template-columns: 70px 40px 1fr 80px;
        gap: 10px;
    }
    
    .ktwe-forecast-condition {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ktwe-hero-details {
        font-size: 13px;
        gap: 8px;
    }
    
    .ktwe-forecast-row {
        grid-template-columns: 60px 36px 1fr 70px;
    }
    
    .ktwe-destinations-card .ktwe-dest-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   SHORTCODE STYLES
   ======================================== */
.ktwe-card-shortcode {
    background: var(--ktwe-surface);
    border: 1px solid var(--ktwe-border);
    border-radius: var(--ktwe-radius);
    padding: 24px;
    max-width: 300px;
}

.ktwe-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.ktwe-card-icon {
    width: 60px;
    height: 60px;
}

.ktwe-card-temp {
    font-size: 32px;
    font-weight: 700;
    color: var(--ktwe-text);
}

.ktwe-card-city {
    font-size: 14px;
    color: var(--ktwe-text-secondary);
}

.ktwe-card-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--ktwe-text-secondary);
}

.ktwe-mini {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ktwe-mini .ktwe-icon {
    width: 24px;
    height: 24px;
}

.ktwe-mini-temp {
    font-weight: 600;
}

.ktwe-mini-city {
    font-size: 12px;
    color: var(--ktwe-text-secondary);
}
