/**
 * Coffeebrk Gradient Title Widget Styles
 * Premium gradient text with typing animation
 *
 * @package Coffeebrk\Animation
 */

/* Wrapper */
.coffeebrk-gradient-title-wrapper {
    display: block;
    width: 100%;
}

/* Title Base */
.coffeebrk-gradient-title {
    display: inline-block;
    margin: 0;
    padding: 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Gradient Text */
.coffeebrk-gradient-title.has-gradient {
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
}

/* Ensure gradient works on all browsers */
.coffeebrk-gradient-title.has-gradient .coffeebrk-title-text {
    display: inline;
}

/* Typing Cursor */
.coffeebrk-typing-cursor {
    display: inline-block;
    vertical-align: baseline;
    opacity: 1;
    font-weight: inherit;
    font-style: normal;
}

/* Cursor Styles */
.coffeebrk-typing-cursor.cursor-line::after {
    content: '|';
}

.coffeebrk-typing-cursor.cursor-underscore::after {
    content: '_';
}

.coffeebrk-typing-cursor.cursor-block::after {
    content: '█';
}

/* Cursor Blink Animation */
.coffeebrk-typing-cursor.blink {
    animation: coffeebrk-cursor-blink 0.7s infinite;
}

@keyframes coffeebrk-cursor-blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Ensure cursor inherits gradient color */
.coffeebrk-gradient-title.has-gradient .coffeebrk-typing-cursor {
    background: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Prevent layout shift during typing */
.coffeebrk-gradient-title.has-typing {
    min-height: 1em;
}

/* Editor Mode - Show full text */
.elementor-editor-active .coffeebrk-gradient-title .coffeebrk-title-text::after {
    content: attr(data-full-text);
    opacity: 0.3;
}

/* Smooth text rendering */
.coffeebrk-gradient-title {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .coffeebrk-gradient-title {
        word-break: break-word;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .coffeebrk-typing-cursor.blink {
        animation: none;
        opacity: 1;
    }
}

/* Print Styles */
@media print {
    .coffeebrk-gradient-title.has-gradient {
        -webkit-text-fill-color: currentColor;
        color: #000;
    }
    
    .coffeebrk-typing-cursor {
        display: none;
    }
}
