/* Стили для модального окна */
.modal {
    display: flex;            /* всегда в DOM для плавной анимации */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;               /* начальное состояние */
    visibility: hidden;       /* скрыто визуально */
    pointer-events: none;     /* клики проходят сквозь */
    transition: opacity 0.35s ease;
}
 
.modal.active {
    opacity: 1;               /* плавно проявляется */
    visibility: visible;
    pointer-events: auto;     /* клики включаются */
}
 
.modal-content {
   background: rgba(255, 255, 255, 0.95);
   padding: 25px;
   border-radius: 20px;
   width: 90%;
   max-width: 400px;
   backdrop-filter: blur(0);
   -webkit-backdrop-filter: blur(0);
   box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
   transform: translateY(-20px) scale(0.9);
   opacity: 0;
   transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}
 
.modal-header {
    margin-bottom: 25px;
    text-align: center;
}
 
.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}
 
.input-group {
    margin-bottom: 20px;
}
 
.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}
 
.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(0, 122, 255, 0.08);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    color: #1a1a1a;
}

.input-group input:focus {
    outline: none;
    background: rgba(0, 122, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-group input::placeholder {
    color: #999;
}

.input-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(0, 122, 255, 0.08);
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    color: #1a1a1a;
    line-height: 1.4;
}

.input-group textarea:focus {
    outline: none;
    background: rgba(0, 122, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-group textarea::placeholder {
    color: #999;
}
 
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}
 
.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.modal-btn:active {
    transform: scale(0.98);
}
 
.confirm-btn,
.confirm-photo-btn {
    background: rgba(0, 122, 255, 0.12);
    color: #007AFF;
}

.confirm-btn:hover,
.confirm-photo-btn:hover {
    background: rgba(0, 122, 255, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}
 
.cancel-btn,
.cancel-photo-btn {
    background: rgba(120, 120, 128, 0.12);
    color: #666;
}

.cancel-btn:hover,
.cancel-photo-btn:hover {
    background: rgba(120, 120, 128, 0.18);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(120, 120, 128, 0.15);
}
 
/* Стили для выдвигающейся панели */
.info-panel {
    position: fixed;
    bottom: -200px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-out;
    z-index: 1500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
 
.info-panel.active {
    transform: translateY(-200px);
}
 
.nutrition-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}
 
.nutrition-item {
    text-align: center;
    padding: 10px;
    background: rgba(0, 122, 255, 0.1);
    border-radius: 10px;
}
 
.nutrition-label {
    font-size: 12px;
    color: black;
    margin-bottom: 5px;
}
 
.nutrition-value {
    font-size: 16px;
    font-weight: 600;
    color: black;
}
 
.meal-title {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: black;
}
 
.meal-info {
    cursor: pointer;
}

.container {
    padding: 70px 20px 70px 20px !important;
}

/* Стили для goal-card */
.goal-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 0 !important;
}

.target-icon {
    margin-left: 35px;
}

.target-icon img {
    width: 24px;
    height: 24px;
}

.goal-text {
    flex-grow: 1;
}

/* Анимации и переходы */
.premium-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}
 
.premium-content h3 {
    margin: 0 0 10px;
    color: #007AFF;
    font-size: 18px;
}
 
.premium-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}
 
@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
 
.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}
 
@keyframes fadeOut {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to { opacity: 0; transform: translate(-50%, -55%); }
}
 
.status-icons {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 1;
}

.status-icon {
    cursor: pointer;
    opacity: 1;
    position: relative;
    transition: transform 0.1s ease;
    user-select: none;
    outline: none;
}

.status-icon:active {
    transform: scale(0.9);
}
 
.camera-icon {
    cursor: pointer;
    opacity: 1;
    position: relative;
}
 
.progress-fill {
    width: 0;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.rotating {
    animation: rotate 1s linear infinite;
}
 
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Анимации появления элементов */
@keyframes fadeInItem {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}
 
/* Изначально скрываем все элементы */
.goal-text,
.target-icon,
.date-selector,
.progress-container,
.meal-item {
    opacity: 0;
}
 
/* Анимация для каждого элемента */
.content.show .goal-text {
    animation: fadeInItem 0.3s ease-in-out forwards;
}

.content.show .goal-card {
    animation: fadeInItem 0.3s ease-in-out forwards;
    visibility: visible;
}

.content.show .target-icon {
    animation: fadeInItem 0.3s ease-in-out forwards;
}

.content.show .date-selector {
    animation: fadeInItem 0.3s ease-in-out 0.1s forwards;
    margin-top: 10px;
}
 
.content.show .progress-container {
    animation: fadeInItem 0.3s ease-in-out 0.2s forwards;
}
 
.content.show .meals-list .meal-item {
    opacity: 0;
}
 
.content.show .meals-list .meal-item:nth-child(1) {
    animation: fadeInItem 0.3s ease-in-out 0.3s forwards;
}
 
.content.show .meals-list .meal-item:nth-child(2) {
    animation: fadeInItem 0.3s ease-in-out 0.4s forwards;
}
 
.content.show .meals-list .meal-item:nth-child(3) {
    animation: fadeInItem 0.3s ease-in-out 0.5s forwards;
}
 
.content.show .meals-list .meal-item:nth-child(4) {
    animation: fadeInItem 0.3s ease-in-out 0.6s forwards;
}

/* Стили для слайдера */
.content-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}
 
.slide {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}
 
.animating {
    width: 100%;
    height: 100%;
}
 
.animating .slide {
    position: absolute;
    left: 0;
    top: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Фиксированные отступы между компонентами */
.meal-item,
.progress-container,
.meals-list {
    margin-top: 15px;
}

.date-selector {
    margin-top: 10px;
    margin-bottom: 0;
}

/* Стили для аккордеона с полями БЖУ */
.accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding: 8px 10px;
    background: rgba(0, 122, 255, 0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.accordion-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: black;
}

.accordion-toggle .toggle-icon {
    transition: transform 0.3s ease;
}

.accordion-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.active {
    max-height: 200px;
    margin-top: 10px;
}

.nutrients-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.nutrients-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.nutrients-row .input-group label {
    font-size: 12px;
}

.nutrients-row .input-group input {
    padding: 8px;
    font-size: 14px;
}

/* Убираем белый фон «бумажки» у блока с БЖУ внутри модального окна */
.modal-content .accordion-content,
.modal-content .accordion-content.active {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
}

/* Простая красивая анимация только для стрелочек */
.date-selector .arrow {
    transition: transform 0.2s ease;
    border-radius: 50%;
    padding: 4px;
}

.date-selector .arrow:hover {
    transform: scale(1.1);
}

.date-selector .arrow:active {
    transform: scale(0.9);
}

.date-selector .arrow img {
    transition: filter 0.2s ease;
}

.date-selector .arrow:hover img {
    filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 122, 255, 0.3));
}

/* Анимация клика */
@keyframes arrowBounce {
    0% { transform: scale(1); }
    50% { transform: scale(0.85); }
    100% { transform: scale(1.05); }
}

.date-selector .arrow.clicked {
    animation: arrowBounce 0.3s ease;
}
