body {
    font-family: Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
}

.left-sidebar {
    grid-column: 1;
    display: grid;
    gap: 20px;
    grid-template-rows: auto auto auto;
    align-content: start;

}

.main-content {
    grid-column: 2;
    display: grid;
    gap: 20px;
    align-content: start;
}

.right-sidebar {
    grid-column: 3;
    display: grid;
    gap: 20px;
    align-content: start;
}

h1 {
    text-align: center;
    color: #333;
    grid-column: 1 / -1;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
    color: #2c3e50;
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card, .card, .image-card, .quote-card, .recipe-card, .traffic-card, .holiday-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.news-card:hover, .card:hover, .image-card:hover, .quote-card:hover, .recipe-card:hover, .traffic-card:hover, .holiday-card:hover {
    transform: translateY(-5px);
}

.news-image, .recipe-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
}

.news-title, .recipe-title {
    font-size: 18px;
    margin: 10px 0;
    color: #222;
}

.news-description {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    flex-grow: 1;
}

.news-source, .recipe-source {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.news-date {
    font-size: 12px;
    color: #888;
}

.loading {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin: 20px 0;
}

.card-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.currency-rate {
    font-size: 24px;
    font-weight: bold;
    color: #4285f4;
    margin: 10px 0;
}

.weather-temp {
    font-size: 24px;
    font-weight: bold;
    color: #e53935;
    margin: 10px 0;
}

.weather-details {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.weather-icon {
    width: 50px;
    height: 50px;
    margin-right: 10px;
}

.weather-description {
    font-size: 16px;
    color: #555;
}

.info-text {
    font-size: 14px;
    color: #666;
}

.update-time {
    font-size: 12px;
    color: #888;
    margin-top: 10px;
}

.city-selector, .recipe-selector, .month-selector {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.image-container {
    margin-top: 10px;
}

.random-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
}

.image-description {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.image-author {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.image-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 10px;
}

.image-btn {
    padding: 5px 10px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    flex-grow: 1;
}

.image-btn:hover {
    background-color: #ddd;
}

.quote-text {
    font-size: 16px;
    font-style: italic;
    color: #444;
    margin-bottom: 10px;
    flex-grow: 1;
}

.quote-author {
    font-size: 14px;
    color: #666;
    text-align: right;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    margin-top: 50px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.recipe-container {
    margin-top: 10px;
}

.recipe-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

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

.recipe-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin: 20px auto;
}

.recipe-full-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 5px;
}

.recipe-instructions {
    margin-top: 20px;
    white-space: pre-line;
}

.map-container {
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.traffic-info {
    margin-top: 10px;
}

.traffic-speed {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
    margin: 5px 0;
}

.traffic-level {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.traffic-low {
    background-color: #4CAF50;
}

.traffic-medium {
    background-color: #FFC107;
}

.traffic-high {
    background-color: #F44336;
}

.holiday-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

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

.holiday-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.holiday-date {
    font-size: 14px;
    color: #666;
}

.holiday-description {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
}

.news-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 800px;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
}

.news-full-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 20px;
}

.news-full-content {
    margin-top: 20px;
    line-height: 1.6;
}

.news-full-source {
    font-size: 14px;
    color: #888;
    margin-top: 20px;
    font-style: italic;
}

@media (max-width: 1200px) {
    body {
        grid-template-columns: 1fr;
    }

    .left-sidebar, .main-content, .right-sidebar {
        grid-column: 1;

    }

    .left-sidebar {
        order: 2;
    }
}

/* Мобильная версия (меньше 768px) */
@media (max-width: 768px) {
    body {
        padding: 10px;
        gap: 15px;
    }

    h1 {
        font-size: 1.8em;
        padding: 10px;
    }

    .left-sidebar, .main-content, .right-sidebar {
        gap: 15px;

    }

    .left-sidebar {
        order: 2;
    }

    .news-container {
        grid-template-columns: 1fr;
    }

    .news-card, .card, .image-card, .quote-card, .recipe-card, .traffic-card, .holiday-card {
        padding: 12px;
    }

    .news-image, .recipe-image {
        height: 150px;
    }

    .news-title, .recipe-title {
        font-size: 16px;
    }

    .news-description {
        font-size: 13px;
    }

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

    .currency-rate, .weather-temp, .traffic-speed {
        font-size: 20px;
    }

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

    .random-image {
        height: 180px;
    }

    .quote-text {
        font-size: 15px;
    }

    .modal-content {
        margin-top: 20px;
    }

    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }

    .recipe-modal-content, .news-modal-content {
        padding: 15px;
        margin: 10px auto;
    }

    .recipe-full-image, .news-full-image {
        max-height: 300px;
    }

    .map-container {
        height: 180px;
    }

    .image-actions {
        flex-direction: column;
        gap: 5px;
    }

    .image-btn {
        width: 100%;
        padding: 8px 10px;
    }

    .news-card, .card, .image-card, .quote-card, .recipe-card, .traffic-card, .holiday-card {
        margin-bottom: 10px;
    }

    .city-selector, .recipe-selector, .month-selector {
        padding: 10px;
        font-size: 14px;
    }
}

/* Дополнительная оптимизация для очень маленьких экранов */
@media (max-width: 480px) {
    body {
        padding: 8px;
        gap: 10px;
    }

    h1 {
        font-size: 1.5em;
        padding: 8px;
    }

    .news-image, .recipe-image, .random-image {
        height: 120px;
    }

    .map-container {
        height: 150px;
    }

    .currency-rate, .weather-temp, .traffic-speed {
        font-size: 18px;
    }

    .recipe-modal-content, .news-modal-content {
        padding: 10px;
    }

    .recipe-full-image, .news-full-image {
        max-height: 250px;
    }

    .modal-content {
        margin-top: 15px;
    }

    .close {
        top: 5px;
        right: 15px;
        font-size: 25px;
    }

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

    .card-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
}

.footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    order: 10;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    margin: 0 15px;
    color: #4285f4;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    font-size: 14px;
    color: #666;
}

/* Страницы политики и соглашения */
.privacy-container, .terms-container {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.privacy-content, .terms-content {
    line-height: 1.6;
    margin-bottom: 30px;
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #3367d6;
}

@media (max-width: 768px) {
    .privacy-container, .terms-container {
        padding: 20px;
        margin: 20px;
    }
}

/* Добавьте эти стили в styles.css */
.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    grid-column: 1 / -1;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    margin: 0;
}

.logo {
    height: 50px;
    width: auto;
}

/* Для мобильной версии */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .logo {
        height: 40px;
    }

    h1 {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 35px;
    }

    h1 {
        font-size: 1.5em;
    }
}

/* Добавьте эти стили в styles.css */
.question-card {
    padding: 15px;
    box-sizing: border-box; /* Добавлено */
}

.question-input {
    width: calc(100%); /* Учитываем padding */
    height: 100px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-family: Arial, sans-serif;
    box-sizing: border-box; /* Добавлено */
    max-width: 100%; /* Добавлено */
}

.question-submit {
    width: 100%;
    padding: 10px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    box-sizing: border-box; /* Добавлено */
}

.question-submit:hover {
    background-color: #3367d6;
}

.question-response {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.error {
    background-color: #f2dede;
    color: #a94442;
}

@media (max-width: 768px) {
    .question-card {
        padding: 12px;
    }

    .question-input {
        height: 80px;
        padding: 8px;
    }

    .question-submit {
        padding: 8px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .question-card {
        padding: 10px;
    }

    .question-input {
        height: 70px;
        padding: 6px;
    }
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-link:hover {
    opacity: 0.8;
}