@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    background: linear-gradient(135deg, #FFF8F8 0%, #FEF5F5 25%, #FDF0F0 50%, #FCE8E8 75%, #FFF8F8 100%);
    background-size: 400% 400%;
    background-attachment: scroll;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    height: auto;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overscroll-behavior-y: contain;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Переконаємося, що контент видимий */
.container {
    visibility: visible !important;
    opacity: 1 !important;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 28rem;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

/* Абстрактні фонові елементи для краси */
.abstract-shape {
    position: fixed !important;
    border-radius: 50%;
    opacity: 0.2;
    filter: blur(90px);
    z-index: 0;
    animation: float 25s infinite ease-in-out;
    pointer-events: none !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
}

.abstract-shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #F5D5D5, #E8C4C4, #D4A5A5, #C89B9B);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.abstract-shape-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, #E8C4C4, #D4A5A5, #C89B9B, #B88A8A);
    bottom: -150px;
    right: -150px;
    animation-delay: 8s;
}

.abstract-shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #F0D8D8, #E8C4C4, #D4A5A5, #C89B9B);
    top: 50%;
    right: -100px;
    animation-delay: 16s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    25% {
        transform: translate(50px, -60px) scale(1.15) rotate(90deg);
    }
    50% {
        transform: translate(-40px, 40px) scale(0.85) rotate(180deg);
    }
    75% {
        transform: translate(60px, 30px) scale(1.1) rotate(270deg);
    }
}

/* Анімовані геометричні фігури */
.animated-shape {
    position: absolute;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
}

.shape-circle {
    border-radius: 50%;
    background: linear-gradient(135deg, #D4A5A5, #C89B9B);
}

.shape-triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid #D4A5A5;
}

.shape-square {
    background: linear-gradient(135deg, #E8C4C4, #D4A5A5);
    transform: rotate(45deg);
}

/* Позиції та анімації для фігур */
.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 15%;
    animation: moveCircle1 20s infinite ease-in-out;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 25%;
    animation: moveCircle2 18s infinite ease-in-out;
}

.shape-3 {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 10%;
    animation: moveCircle3 22s infinite ease-in-out;
}

.shape-4 {
    top: 25%;
    right: 20%;
    animation: moveTriangle1 16s infinite ease-in-out;
}

.shape-5 {
    top: 65%;
    right: 30%;
    animation: moveTriangle2 19s infinite ease-in-out;
}

.shape-6 {
    width: 50px;
    height: 50px;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    animation: moveSquare1 17s infinite ease-in-out;
}

.shape-7 {
    width: 70px;
    height: 70px;
    top: 55%;
    right: 15%;
    animation: moveSquare2 21s infinite ease-in-out;
}

/* Анімації руху для кіл */
@keyframes moveCircle1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(60px, 40px) scale(1.2);
    }
    50% {
        transform: translate(30px, -50px) scale(0.8);
    }
    75% {
        transform: translate(-40px, 20px) scale(1.1);
    }
}

@keyframes moveCircle2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-50px, -60px) scale(1.3);
    }
    66% {
        transform: translate(70px, 40px) scale(0.7);
    }
}

@keyframes moveCircle3 {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
    50% {
        transform: translate(80px, 60px) scale(1.4) rotate(180deg);
    }
}

/* Анімації руху для трикутників */
@keyframes moveTriangle1 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-50px, 40px) rotate(90deg);
    }
    50% {
        transform: translate(60px, -30px) rotate(180deg);
    }
    75% {
        transform: translate(-30px, -50px) rotate(270deg);
    }
}

@keyframes moveTriangle2 {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(55px, 45px) rotate(120deg);
    }
    66% {
        transform: translate(-45px, 35px) rotate(240deg);
    }
}

/* Анімації руху для квадратів */
@keyframes moveSquare1 {
    0%, 100% {
        transform: translateX(-50%) translateY(0) rotate(45deg) scale(1);
    }
    25% {
        transform: translateX(-50%) translate(40px, -45px) rotate(135deg) scale(1.2);
    }
    50% {
        transform: translateX(-50%) translate(-35px, 50px) rotate(225deg) scale(0.8);
    }
    75% {
        transform: translateX(-50%) translate(45px, 25px) rotate(315deg) scale(1.1);
    }
}

@keyframes moveSquare2 {
    0%, 100% {
        transform: translate(0, 0) rotate(45deg) scale(1);
    }
    40% {
        transform: translate(-60px, -40px) rotate(225deg) scale(1.3);
    }
    80% {
        transform: translate(50px, 55px) rotate(405deg) scale(0.9);
    }
}

/* Спрощені кнопки */
.card-button {
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 1) !important;
}

.card-button:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

.icon-wrapper {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.card-button:hover .icon-wrapper {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Спрощений градієнтний текст */
.gradient-text {
    background: linear-gradient(135deg, #C89B9B 0%, #D4A5A5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Профіль користувача */
#user-profile {
    animation: fadeIn 0.3s ease;
}

#user-profile.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#user-profile > div {
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

#user-profile:hover > div {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.9) !important;
}

#user-avatar {
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Модальні вікна */
#modal {
    backdrop-filter: blur(4px);
}

#modal > div {
    animation: modalAppear 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Стилі для полів форми, щоб не виходили за межі */
#modal input[type="date"],
#modal input[type="text"],
#modal input[type="tel"],
#modal select,
#modal textarea {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
}


/* Стилі для select */
#modal select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    cursor: pointer;
}

/* Стилі для select коли не вибрано значення */
#modal select:invalid,
#modal select option[value=""][disabled] {
    color: #9ca3af;
}

/* Стилі для option */
#modal select option {
    padding: 12px;
    background: white;
    color: #1f2937;
}

#modal select option[value=""] {
    color: #9ca3af;
}

/* Стилі для input[type="date"] - такі самі як у select */
#modal input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
    cursor: pointer;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#modal button {
    transition: all 0.2s ease;
}

#modal button:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Додаткові стилі */
.container {
    animation: fadeIn 0.3s ease;
}

/* Плавні переходи для всіх інтерактивних елементів */
button, .card-button {
    -webkit-tap-highlight-color: transparent;
}

/* Спрощена кнопка запису */
button[onclick="bookAppointment()"] {
    transition: all 0.2s ease;
}

button[onclick="bookAppointment()"]:hover {
    box-shadow: 0 6px 20px rgba(212, 165, 165, 0.25);
}
