/**
 * Contextual Greeting Styles
 * Provides styling for time-based greetings and user name integration
 */

.contextual-greeting {
    font-weight: 600;
    color: var(--bs-primary, #007bff);
    transition: color 0.3s ease;
}

/* LLM Streaming Animation Styles */
.contextual-greeting-wrapper[data-greeting-processed="false"] {
    position: relative;
    min-height: 1.5em;
}

/* Tablet-specific margin for contextual greeting wrapper */
@media (min-width: 768px) and (max-width: 1023px) {
    .contextual-greeting-wrapper[data-greeting-processed="false"] {
        margin-left: 15px;
        margin-right: 15px;
    }
}

.contextual-greeting-wrapper[data-greeting-processed="false"] p {
    opacity: 0;
    visibility: hidden;
    margin: 0;
    padding: 0;
}

.contextual-greeting-wrapper[data-greeting-processed="false"].streaming p {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.01s ease; /* Instant transition */
}

.contextual-greeting-wrapper[data-greeting-processed="false"] .streaming-word {
    opacity: 0;
    display: inline-block;
    transform: translateY(1px);
    transition: opacity 0.01s ease, transform 0.01s ease; /* Instant transitions */
}

.contextual-greeting-wrapper[data-greeting-processed="false"].streaming .streaming-word.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

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

/* Different greeting types */
.contextual-greeting[data-greeting-type="time-only"] {
    font-style: italic;
}

.contextual-greeting[data-greeting-type="with-name"] {
    font-weight: 700;
    font-size: 1.05em;
}

.contextual-greeting[data-greeting-type="name-only"] {
    font-weight: 600;
    color: var(--bs-secondary, #6c757d);
}

.contextual-greeting[data-greeting-type="full"] {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--bs-primary, #007bff);
}

.contextual-greeting[data-greeting-type="greeting-only"] {
    font-weight: 600;
    font-style: italic;
}

/* Styling for contextual greeting links (user names) */
.contextual-greeting-wrapper a {
    color: var(--bs-body-color) !important;
    font-family: Geist !important;
    font-weight: 700 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    display: inline !important;
    padding-bottom: 1px !important;
    border-bottom: 2px solid #F53C60 !important;
    background: none !important;
    text-transform: none !important;
    transition: color 0.2s !important;
}

.contextual-greeting-wrapper a:hover {
    color: #F53C60 !important;
}

/* Dark mode support */
[data-theme="dark"] .contextual-greeting,
body.dark-mode .contextual-greeting {
    color: var(--bs-primary, #0d6efd);
}

[data-theme="dark"] .contextual-greeting[data-greeting-type="name-only"],
body.dark-mode .contextual-greeting[data-greeting-type="name-only"] {
    color: var(--bs-secondary, #adb5bd);
}

/* Hover effects */
.contextual-greeting:hover {
    color: var(--bs-primary-dark, #0056b3);
    text-decoration: none;
}

/* Animation for dynamic updates */
.contextual-greeting.updating {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .contextual-greeting,
    .contextual-greeting[data-greeting-type="with-name"],
    .contextual-greeting[data-greeting-type="full"] {
        font-family: Geist;
        font-weight: 400;
        font-style: Regular;
        font-size: 18px;
        line-height: 34px;
        letter-spacing: 0%;
    }
    
    .contextual-greeting-wrapper p {
        font-family: Geist;
        font-weight: 400;
        font-style: Regular;
        font-size: 18px;
        line-height: 34px;
        letter-spacing: 0%;
        border-top: none !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        padding-top: 0 !important;
        padding-bottom: 25px !important;
    }
}

/* Special styling for homepage usage */
.home .contextual-greeting {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--bs-heading-color, #212529);
}

.home .contextual-greeting[data-greeting-type="with-name"] {
    font-size: 1.2em;
}

/* Loading state */
.contextual-greeting.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Error state */
.contextual-greeting.error {
    color: var(--bs-danger, #dc3545);
    font-style: italic;
} 