/* Основной стиль */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(to bottom, #f4f4f9, #e8e8ee);
    margin: 0;
    padding: 0;
    color: #333;
}

header {
    background: linear-gradient(to right, #007BFF, #0056b3);
    color: #fff;
    padding: 20px 0;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

header .logo h1 {
    margin: 0;
    font-size: 36px;
    font-weight: bold;
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

header nav ul li {
    display: inline;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: color 0.3s;
}

header nav ul li a:hover {
    color: #FFD700;
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.form-container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    text-align: center;
}

.form-container h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: #007BFF;
}

.form-container input,
.form-container button {
    width: calc(33% - 20px);
    padding: 12px;
    margin: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

.form-container input:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.form-container button {
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.form-container button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.dreams-container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dreams-container h2 {
    margin-bottom: 20px;
    font-size: 28px;
    color: #007BFF;
    text-align: center;
}

.dream {
    background: #f9f9f9;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.dream:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dream h3 {
    margin: 0;
    font-size: 22px;
    color: #007BFF;
}

.dream p {
    margin: 10px 0 0;
    font-size: 16px;
    color: #555;
}

footer {
    background: linear-gradient(to right, #0056b3, #007BFF);
    color: #fff;
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    font-size: 16px;
}


#addDreamModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 91%;
    overflow-y: auto; /* Добавляем прокрутку, если контент превышает высоту */
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

#addDreamModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Затемнение */
    z-index: 999;
    display: none;
}

#addDreamModal.active {
    display: block;
}

#addDreamModal label {
    display: block;
    font-weight: bold;
    margin: 10px 0 5px;
    color: #333;
}

#addDreamModal input,
#addDreamModal textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

#addDreamModal textarea {
    resize: none;
}

#addDreamModal button {
    padding: 10px 20px;
    margin-right: 10px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

#addDreamModal button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

#addDreamModal button#closeModal {
    background-color: #f4f4f4;
    color: #333;
}

#addDreamModal button#closeModal:hover {
    background-color: #ddd;
}

/* Анимация модального окна */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#addDreamButton {
    background-color: #28a745;
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px auto;
    display: block;
}

#addDreamButton:hover {
    background-color: #218838;
    transform: scale(1.05);
}

#addDreamButton:active {
    background-color: #1e7e34;
    transform: scale(1);
}   

.form-container form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Расстояние между элементами */
}

.form-container input,
.form-container button {
    width: 100%; /* Растягиваем на всю ширину */
    max-width: 400px; /* Ограничиваем максимальную ширину */
    box-sizing: border-box; /* Учитываем padding и border в ширине */
}

.form-container button {
    max-width: 200px; /* Кнопка уже других элементов */
}

/* Для экранов до 768px */
@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }

    header p {
        font-size: 16px;
    }

    #addDreamButton {
        padding: 10px 20px;
        font-size: 14px;
    }

    .form-container {
        padding: 20px;
    }

    .form-container h2 {
        font-size: 22px;
    }

    .form-container input,
    .form-container button {
        width: 100%; /* Поля растягиваются на всю ширину */
    }

    .dreams-container h2 {
        font-size: 22px;
    }

    .dream {
        padding: 10px;
    }

    .dream h3 {
        font-size: 18px;
    }

    .dream p {
        font-size: 14px;
    }
}

/* Для экранов до 480px */
@media (max-width: 480px) {
    header h1 {
        font-size: 20px;
    }

    header p {
        font-size: 14px;
    }

    #addDreamButton {
        font-size: 12px;
        padding: 8px 16px;
    }

    .form-container h2 {
        font-size: 20px;
    }

    .dream h3 {
        font-size: 16px;
    }

    .dream p {
        font-size: 12px;
    }

    .form-container input,
    .form-container button {
        font-size: 14px;
        padding: 8px;
    }
}

/* Стили для карточек мечт */
.dream-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dream-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.dream-card h3 {
    font-size: 20px;
    color: #007BFF;
    margin: 0 0 10px;
}

.dream-description {
    font-size: 16px;
    color: #555;
    margin: 0 0 15px;
}

.dream-amount {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px;
}

.dream-progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    appearance: none;
}

.dream-progress::-webkit-progress-bar {
    background-color: #f3f3f3;
    border-radius: 4px;
}

.dream-progress::-webkit-progress-value {
    background-color: #007BFF;
    border-radius: 4px;
}

.dream-progress::-moz-progress-bar {
    background-color: #007BFF;
    border-radius: 4px;
}