/**
 * Typewriter Effect Styles
 * Smooth typing animation with blinking cursor
 */

.typewriter-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 20px 0;
    height: 60px;
    width: 100%;
    font-family: 'Aeonik', 'Arial', sans-serif;

    /* Search bar styling */
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    z-index: 2;

    /* Prevent any flex changes */
    flex-shrink: 0;
    flex-grow: 0;
}

.typewriter-text {
    font-size: 2.2rem;
    font-weight: 400;
    color: #495057;
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    text-align: left;
    line-height: 1.3;

    /* Keep text on one line */
    white-space: nowrap;

    /* Smooth text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Ensure consistent positioning */
    margin: 0;
    padding: 0;
}

/* Remove typewriter cursor completely */
.typewriter-text::after {
    display: none;
}

/* Blinking cursor animation */
@keyframes typewriter-blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 1280px) {
    .typewriter-container {
        height: 50px;
        margin: 8px 0 16px 0;
    }

    .typewriter-text {
        font-size: 1.8rem;
    }
}

@media (max-width: 900px) {
    .typewriter-container {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .typewriter-container {
        margin: 12px 0 20px 0;
        height: 60px;
        width: 100%;
        max-width: none;
        padding: 10px 16px;
    }

    .typewriter-text {
        font-size: 1.5rem;
        left: 16px;
        line-height: 1.4;
    }
}

@media (max-width: 600px) {
    .typewriter-container {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .typewriter-container {
        margin: 10px 0 15px 0;
        height: 55px;
        width: 100%;
        max-width: none;
        padding: 8px 12px;
    }

    .typewriter-text {
        font-size: 1.3rem;
        left: 12px;
        line-height: 1.4;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .typewriter-text {
        color: #000000;
    }
    
    .typewriter-text::after {
        color: #000000;
    }
}

/* Reduced motion: disable animations and cursor blink */
@media (prefers-reduced-motion: reduce) {
    .typewriter-text::after {
        animation: none;
        opacity: 1;
    }
    
    /* For reduced motion, we can optionally hide the cursor entirely */
    .typewriter-text.reduced-motion::after {
        display: none;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .typewriter-text {
        color: #cccccc;
    }
    
    .typewriter-text::after {
        color: #66a3d9;
    }
}

/* Focus styles for accessibility */
.typewriter-text:focus {
    outline: 2px solid #005F86;
    outline-offset: 2px;
}

/* Ensure smooth transitions */
.typewriter-text {
    transition: color 0.3s ease;
}

/* Loading state */
.typewriter-loading {
    color: #999999;
    font-style: normal;
}

.typewriter-loading::after {
    content: '...';
    animation: typewriter-dots 1.5s infinite;
}

@keyframes typewriter-dots {
    0%, 20% {
        content: '...';
    }
    40% {
        content: '..';
    }
    60% {
        content: '.';
    }
    80%, 100% {
        content: '';
    }
}

/* Print styles */
@media print {
    .typewriter-text::after {
        display: none;
    }
    
    .typewriter-text {
        color: #000000 !important;
    }
}