/* CSS Design System for Нейрогард Neuropathy Chat Lander */

:root {
    --teal-primary: #0a5c5a;
    --teal-dark: #07403e;
    --teal-light: #eef7f6;
    --indigo-accent: #6366f1;
    --indigo-light: #e0e7ff;
    --mint-glow: #10b981;
    --accent-orange: #ff7a00;
    --accent-orange-hover: #e65c00;
    --accent-red: #ef4444;

    --gray-bg: #f8fafc;
    --gray-border: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --bubble-bot: #f1f5f9;
    --bubble-user: #0a5c5a;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(10, 92, 90, 0.12), 0 10px 10px -5px rgba(10, 92, 90, 0.06);
}

/* Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background: radial-gradient(circle at top right, #eef7f6 0%, #e0e7ff 100%);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* Main Container Layout */
.page-container {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Sticky Chat Header */
.chat-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--teal-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 16px;
    box-shadow: var(--shadow-md);
}

.doctor-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.doctor-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: var(--teal-light);
}

.online-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: var(--mint-glow);
    border: 2px solid var(--teal-primary);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.doctor-info {
    display: flex;
    flex-direction: column;
}

.doctor-name {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.doctor-status {
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.doctor-online-text {
    font-size: 10px;
    color: var(--mint-glow);
    font-weight: 600;
    margin-top: 1px;
}

/* Chat Message Feed */
.chat-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: #ffffff;
}

.chat-messages {
    flex-grow: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    min-height: 350px;
}

.message-row {
    display: flex;
    width: 100%;
}

.bot-row {
    justify-content: flex-start;
}

.user-row {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14.5px;
    line-height: 1.45;
    position: relative;
    box-shadow: var(--shadow-sm);
    word-wrap: break-word;
}

.bot-row .message-bubble {
    background: var(--bubble-bot);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.user-row .message-bubble {
    background: var(--bubble-user);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-time {
    display: block;
    font-size: 9px;
    text-align: right;
    margin-top: 4px;
    opacity: 0.6;
}

/* Typing Indicator */
.typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
    background: var(--bubble-bot);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite both;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* User Selection Controls */
.chat-options-panel {
    border-top: 1px solid var(--gray-border);
    padding: 12px 16px;
    background: #f8fafc;
    position: sticky;
    bottom: 0;
    z-index: 40;
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--teal-primary);
    color: var(--teal-primary);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.option-btn:hover {
    background: var(--teal-light);
    transform: translateY(-1px);
}

.option-btn:active {
    transform: translateY(0);
}

/* Offer Section & Wheel of Fortune */
.offer-section, .order-section, .reviews-section {
    padding: 20px 16px;
    border-top: 8px solid #f1f5f9;
}

.offer-card, .order-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--gray-border);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.offer-title {
    font-family: 'Outfit', sans-serif;
    color: var(--teal-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.offer-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.wheel-instructions {
    background: var(--teal-light);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 13.5px;
    color: var(--teal-dark);
}

/* Wheel of Fortune Styling */
.wheel-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.wheel-container {
    position: relative;
    width: min(320px, 88vw);
    height: min(320px, 88vw);
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    z-index: 10;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid var(--teal-primary);
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 0 20px rgba(10, 92, 90, 0.2);
    background: conic-gradient(
        from -90deg,
        #6366f1 0deg 60deg,
        #f8fafc 60deg 120deg,
        #ff7a00 120deg 180deg,
        #f8fafc 180deg 240deg,
        #0a5c5a 240deg 300deg,
        #e2e8f0 300deg 360deg
    );
}

.wheel-segment {
    display: none;
}

.wheel-text {
    position: absolute;
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -50%);
    width: 82px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    pointer-events: none;
    letter-spacing: 0;
    z-index: 2;
}

.wheel-text span {
    display: block;
    white-space: normal;
    text-align: center;
    width: 100%;
    line-height: 1.1;
    padding: 5px 6px;
    border-radius: 6px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
}

.wheel-spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: var(--indigo-accent);
    color: #ffffff;
    border: 4px solid #ffffff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-fast);
    outline: none;
    z-index: 10;
}

.wheel-spin-btn:hover {
    background: #4f46e5;
    transform: translate(-50%, -50%) scale(1.05);
}

.wheel-spin-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.5);
}

/* Order Form Section */
.badge-success-glow {
    background: linear-gradient(135deg, var(--mint-glow) 0%, #059669 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 30px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    letter-spacing: 0.5px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.product-presentation {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    text-align: left;
}

@media(min-width: 480px) {
    .product-presentation {
        flex-direction: row;
        align-items: center;
    }
}

.product-image-container {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.product-image {
    max-width: 140px;
    height: auto;
    border-radius: 12px;
}

.product-deal-info {
    flex-grow: 1;
}

.product-title {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--teal-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.product-tagline {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.price-old {
    font-size: 16px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.price-new {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-red);
}

.price-note {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Urgency Triggers */
.urgency-triggers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.timer-box, .stock-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--gray-border);
    border-radius: 12px;
    padding: 10px;
    text-align: left;
}

.timer-icon, .stock-icon {
    font-size: 22px;
}

.timer-text, .stock-text {
    display: flex;
    flex-direction: column;
}

.timer-label, .stock-label {
    font-size: 10px;
    color: var(--text-muted);
}

.timer-countdown, .stock-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--teal-primary);
}

.stock-count {
    transition: color 0.5s ease;
}

/* Checkout Form */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1.5px solid var(--gray-border);
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 3px rgba(10, 92, 90, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange-hover) 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 122, 0, 0.3);
    transition: var(--transition-fast);
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(255, 122, 0, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.form-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

.form-badge {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Reviews Feed */
.reviews-heading {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--teal-primary);
    margin-bottom: 16px;
    text-align: center;
}

.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.review-card {
    background: #ffffff;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    display: grid;
    grid-template-columns: 82px 1fr;
    column-gap: 12px;
    align-items: start;
    text-align: left;
}

.review-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #cfe1ff;
    border: 5px solid #8cc2ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
}

.review-content {
    border-left: 5px solid #3b82f6;
    border-radius: 14px 0 0 14px;
    padding: 16px 0 18px 18px;
    box-shadow: -10px 8px 18px rgba(59, 130, 246, 0.08);
}

.review-header {
    display: flex;
    justify-content: flex-start;
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 10px;
    border-bottom: 0;
    padding-bottom: 0;
}

.review-author {
    font-weight: 800;
    color: #1e40af;
}

.review-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.review-image-wrapper {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    grid-column: 2;
}

.review-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--gray-border);
}

.image-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

@media(max-width: 420px) {
    .review-card {
        grid-template-columns: 58px 1fr;
        column-gap: 10px;
    }

    .review-avatar {
        width: 54px;
        height: 54px;
        border-width: 4px;
        font-size: 27px;
    }

    .review-content {
        padding: 12px 0 14px 14px;
        border-left-width: 4px;
    }

    .review-header {
        font-size: 15px;
    }

    .review-text {
        font-size: 14px;
    }

    .review-image-wrapper {
        grid-column: 1 / -1;
    }
}

/* Confetti System */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}
