:root {

    --primary-color: #3B82F6;

    --secondary-color: #06B6D4;

    --background-dark: #0f172a;



    --glass-bg: rgba(30, 41, 59, 0.6);

    --glass-border: rgba(255, 255, 255, 0.08);

    --glass-blur: 20px;

    --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);


    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;

    --font-main: 'Outfit', sans-serif;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;


    --bg-gradient-default: radial-gradient(circle at top right, #1e293b, #0f172a);
    --bg-gradient-sunny: linear-gradient(135deg, #1e40af 0%, #0f172a 100%);

    --bg-gradient-rain: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --bg-gradient-snow: linear-gradient(135deg, #334155 0%, #1e293b 50%, #0f172a 100%);

    --bg-gradient-storm: linear-gradient(135deg, #312e81 0%, #1e1b4b 50%, #0f172a 100%);

    --bg-gradient-cloudy: linear-gradient(135deg, #374151 0%, #1f2937 50%, #0f172a 100%);


    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    min-height: 100vh;
    background: var(--background-dark);

    background-image: var(--bg-gradient-default);
    background-attachment: fixed;
    background-size: cover;
    transition: background-image 1s ease-in-out;

    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 1200px;

    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
    flex: 1;

}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.team-logo {
    height: 70px;
    width: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.weather-card .search-btn {
    width: 100%;

    margin-top: 20px;
}

.controls button {
    background-color: var(--card-background-dark);
    color: var(--text-color-light);
    border: none;
    padding: 10px 15px;
    margin-left: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.controls button:hover {
    background-color: #383852;
    transform: translateY(-2px);
}

.controls button:active {
    transform: translateY(0);
}

.weather-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;

    gap: 25px;

    align-items: stretch;
}

.search-container {
    display: grid;
    grid-template-columns: 2fr 1fr;

    gap: 25px;

    margin-bottom: 40px;
    align-items: center;
}

.search-group-left {
    display: flex;
    gap: 15px;
    width: 100%;
}

.city-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.city-input-wrapper .search-input {
    padding-right: 48px;
    width: 100%;
}

.location-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.location-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--primary-color);
    transform: translateY(-50%) scale(1.05);
}

.location-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.location-btn.loading {
    pointer-events: none;
}

.location-btn.loading svg {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.search-input,
.date-input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0 20px;
    height: 48px;
    line-height: normal;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition-smooth);
    display: block;
    min-width: 0;
}

.date-input {
    flex-grow: 0;
    width: 170px;

    position: relative;
}

.search-input:focus,
.date-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(68, 138, 255, 0.15);
}

.search-btn,
.controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 24px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;

}

.search-btn {
    width: 100%;
}

.controls button {
    width: auto;

    min-width: 60px;

}

.date-input::-webkit-calendar-picker-indicator {
    background-color: transparent;
    padding: 5px;
    cursor: pointer;
    opacity: 1;

    filter: invert(1);







    height: 20px;
    width: 20px;
    margin-left: 10px;

}

.date-input::after {
    display: none;
}

.search-btn:hover {
    background: #2979FF;

    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(68, 138, 255, 0.4);
}

.city-name {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.date-display {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1.1rem;
}

.temperature {
    font-size: 6rem;
    font-weight: 700;
    letter-spacing: -3px;
    background: linear-gradient(180deg, #fff 20%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.15));

}

.temp-low {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.weather-description {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.weather-details {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;

    border-radius: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-item.full-width {
    flex: 1 1 100%;
}

.detail-item div:first-child {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 500;
}

.detail-item .precip-summary {
    font-size: 1.4rem;

    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-card h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.favorite-city-item {
    margin-bottom: 10px;

    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-city-item span {
    flex-grow: 1;
    padding-right: 10px;
    cursor: pointer;
}

.favorite-city-item .remove-btn {
    background: none;
    border: none;
    color: var(--text-color-dark);
    font-weight: bold;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    transition: color 0.2s ease;
}

.favorite-city-item .remove-btn:hover {
    color: var(--secondary-color);
}

.favorite-city-item:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

.favorite-city-item:hover .remove-btn {
    color: var(--background-dark);
}

.no-favorites {
    text-align: center;
    color: var(--text-color-dark);
    font-style: italic;
    padding: 20px 0;
}

.planner-warnings {
    background-color: var(--card-background-dark);
    padding: 20px;
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-base);
    color: var(--text-color-light);
    margin-top: 30px;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.5s ease, padding 0.5s ease;
}

.planner-warnings h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.planner-warnings.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.warning-item {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color-light);
}

.warning-title {
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 4px;
    font-size: 0.9em;
}

.warning-level-danger {
    background-color: var(--planner-danger-bg);
    border-left-color: var(--planner-danger-text);
    color: var(--planner-danger-text);
}

.warning-level-danger .warning-title {
    color: var(--planner-danger-text);
}

.warning-level-warning {
    background-color: var(--planner-warning-bg);
    border-left-color: var(--planner-warning-text);
    color: var(--planner-warning-text);
}

.warning-level-warning .warning-title {
    color: var(--planner-warning-text);
}

.warning-level-success {
    background-color: var(--planner-success-bg);
    border-left-color: var(--planner-success-text);
    color: var(--planner-success-text);
}

.warning-level-success .warning-title {
    color: var(--planner-success-text);
}

.no-warning {
    font-size: 0.95em;
    padding: 5px 0;
    color: var(--text-color-dark);
}

footer {
    padding: 20px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.9rem;

    color: var(--text-color-dark);
}

.weather-card {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.footer-content .version {
    font-weight: 600;
    color: var(--secondary-color);
}

.space-apps-logo img {
    height: 35px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.space-apps-logo .light-logo {
    display: none;
}

.space-apps-logo .dark-logo {
    display: block;
}

.light-mode .space-apps-logo .light-logo {
    display: block;
}

.light-mode .space-apps-logo .dark-logo {
    display: none;
}

.space-apps-logo img:hover {
    opacity: 1;
}

@media (max-width: 600px) {
    .container {
        padding: 0 15px;

    }

    .main-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }


    header {
        flex-direction: column;
        align-items: center;

        padding: 10px 0;
        gap: 15px;
    }

    .logo {
        flex-direction: row;

        align-items: center;
        justify-content: center;
        margin-bottom: 5px;
        font-size: 1.4em;

    }

    .team-logo {
        height: 50px;
        width: 50px;
        margin-right: 12px;
    }


    .controls {
        display: flex;
        justify-content: center;
        gap: 10px;
        width: 100%;
        flex-wrap: wrap;
    }

    .controls button {
        padding: 8px 14px;
        font-size: 0.85em;
        margin-left: 0;
        flex: 1;

        justify-content: center;
        max-width: 150px;
    }


    .search-container {
        display: flex;

        flex-direction: column;
        gap: 12px;
        margin-bottom: 25px;
    }

    .search-group-left {
        flex-direction: column;

        gap: 12px;
        width: 100%;
    }

    .city-input-wrapper {
        width: 100%;
    }

    .search-input,
    .date-input,
    .search-btn {
        width: 100%;

        height: 48px;

        font-size: 1rem;
    }


    .date-input {
        width: 100%;
        max-width: 100%;
    }

    .weather-card {
        padding: 20px;
        min-height: auto;
        margin-bottom: 20px;
    }


    .city-name {
        font-size: 2.5rem;
        text-align: center;
        line-height: 1.2;
    }

    .temperature {
        font-size: 4.5rem;
        text-align: center;
    }

    .weather-description {
        font-size: 1.4rem;
        text-align: center;
        justify-content: center;
    }

    .weather-details {
        flex-direction: column;
        gap: 10px;
    }


    footer {
        padding: 20px 15px;
        margin-top: 30px;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-content div {
        order: initial;
    }



    .space-apps-logo img {
        height: 30px;
    }
}

.empty-state-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-color-light);
    animation: fadeIn 0.5s ease-out;
}

.empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.empty-state-message h3 {
    font-size: 2.2em;

    margin-bottom: 10px;
    color: var(--primary-color);
}

.empty-state-message p {
    font-size: 1.3em;

    color: var(--text-color-dark);
    max-width: 400px;

    margin: 0 auto;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.weather-data-container {
    animation: fadeIn 0.5s ease-out;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--card-background-dark);
    color: var(--text-color-light);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out forwards;
    backdrop-filter: blur(10px);
}

.toast.error {
    border-left-color: #ff5252;
}

.toast.success {
    border-left-color: #00e676;
}

.toast.info {
    border-left-color: #2979ff;
}

.toast-message {
    font-size: 0.95em;
    margin-right: 10px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-color-dark);
    cursor: pointer;
    font-size: 1.2em;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-color-light);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@media (max-width: 600px) {
    #toast-container {
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    #cacheStatus {
        font-size: 11px;
        padding: 6px 12px;
    }

    .weather-main {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .temperature {
        font-size: 3.5em;
    }

    .weather-description {
        font-size: 1.5em;
        margin-left: 0;
        justify-content: center;
    }
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.popup-content {
    background-color: var(--card-background-dark);
    color: var(--text-color-light);
    padding: 30px;
    border-radius: 16px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--primary-color);
    animation: scaleIn 0.3s ease-out;
    position: relative;
}

.popup-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.popup-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.popup-text {
    margin-bottom: 25px;
    line-height: 1.5;
    color: var(--text-color-dark);
}

.popup-close-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.popup-close-btn:hover {
    background-color: var(--secondary-color);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}