/* ===== CSS Variables & Color Palette ===== */
:root {
    --primary: #9B4DCA;
    --primary-dark: #7B2FA8;
    --primary-light: #C77DFF;
    --secondary: #E4A8F7;
    --accent: #D63384;
    --accent-light: #E67CAE;
    --bg-light: #FBF5FF;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-dark: #2D1B4E;
    --text-muted: #6B5088;
    --text-light: #9A82B5;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 8px rgba(155, 77, 202, 0.08);
    --shadow-md: 0 8px 32px rgba(155, 77, 202, 0.12);
    --shadow-lg: 0 16px 48px rgba(155, 77, 202, 0.18);
    --shadow-glow: 0 0 30px rgba(155, 77, 202, 0.3);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 50%;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Times New Roman', Times, serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Preloader ===== */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FBF5FF 0%, #F3E8FF 50%, #FDF2F8 100%);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    transform: scale(0.02);
    opacity: 0;
    animation: preloaderZoomIn 3.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.preloader-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: var(--radius-full);
    animation: preloaderPulse 2s ease-in-out infinite;
}

.preloader-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--primary-light);
}

.preloader-glow {
    position: absolute;
    inset: -8px;
    border-radius: var(--radius-full);
    background: conic-gradient(from 0deg, transparent, var(--primary), var(--accent), transparent);
    animation: preloaderSpin 2s linear infinite;
    opacity: 0.6;
    z-index: -1;
    filter: blur(4px);
}

.preloader-logo {
    opacity: 0;
    animation: preloaderFadeIn 1s ease 0.5s forwards;
}

.preloader-logo-img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(155, 77, 202, 0.3));
}

@keyframes preloaderZoomIn {
    0% {
        transform: scale(0.02);
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        transform: scale(1.7);
        opacity: 1;
    }
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes preloaderSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

/* ===== Animated Background ===== */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: var(--radius-full);
    filter: blur(80px);
    opacity: 0.4;
    animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-light), transparent);
    top: -100px;
    right: -50px;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent-light), transparent);
    bottom: -80px;
    left: -60px;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--secondary), transparent);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

.orb-4 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--primary), transparent);
    top: 60%;
    right: 70%;
    animation-delay: -15s;
    opacity: 0.25;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 35px) scale(1.05); }
}

/* ===== Container & Card ===== */
.container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    overflow-x: hidden;
}

.card {
    width: 100%;
    max-width: 420px;
    flex-shrink: 0;
    margin: auto;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(155, 77, 202, 0.1);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Profile Section ===== */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 16px;
}

.profile-image-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 12px;
}

.profile-image {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--white);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
}

.profile-image-wrapper:hover .profile-image {
    transform: scale(1.03);
}

.profile-ring {
    position: absolute;
    inset: -5px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary-light));
    z-index: -1;
    animation: ringRotate 4s linear infinite;
    opacity: 0.8;
}

@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.clinic-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.sub-tagline {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
    font-weight: 400;
    white-space: nowrap;
}

/* ===== Links Section ===== */
.links-section {
    margin-bottom: 16px;
}

.links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 16px;
    background: var(--white);
    border: 1px solid rgba(155, 77, 202, 0.12);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.link-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: var(--radius-md);
}

.link-button:hover,
.link-button:focus-visible {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-light);
}

.link-button:hover::before,
.link-button:focus-visible::before {
    opacity: 1;
}

.link-button:hover .link-icon,
.link-button:hover .link-text,
.link-button:hover .link-arrow,
.link-button:focus-visible .link-icon,
.link-button:focus-visible .link-text,
.link-button:focus-visible .link-arrow {
    color: var(--white);
    position: relative;
    z-index: 1;
}

.link-button:active {
    transform: translateY(0) scale(0.98);
}

.link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(155, 77, 202, 0.08), rgba(214, 51, 132, 0.05));
    color: var(--primary);
    transition: all var(--transition);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.link-button:hover .link-icon {
    background: rgba(255, 255, 255, 0.2);
}

.link-text {
    flex: 1;
    text-align: left;
    position: relative;
    z-index: 1;
    transition: color var(--transition);
}

.link-arrow {
    color: var(--text-light);
    transition: all var(--transition);
    position: relative;
    z-index: 1;
}

.link-button:hover .link-arrow {
    transform: translateX(3px);
}

/* Platform-specific hover colors */
[data-platform="whatsapp"]:hover {
    --shadow-glow: 0 0 30px rgba(37, 211, 102, 0.3);
}

[data-platform="instagram"]:hover {
    --shadow-glow: 0 0 30px rgba(225, 48, 108, 0.3);
}

[data-platform="tiktok"]:hover {
    --shadow-glow: 0 0 30px rgba(0, 0, 0, 0.2);
}

[data-platform="facebook"]:hover {
    --shadow-glow: 0 0 30px rgba(24, 119, 242, 0.3);
}

[data-platform="youtube"]:hover {
    --shadow-glow: 0 0 30px rgba(255, 0, 0, 0.25);
}

[data-platform="website"]:hover {
    --shadow-glow: 0 0 30px rgba(155, 77, 202, 0.35);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid rgba(155, 77, 202, 0.08);
}

.footer-logo {
    margin-bottom: 4px;
}

.footer-logo img {
    width: 100px;
    height: auto;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.footer-logo img:hover {
    opacity: 1;
}

.footer-text {
    font-size: 0.65rem;
    color: var(--text-light);
    font-weight: 400;
}

.footer-powered {
    font-size: 0.6rem;
    color: var(--text-light);
    margin-top: 2px;
}

.footer-powered a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.footer-powered a:hover {
    color: var(--accent);
}

/* ===== Animations ===== */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Accessibility ===== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .gradient-orb {
        animation: none;
    }

    .profile-ring {
        animation: none;
    }

    .preloader-glow {
        animation: none;
    }
}

/* ===== Responsive: Small Phones ===== */
@media (max-width: 360px) {
    .card {
        padding: 20px 16px;
        border-radius: var(--radius-md);
    }

    .profile-image-wrapper {
        width: 76px;
        height: 76px;
    }

    .clinic-name {
        font-size: 1.25rem;
    }

    .tagline {
        font-size: 0.8rem;
    }

    .sub-tagline {
        font-size: 0.66rem;
    }

    .link-button {
        padding: 10px 12px;
        gap: 10px;
        font-size: 0.84rem;
    }

    .link-icon {
        width: 28px;
        height: 28px;
    }
}

/* ===== Responsive: Short Screens (landscape phones) ===== */
@media (max-height: 520px) {
    .container {
        align-items: flex-start;
    }
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 600px) {
    .container {
        padding: 24px;
    }

    .card {
        padding: 32px 36px;
        max-width: 460px;
    }

    .profile-image-wrapper {
        width: 110px;
        height: 110px;
    }

    .clinic-name {
        font-size: 1.7rem;
    }

    .link-button {
        padding: 14px 20px;
    }
}

/* ===== Responsive: Desktop ===== */
@media (min-width: 1024px) {
    .card {
        max-width: 480px;
        padding: 40px 44px;
    }

    .gradient-orb {
        filter: blur(100px);
    }

    .orb-1 {
        width: 400px;
        height: 400px;
    }

    .orb-2 {
        width: 350px;
        height: 350px;
    }

    .link-button:hover {
        transform: translateY(-3px) scale(1.02);
    }
}

/* ===== Safe Area for Notched Devices ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .container {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
        padding-top: max(24px, env(safe-area-inset-top));
    }
}
