/* Global Styles */
body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    /* Default Dark Mode */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #f0f0f0;
    /* Default Text Color */
    transition: background 0.5s ease, color 0.5s ease;
}

body.light-mode {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
}

/* Navbar */
.navbar {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.navbar-brand {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Main Container */
.weather-container {
    background: rgba(0, 0, 0, 0.6);
    /* Default Dark Mode Background */
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    margin-bottom: 6rem; /* Ensure space for fixed install prompt */
    transition: all 0.3s ease;
}

body.light-mode .weather-container {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #333;
}

/* Form Elements */
.form-control {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    /* More transparent/darker for better contrast in dark mode */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #fff;
    /* White text for dark mode */
    transition: background 0.3s ease, color 0.3s ease;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: none;
    /* Removed weird highlight */
    outline: none;
}

body.light-mode .form-control {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body.light-mode .form-control::placeholder {
    color: #6c757d;
}

.btn-search {
    border-radius: 50px;
    padding: 0.75rem 2rem;
    background: linear-gradient(45deg, #11998e, #38ef7d);
    border: none;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: pulse-green 2s infinite;
}

.btn-search.no-animation {
    animation: none;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 239, 125, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(56, 239, 125, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 239, 125, 0);
    }
}

.btn-search:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    animation: none;
}

/* Weather Result */
.weather-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

.weather-details-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    margin-top: 1rem;
    transition: transform 0.3s;
}

body.light-mode .weather-details-card {
    background: rgba(255, 255, 255, 0.5);
}

.weather-details-card:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

/* Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 70px;
    /* Wider for icons */
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #2c3e50;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked+.slider {
    background-color: #000;
}

input:checked+.slider:before {
    transform: translateX(36px);
}

/* Icons inside slider */
.sun-icon {
    color: #f39c12;
    font-size: 1.2rem;
    transition: opacity 0.3s;
    line-height: 0;
    /* Fix vertical alignment */
    position: relative;
    top: 1px;
    /* Micro-adjustment */
}

.moon-icon {
    color: #f1c40f;
    font-size: 1rem;
    transition: opacity 0.3s;
    line-height: 0;
    /* Fix vertical alignment */
}

/* Desktop Install Button */
#desktop-install-btn {
    display: none;
    /* Hidden by default */
    margin-right: 1rem;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

#desktop-install-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* Hide icons based on state if needed, or just let the ball cover them */
/* Actually, let's make them static background elements */
/* Suggestions Dropdown */
#suggestions {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.list-group-item {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
}

body.light-mode .list-group-item {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

body:not(.light-mode) .list-group-item {
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.list-group-item:hover {
    background: rgba(255, 255, 255, 1);
}

body:not(.light-mode) .list-group-item:hover {
    background: rgba(50, 50, 50, 1);
}

.list-group-item:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: slideUp 0.5s ease-out;
}

body.light-mode .pwa-install-prompt {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.pwa-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}