@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #303f9f;
    --secondary-color: #5c6bc0;
    --bg-color: #37474f;
    --card-bg: #232931;
    --text-color: #ffffff;
    --hover-color: #1a237e;
    --shadow-color: rgba(0, 0, 0, 0.35);
    --gradient-start: #5c6bc0;
    --gradient-end: #0d47a1;
    --stat-bg: rgba(255, 255, 255, 0.08);
    --stat-border: rgba(255, 255, 255, 0.1);
    --modal-bg: rgba(35, 41, 49, 0.95);
}

.light-mode {
    --primary-color: #303f9f;
    --secondary-color: #5c6bc0;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --hover-color: #1a237e;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #5c6bc0;
    --gradient-end: #0d47a1;
    --stat-bg: #f8f9fa;
    --stat-border: rgba(0, 0, 0, 0.05);
    --modal-bg: rgba(255, 255, 255, 0.95);
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body{
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.desktop-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.theme-btn, .color-picker-btn {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(48, 63, 159, 0.2);
}

.theme-btn:hover, .color-picker-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(48, 63, 159, 0.3);
}

.format-help-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.format-help-popup.active {
    display: flex;
}

.popup-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.popup-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--secondary-color);
}

.format-example {
    background: var(--stat-bg);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid var(--stat-border);
}

.format-example strong {
    display: block;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.example {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.note {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 15px;
    font-style: italic;
}

.got-it-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.got-it-btn:hover {
    background: var(--hover-color);
    transform: translateY(-2px);
}

.format-help-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px;
    margin-left: 5px;
}

.container{
    width: 100%;
    max-width: 900px;
    background-color: var(--card-bg);
    color: var(--text-color);
    border-radius: 25px;
    box-shadow: 0 5px 15px var(--shadow-color);
    overflow: hidden;
}

.left-info{
    width: 260px;
    height: 400px;
    float: left;
    position: relative;
    background: url("image.jpg") center/cover no-repeat;
    overflow: hidden;
}

.pic-gradient{
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, var(--gradient-start) 10%, var(--gradient-end) 100%);
    opacity: 0.7;
}

.today-info{
    position: absolute;
    display: flex;
    flex-direction: column;
    top: 25px;
    left: 20px;
    right: 20px;
    z-index: 2;
    color: white;
}

.today-info h2{
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.today-info span{
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.today-info div{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.today-weather{
    position: absolute;
    display: flex;
    flex-direction: column;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 2;
    color: white;
}

.today-weather .bx{
    font-size: 4.6rem;
    margin-bottom: 10px;
}

.weather-temp{
    font-weight: 700;
    font-size: 3.5rem;
    margin: 5px 0;
}

.today-weather h3{
    font-size: 1.5rem;
    opacity: 0.9;
    font-weight: 500;
}

.right-info{
    float: right;
    width: calc(100% - 260px);
    height: 400px;
    padding: 25px 35px;
    display: flex;
    flex-direction: column;
}

.weather-stats-container {
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat-card {
    background: var(--stat-bg);
    border: 1px solid var(--stat-border);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.stat-icon {
    width: 45px;
    height: 45px;
    background: var(--secondary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
}

.days-list{
    display: flex;
    list-style: none;
    margin: 15px 0 20px;
    gap: 12px;
    flex: 1;
}

.days-list li{
    flex: 1;
    background: var(--stat-bg);
    padding: 15px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid var(--stat-border);
}

.days-list li .bx{
    margin-bottom: 8px;
    font-size: 1.8rem;
    color: var(--secondary-color);
}

.days-list li span{
    font-size: 0.9rem;
    font-weight: 500;
}

.days-list li:hover{
    transform: translateY(-5px);
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.days-list li:hover .bx{
    color: white;
}

.days-list li .day-temp{
    margin-top: 5px;
    font-weight: 700;
    font-size: 1.2rem;
}

.btn-container{
    padding-top: 10px;
    margin-top: auto;
}

.loc-button{
    outline: none;
    width: 100%;
    border: none;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(48, 63, 159, 0.2);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
}

.loc-button:hover{
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(48, 63, 159, 0.25);
}

.color-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.color-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--modal-bg);
    border-radius: 25px 25px 0 0;
    padding: 25px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--stat-border);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.color-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 25px;
}

.color-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.color-option label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    min-width: 120px;
}

.color-option input[type="color"] {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-option input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-option input[type="color"]::-webkit-color-swatch {
    border: 3px solid var(--text-color);
    border-radius: 12px;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-color);
    border: 2px solid var(--text-color);
}

#secondaryPreview {
    background: var(--secondary-color);
}

.reset-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: var(--secondary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(92, 107, 192, 0.2);
}

.reset-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(92, 107, 192, 0.25);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-top: 10px;
    }
    
    .desktop-controls {
        display: none;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin-top: 0;
    }
    
    .left-info, .right-info {
        float: none;
        width: 100%;
        height: auto;
    }
    
    .left-info {
        height: 250px;
        min-height: 250px;
        border-radius: 15px 15px 0 0;
    }
    
    .today-weather .bx {
        font-size: 2.8rem !important;
        margin-bottom: 5px;
    }
    
    .weather-temp {
        font-size: 2.2rem !important;
    }
    
    .today-weather h3 {
        font-size: 1.1rem !important;
    }
    
    .today-info h2 {
        font-size: 1.4rem !important;
    }
    
    .today-info span {
        font-size: 0.85rem !important;
    }
    
    .right-info {
        padding: 20px;
        border-radius: 0 0 15px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .days-list {
        flex-wrap: wrap;
        margin: 15px 0;
    }
    
    .days-list li {
        flex: 1 0 calc(50% - 6px);
        min-width: 140px;
        margin-bottom: 12px;
        padding: 12px 10px;
    }
    
    .days-list li .bx {
        font-size: 1.5rem !important;
        margin-bottom: 5px;
    }
    
    .days-list li .day-temp {
        font-size: 1rem !important;
    }
    
    .btn-container {
        padding-top: 10px;
        margin-top: 10px;
    }
    
    .loc-button {
        padding: 12px;
        border-radius: 12px;
        font-size: 0.9rem;
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        bottom: 0;
        top: auto;
        left: 0;
        transform: none;
        border-radius: 25px 25px 0 0;
        padding: 20px;
    }
    
    .mobile-controls {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1000;
        display: flex;
        gap: 10px;
    }
    
    .mobile-controls button {
        width: 50px;
        height: 50px;
        border-radius: 25px;
        border: none;
        background: var(--primary-color);
        color: white;
        font-size: 1.3rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 15px rgba(48, 63, 159, 0.3);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 800px;
        height: 380px;
    }
    
    .left-info {
        width: 240px;
        height: 380px;
    }
    
    .right-info {
        width: calc(100% - 240px);
        height: 380px;
        padding: 20px 25px;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.4rem;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .days-list {
        gap: 10px;
    }
    
    .days-list li {
        padding: 15px 10px;
    }
    
    .loc-button {
        padding: 12px;
        font-size: 0.95rem;
    }
}

@media (min-width: 1025px) {
    .mobile-controls {
        display: none;
    }
    
    .container {
        display: flex;
        max-width: 950px;
        height: 420px;
    }
    
    .left-info {
        width: 300px;
        height: 420px;
    }
    
    .right-info {
        width: calc(100% - 300px);
        height: 420px;
    }
    
    .days-list {
        gap: 15px;
    }
    
    .loc-button {
        padding: 14px;
        font-size: 1rem;
    }
}