/* Typing Animation Component */

:root {
    --typing-text-color: #1a365d;
    --typing-cursor-color: #4a90e2;
    --typing-accent-color: #7b61ff;
    --typing-shadow-color: rgba(74, 176, 225, 0.2);
}

/* Base typing elements */
.animated-text, .typed-cursor {
    position: relative;
    display: inline;
    vertical-align: baseline;
    zoom: 1;
    transform: scale(1);
    transform-origin: center;
}

.animated-text {
    min-height: 28px;
    line-height: 1.5;
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out, color 0.3s ease;
    color: var(--typing-text-color);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.02em;
}

.animated-text.loading { opacity: 0; transform: translateY(10px); }
.animated-text.loaded { opacity: 1; transform: translateY(0); }

/* Prism text styling */
.prism-typed-text {
    background: linear-gradient(135deg, var(--typing-text-color) 0%, var(--typing-accent-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* Cursor animation */
.typed-cursor {
    color: var(--typing-cursor-color);
    font-weight: bold;
    font-size: 16px;
    animation: cursor-blink 0.8s infinite;
    margin-left: 3px;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

/* Container */
.typing-container {
    text-align: center;
    margin-top: 24px;
    line-height: 1.6;
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(74, 176, 225, 0.1);
    box-shadow: 0 4px 15px var(--typing-shadow-color);
    display: inline-block;
    min-width: 200px;
    max-width: 600px;
    min-height: 48px;
    box-sizing: border-box;
    zoom: 1;
    transform: scale(1);
    transform-origin: center;
}

.typing-container p {
    display: inline;
    margin: 0;
    padding: 0;
    position: relative;
    white-space: nowrap;
}

/* Hover effects */
.typing-container:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 176, 225, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--typing-shadow-color);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce), (prefers-contrast: high) {
    .animated-text { transition: opacity 0.3s ease; transform: none !important; }
    .typed-cursor { animation: none; opacity: 1; }
    .typing-container:hover { transform: none; transition: none; }
    .prism-typed-text {
        background: var(--typing-text-color);
        background-clip: unset;
        -webkit-background-clip: unset;
        color: var(--typing-text-color);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .typing-container {
        padding: 6px 12px;
        margin-top: 16px;
        min-width: 180px;
        max-width: 500px;
        min-height: 40px;
    }
    .animated-text { font-size: 13px; min-height: 24px; }
    .typed-cursor { font-size: 13px; }
}

@media (max-width: 480px) {
    .typing-container {
        padding: 5px 8px;
        margin-top: 12px;
        min-width: 160px;
        max-width: 400px;
        min-height: 36px;
    }
    .animated-text { font-size: 12px; min-height: 22px; }
    .typed-cursor { font-size: 12px; }
}