* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-primary: #0d0f1c;
    --bg-secondary: #1a1d2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --shadow: rgba(0, 0, 0, 0.3);
    --button-hover: #252837;
    --accent: #6366f1;
}

body.light-theme {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fc;
    --text-primary: #1a1d2e;
    --text-secondary: rgba(26, 29, 46, 0.7);
    --shadow: rgba(0, 0, 0, 0.12);
    --button-hover: #f0f2f7;
    --accent: #6366f1;
}

body.light-theme {
    background: var(--bg-primary);
}

body.light-theme .theme-toggle {
    border: 2px solid rgba(99, 102, 241, 0.2);
    background: var(--bg-card);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

body.light-theme .card {
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.12);
    border: 2px solid rgba(99, 102, 241, 0.25);
    background: var(--bg-card);
}

body.light-theme .search {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid rgba(99, 102, 241, 0.12);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
}

body.light-theme .search::placeholder {
    color: var(--text-secondary);
}

body.light-theme .location-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

body.light-theme .location-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
body.light-theme .search-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}
    background: transparent;
}

body.light-theme .day {
    background: rgba(99, 102, 241, 0.08);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.06);
}

body.light-theme .weather-time {
    background: rgba(99, 102, 241, 0.08);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
}

body.light-theme .temp-unit-toggle {
    background: rgba(99, 102, 241, 0.08);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
}

body.light-theme .chatbot-input-wrapper {
    background: rgba(99, 102, 241, 0.12);
    border-top: 2px solid rgba(99, 102, 241, 0.3);
}

body.light-theme #chatbotInput {
    background: rgba(99, 102, 241, 0.12);
    border: 2px solid rgba(99, 102, 241, 0.35);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

body.light-theme #chatbotInput::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

body.light-theme .suggestion-btn {
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

body.light-theme .chat-messages {
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid rgba(99, 102, 241, 0.3);
    box-shadow: inset 0 2px 6px rgba(99, 102, 241, 0.1);
}

body.light-theme .user-msg {
    background: rgba(99, 102, 241, 0.2);
    border: 2px solid rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

body.light-theme .bot-msg {
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid rgba(34, 197, 94, 0.4);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12);
}

body.light-theme .autocomplete-list {
    background: var(--bg-secondary);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
}

body.light-theme .autocomplete-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

body.light-theme .autocomplete-item {
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
}

body.light-theme .sun-box {
    background: rgba(99, 102, 241, 0.06);
    border: 1.5px solid rgba(99, 102, 241, 0.12);
}

body.light-theme .sun-box:hover {
    background: rgba(99, 102, 241, 0.12);
}

body.light-theme .humidity-section {
    background: rgba(99, 102, 241, 0.06);
    border: 1.5px solid rgba(99, 102, 241, 0.12);
}

body.light-theme .card .icon {
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.15)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

body.light-theme .card .icon:hover {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.22)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

body.light-theme .humidity-section .icon {
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

body.light-theme .humidity-section .icon:hover {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.2)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

body.light-theme .sun-icon {
    filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.12)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}

body.light-theme .sun-icon:hover {
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.18)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
}

body.light-theme .wind .icon {
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.14)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

body.light-theme .wind .icon:hover {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.2)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

body.light-theme .weather-icon {
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.15)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

body.light-theme .weather-icon:hover {
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.22)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: block;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    padding: 20px 0;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 24px;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
}

.container {
    width: 100%;
    max-width: 1400px;
    padding: 20px 16px;
    margin: 0 auto;
}

.top-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-wrapper {
    position: relative;
    width: 400px;
    max-width: 100%;
}

.search {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border-radius: 30px;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1background 0.3s, color 0.3s, box-shadow;
    transition: all 0.3s;
}

.search:focus {
    outline: none;
    background: var(--bg-secondary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.search::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background 0.3s;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.light-theme .search-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.location-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s, color 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.location-btn:hover {
    background: var(--button-hover);
    transform: translateY(-2px);
}

.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    min-height: 500px;
}

.card {
    background: var(--bg-card);
    padding: 18px 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 8px 32px var(--shadow);
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow);
}

.card-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    opacity: 0.9;
    letter-spacing: 0px;
    color: var(--text-primary);
}

.card .value {
    font-size: 28px;
    font-weight: bold;
    margin: 3px 0;
    line-height: 1;
    color: var(--text-primary);
}

.card span {
    font-size: 12px;
    opacity: 0.75;
    display: block;
    margin-top: 2px;
}

.card .icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.card .icon:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.icon {
    width: 60px;
    height: 60px;
}

.icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Main weather card */
.main-weather {
    position: relative;
    padding: 15px 30px 18px;
    text-align: center;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.weather-time {
    font-size: 13px;
    opacity: 0.75;
    position: absolute;
    top: 20px;
    left: 30px;
    background: rgba(255, 255, 255, 0.08);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

.temp-unit-toggle {
    position: absolute;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    width: 44px;
    height: 36px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.temp-unit-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.weather-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 12px;
    gap: 4px;
}

.weather-icon {
    width: 95px;
    height: 95px;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.weather-icon:hover {
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.weather-info h2 {
    font-size: 22px;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.weather-info h1 {
    font-size: 64px;
    font-weight: bold;
    margin: 0px 0 0 0;
    line-height: 0.9;
    letter-spacing: -1px;
}

.weather-info p {
    font-size: 15px;
    opacity: 0.8;
    margin: 0;
    font-weight: 400;
}

/* Forecast section */
.forecast {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-top: 10px;
    width: 100%;
}

.day {
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 3px;
    border-radius: 12px;
    text-align: center;
    font-size: 8px;
    line-height: 1;
    transition: all 0.3s;
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;
    height: fit-content;
    min-height: auto;
}

.day:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
}

.day img {
    width: 25px;
    height: 25px;
    margin: 0 auto;
    display: block;
}

/* Extra info section */
.extra-info {
    display: flex;
    gap: 0;
    flex-direction: row;
    align-items: center;
    padding: 12px 15px;
    justify-content: space-between;
}

.humidity-section {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.humidity-section .icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.18)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.humidity-section .icon:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.humidity-section div h4 {
    font-size: 10px;
    opacity: 0.75;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}

.humidity-section div p {
    font-size: 26px;
    font-weight: bold;
    margin: 0;
    line-height: 0.95;
}

.humidity-section div span {
    font-size: 10px;
    opacity: 0.7;
    display: block;
    margin-top: 2px;
    font-weight: 500;
}

.sun-boxes-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 280px;
}

.sun-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.sun-box:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sun-label {
    font-size: 9px;
    opacity: 0.7;
    min-width: 45px;
    letter-spacing: 0.2px;
}

.sun-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.15)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.sun-icon:hover {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.25)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.sun-time {
    font-size: 12px;
    font-weight: bold;
    margin-left: auto;
}

.sun-section {
    display: none;
}

.sun-item {
    display: none;
}

.sun-info {
    display: none;
}

/* Chatbot section */
.chatbot {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    height: 405px;
    border-radius: 12px;
}

.chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.chatbot-reset {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-reset:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    transform: rotate(180deg);
}

.chat-messages {  
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    padding-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
    margin-bottom: 0px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    justify-content: flex-start;
    align-items: flex-start;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    opacity: 0.6;
}

.chat-placeholder-img {
    width: 70px;
    height: 70px;
    animation: bounce 2s ease-in-out infinite;
}

.chat-msg {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    max-width: 90%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    transition: all 0.2s ease;
}

.user-msg {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 85%;
}

.bot-msg {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 85%;
}

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin-bottom: 6px;
    margin-top: auto;
}

.suggestion-btn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 1.2;
}

.suggestion-btn:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.35);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 5px;
    margin-top: auto;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: -16px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

#chatbotInput {
    flex: 1;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 11px;
    transition: all 0.2s;
}

#chatbotInput:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

#chatbotInput::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.wind {
    padding: 10px 12px;
    background: transparent;
}

.wind .card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.wind h3 {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wind #windSpeed {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.wind .icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.18)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.wind .icon:hover {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.aqi-card {
    background: transparent;
}

.uv-card {
    background: transparent;
}

.visibility-card {
    background: transparent;
}

.pressure-card {
    background: transparent;
}

/* Autocomplete dropdown */
.autocomplete-list {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 32px var(--shadow);
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* Loading state */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Responsive Design */

/* Extra Large Screens (1600px and above) */
@media (min-width: 1600px) {
    .container {
        padding: 30px 20px;
    }

    .dashboard {
        gap: 30px;
    }

    .card {
        padding: 25px;
    }

    .card .value {
        font-size: 32px;
    }

    .weather-info h1 {
        font-size: 72px;
    }
}

/* Large Screens (1200-1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
    .container {
        padding: 25px 18px;
    }
}

/* Medium Screens (1024-1199px) */
@media (max-width: 1199px) {
    .dashboard {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .left-panel,
    .right-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .center-panel {
        order: -1;
    }

    .container {
        max-width: 1000px;
    }

    .right-panel .wind {
        width: 100%;
        height: auto;
        align-self: start;
    }
}

/* Tablets (768-1023px) */
@media (max-width: 1023px) and (min-width: 769px) {
    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .search-wrapper {
        width: calc(100% - 120px);
        min-width: 250px;
    }

    .location-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .left-panel,
    .right-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .center-panel {
        width: 100%;
    }

    .forecast {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .card {
        padding: 14px;
    }

    .card .value {
        font-size: 26px;
    }

    .card h3 {
        font-size: 12px;
    }

    .card .icon {
        width: 60px;
        height: 60px;
    }

    .weather-info h1 {
        font-size: 52px;
    }

    .weather-info h2 {
        font-size: 18px;
    }

    .weather-icon {
        width: 85px;
        height: 85px;
    }

    .main-weather {
        padding: 20px;
    }

    .humidity-section {
        min-width: 200px;
        padding: 8px 12px;
    }

    .theme-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .chatbot {
        height: 400px;
    }

    .extra-info {
        flex-direction: column;
        gap: 10px;
    }

    .sun-boxes-container {
        min-width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Mobile Phones (481-768px) */
@media (max-width: 768px) and (min-width: 481px) {
    .container {
        padding: 12px 10px;
        max-width: 100%;
    }

    .top-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 15px;
    }

    .search-wrapper {
        width: calc(100% - 140px);
        min-width: 200px;
    }

    .search {
        padding: 10px 40px 10px 14px;
        font-size: 14px;
    }

    .location-btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        width: 100%;
    }

    .left-panel,
    .right-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .forecast {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .day {
        padding: 10px 8px;
        font-size: 12px;
    }

    .day img {
        width: 28px;
        height: 28px;
        margin-bottom: 4px;
    }

    .card {
        padding: 14px;
        border-radius: 10px;
    }

    .card .icon {
        width: 58px;
        height: 58px;
    }

    .card h3 {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .card .value {
        font-size: 24px;
    }

    .card span {
        font-size: 11px;
    }

    .main-weather {
        padding: 18px;
    }

    .weather-info h1 {
        font-size: 46px;
    }

    .weather-info h2 {
        font-size: 17px;
    }

    .weather-info p {
        font-size: 14px;
    }

    .weather-icon {
        width: 80px;
        height: 80px;
    }

    .weather-time {
        font-size: 12px;
        padding: 8px 14px;
        top: 14px;
        left: 14px;
    }

    .temp-unit-toggle {
        width: 40px;
        height: 34px;
        font-size: 13px;
        top: 14px;
        right: 14px;
    }

    .humidity-section {
        min-width: 100%;
        padding: 10px 14px;
        margin-bottom: 8px;
    }

    .humidity-section .icon {
        width: 54px;
        height: 54px;
    }

    .humidity-section div h4 {
        font-size: 10px;
    }

    .humidity-section div p {
        font-size: 24px;
    }

    .sun-boxes-container {
        min-width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sun-box {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 10px 12px;
        gap: 8px;
    }

    .sun-icon {
        width: 26px;
        height: 26px;
    }

    .sun-time {
        font-size: 13px;
    }

    .extra-info {
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px;
    }

    .wind {
        padding: 12px 14px;
    }

    .wind h3 {
        font-size: 11px;
    }

    .wind #windSpeed {
        font-size: 22px;
    }

    .wind .icon {
        width: 48px;
        height: 48px;
    }

    .theme-toggle {
        width: 42px;
        height: 42px;
        font-size: 20px;
        top: 12px;
        right: 12px;
    }

    .chatbot {
        height: 420px;
        padding: 14px;
        border-radius: 10px;
    }

    .chatbot-header h3 {
        font-size: 14px;
    }

    .chat-messages {
        padding: 12px;
        gap: 8px;
        margin-left: -14px;
        margin-right: -14px;
    }

    .chat-msg {
        font-size: 13px;
        padding: 9px 11px;
        max-width: 85%;
    }

    .suggestion-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-height: 36px;
    }

    #chatbotInput {
        padding: 10px 12px;
        font-size: 13px;
    }

    .chatbot-input-wrapper {
        gap: 6px;
        margin-left: -14px;
        margin-right: -14px;
        margin-bottom: -14px;
        padding: 10px 14px;
    }
}

/* Small Mobile Phones (321-480px) */
@media (max-width: 480px) {
    * {
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    body {
        padding: 10px 0;
    }

    .container {
        padding: 10px 8px;
        max-width: 100%;
    }

    .top-bar {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
    }

    .search-wrapper {
        width: 100%;
        order: 1;
    }

    .search {
        padding: 10px 40px 10px 14px;
        font-size: 14px;
    }

    .location-btn {
        width: 100%;
        padding: 10px 14px;
        font-size: 12px;
        order: 2;
    }

    .dashboard {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .left-panel,
    .right-panel,
    .center-panel {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .forecast {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .day {
        padding: 8px 6px;
        font-size: 11px;
    }

    .day img {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }

    .card {
        padding: 12px;
        border-radius: 10px;
    }

    .card .icon {
        width: 55px;
        height: 55px;
    }

    .card h3 {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .card .value {
        font-size: 22px;
    }

    .card span {
        font-size: 10px;
    }

    .main-weather {
        padding: 15px;
    }

    .weather-info h1 {
        font-size: 44px;
        margin: 0 0 0 0;
    }

    .weather-info h2 {
        font-size: 16px;
    }

    .weather-info p {
        font-size: 14px;
    }

    .weather-icon {
        width: 75px;
        height: 75px;
    }

    .weather-time {
        font-size: 11px;
        padding: 6px 12px;
        top: 12px;
        left: 12px;
    }

    .temp-unit-toggle {
        width: 38px;
        height: 32px;
        font-size: 12px;
        top: 12px;
        right: 12px;
    }

    .humidity-section {
        min-width: 100%;
        padding: 10px 12px;
        margin-bottom: 8px;
    }

    .humidity-section .icon {
        width: 50px;
        height: 50px;
    }

    .humidity-section div h4 {
        font-size: 9px;
    }

    .humidity-section div p {
        font-size: 22px;
    }

    .sun-boxes-container {
        min-width: 100%;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .sun-box {
        padding: 8px 12px;
        gap: 8px;
    }

    .sun-icon {
        width: 24px;
        height: 24px;
    }

    .sun-time {
        font-size: 12px;
    }

    .extra-info {
        flex-direction: column;
        gap: 12px;
        padding: 10px 12px;
    }

    .wind {
        padding: 10px 12px;
    }

    .wind h3 {
        font-size: 10px;
    }

    .wind #windSpeed {
        font-size: 20px;
    }

    .wind .icon {
        width: 45px;
        height: 45px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 18px;
        top: 10px;
        right: 10px;
    }

    .chatbot {
        height: 350px;
        padding: 12px;
        border-radius: 10px;
    }

    .chatbot-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .chatbot-header h3 {
        font-size: 13px;
    }

    .chat-messages {
        padding: 10px;
        gap: 6px;
        margin-left: -12px;
        margin-right: -12px;
    }

    .chat-msg {
        font-size: 12px;
        padding: 8px 10px;
    }

    .suggestion-btn {
        padding: 6px 10px;
        font-size: 10px;
    }

    #chatbotInput {
        padding: 8px 10px;
        font-size: 12px;
    }

    .chatbot-input-wrapper {
        gap: 4px;
        margin-left: -12px;
        margin-right: -12px;
        margin-bottom: -12px;
        padding: 8px 12px;
    }

    /* Autocomplete */
    .autocomplete-list {
        max-height: 150px;
        font-size: 12px;
    }

    .autocomplete-item {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Extra Small Devices (max 320px) */
@media (max-width: 320px) {
    .container {
        padding: 8px 6px;
    }

    .forecast {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .day {
        padding: 6px 4px;
        font-size: 10px;
    }

    .card {
        padding: 10px;
    }

    .card .value {
        font-size: 20px;
    }

    .weather-info h1 {
        font-size: 36px;
    }

    .weather-icon {
        width: 60px;
        height: 60px;
    }

    .search-wrapper {
        width: 100%;
    }

    .location-btn {
        font-size: 11px;
        padding: 8px 12px;
    }

    .chatbot {
        height: 300px;
        padding: 10px;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Landscape Mode - Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 8px 0;
    }

    .container {
        padding: 10px 12px;
    }

    .top-bar {
        margin-bottom: 12px;
        gap: 10px;
    }

    .dashboard {
        gap: 12px;
        min-height: auto;
    }

    .card {
        padding: 10px;
    }

    .card .value {
        font-size: 18px;
    }

    .card h3 {
        font-size: 9px;
    }

    .weather-info h1 {
        font-size: 32px;
    }

    .weather-info h2 {
        font-size: 14px;
    }

    .weather-icon {
        width: 60px;
        height: 60px;
    }

    .chatbot {
        height: 280px;
    }

    .forecast {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .day {
        font-size: 8px;
        padding: 4px 2px;
    }

    .main-weather {
        padding: 12px;
    }
}

/* Landscape Tablet */
@media (max-height: 600px) and (orientation: landscape) and (min-width: 769px) {
    .dashboard {
        gap: 15px;
    }

    .card {
        padding: 12px;
    }

    .weather-info h1 {
        font-size: 48px;
    }

    .chatbot {
        height: 350px;
    }
}

/* Touch Device Adjustments */
@media (hover: none) and (pointer: coarse) {
    button,
    input,
    .card {
        min-height: 44px;
    }

    .suggestion-btn {
        padding: 10px 12px;
        min-height: 44px;
    }

    .chat-msg {
        padding: 10px 12px;
    }

    .card:active {
        background: var(--bg-card-hover);
    }

    .suggestion-btn:active {
        background: rgba(99, 102, 241, 0.3);
    }
}

/* Print Styles */
@media print {
    .theme-toggle,
    .search-btn,
    .location-btn,
    .chatbot,
    .chat-suggestions {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
}
