/* ═══════════════════════════════════════════════════════════════════
   COMPONENTS — Buttons, Cards, Glass, Forms, Modals, Badges
   ═══════════════════════════════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-heading);
    font-size: var(--fs-small);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-hero);
    color: var(--color-text-white);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary::before {
    background: var(--gradient-cta);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-white);
    border: 1px solid var(--glass-border);
}

.btn-outline:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-light);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    color: var(--color-text-white);
}

.btn-dark {
    background: var(--color-bg-primary);
    color: var(--color-text-white);
    border: 1px solid var(--glass-border);
}

.btn-dark:hover {
    background: var(--color-bg-secondary);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: var(--fs-body);
}

/* ── Glassmorphism Cards ── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    transition: all var(--duration-normal) var(--ease-smooth);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Color-accented glass cards */
.glass-card-cyan {
    border-color: rgba(0, 212, 255, 0.15);
}

.glass-card-cyan:hover {
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: var(--shadow-glow-cyan);
}

.glass-card-purple {
    border-color: rgba(139, 92, 246, 0.15);
}

.glass-card-purple:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: var(--shadow-glow-purple);
}

.glass-card-coral {
    border-color: rgba(255, 107, 53, 0.15);
}

.glass-card-coral:hover {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: var(--shadow-glow-coral);
}

.glass-card-emerald {
    border-color: rgba(16, 185, 129, 0.15);
}

.glass-card-emerald:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: var(--shadow-glow-emerald);
}

/* ── Section Blocks (Cuberto-style rounded sections) ── */
.section-block {
    border-radius: var(--radius-section);
    padding: var(--space-section) var(--container-padding);
    position: relative;
    overflow: hidden;
}

.section-block-dark {
    background: var(--color-bg-primary);
    color: var(--color-text-light);
}

.section-block-light {
    background: var(--color-bg-light);
    color: var(--color-text-dark);
}

.section-block-gradient {
    background: var(--gradient-stats);
    color: var(--color-text-white);
}

/* ── Form Inputs ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-family: var(--font-heading);
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-white);
    font-size: var(--fs-body);
    transition: all var(--duration-normal) var(--ease-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 3px var(--color-cyan-glow);
    background: var(--glass-bg-hover);
}

.form-input::placeholder {
    color: var(--color-text-dim);
}

/* Fix native dropdown option visibility */
select.form-input option {
    background: #1a1a2e;
    color: #ffffff;
}

/* Light mode form inputs */
.form-input-light {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--color-text-dark);
}

.form-input-light:focus {
    border-color: var(--color-purple);
    box-shadow: 0 0 0 3px var(--color-purple-glow);
}

/* ── Gradient Text ── */
.text-gradient {
    background: var(--gradient-hero-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-warm {
    background: linear-gradient(90deg, var(--color-coral), var(--color-gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cool {
    background: linear-gradient(90deg, var(--color-cyan), var(--color-emerald));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Badge / Tags ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 1rem;
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    border-radius: var(--radius-full);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.3);
    }
}

/* ── Modal / Overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--color-bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--duration-normal) var(--ease-expo);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* ── Dividers ── */
.divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-hero);
    border-radius: var(--radius-full);
}

/* ── Notification Toast ── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1rem 2rem;
    font-size: var(--fs-small);
    color: var(--color-text-light);
    z-index: 10000;
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-expo);
}

.toast.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.toast-error {
    border-color: rgba(244, 63, 94, 0.3);
}

/* ── Star Rating ── */
.star-rating {
    display: flex;
    gap: 0.25rem;
}

.star-rating .star {
    font-size: 1.25rem;
    color: var(--color-text-dim);
    transition: color var(--duration-fast);
}

.star-rating .star.active,
.star-rating .star:hover,
.star-rating .star:hover~.star {
    color: var(--color-gold);
}

/* ── Chatbot FAB ── */
.chatbot-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-hero);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 90;
    box-shadow: var(--shadow-glow-cyan);
    transition: all var(--duration-normal) var(--ease-smooth);
    border: none;
    cursor: pointer;
}

.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.5);
}

.chatbot-fab.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: rotate(90deg);
}

/* ── Chatbot Panel ── */
.chatbot-panel {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 380px;
    max-height: 520px;
    background: rgba(10, 5, 30, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.25rem;
    z-index: 91;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.chatbot-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-hero);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.chatbot-title {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: var(--fw-semibold);
    color: var(--color-text-white);
    letter-spacing: 0.02em;
}

.chatbot-status {
    font-size: 0.7rem;
    color: var(--color-emerald);
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.chatbot-close:hover {
    color: var(--color-text-white);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 300px;
    max-height: 350px;
    scroll-behavior: smooth;
}

.chatbot-welcome {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
}

.chatbot-welcome strong {
    color: var(--color-text-white);
}

.chatbot-msg {
    display: flex;
    max-width: 85%;
}

.chatbot-msg-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.chatbot-msg-assistant {
    align-self: flex-start;
}

.chatbot-bubble {
    padding: 0.625rem 1rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-msg-user .chatbot-bubble {
    background: var(--gradient-hero);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chatbot-msg-assistant .chatbot-bubble {
    background: rgba(255, 255, 255, 0.07);
    color: var(--color-text-light);
    border-bottom-left-radius: 0.25rem;
}

.chatbot-link {
    color: var(--color-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chatbot-link:hover {
    color: var(--color-text-white);
}

.chatbot-msg-enter {
    animation: chatMsgIn 0.3s ease forwards;
}

@keyframes chatMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing dots */
.chatbot-dots {
    display: flex;
    gap: 4px;
    padding: 0.25rem 0;
}

.chatbot-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-text-muted);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.chatbot-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--color-text-white);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--color-cyan);
}

.chatbot-input::placeholder {
    color: var(--color-text-dim);
}

.chatbot-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-hero);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.08);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-panel {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 5.5rem;
        width: auto;
        max-height: 70vh;
    }

    .chatbot-fab {
        bottom: 1rem;
        right: 1rem;
        width: 52px;
        height: 52px;
    }
}