.streaming { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal { display: none; position: fixed; z-index: 50; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
.modal.show { display: flex; align-items: center; justify-content: center; }
/* titles: proper wrapping and containment */
.title-content {
    white-space: pre-wrap;      /* preserve spaces and wrap */
    word-break: break-word;     /* break long words if needed */
    overflow-wrap: anywhere;    /* ensure content stays in box */
}
/* for long slugs/meta/body */
.break-anywhere { word-break: break-word; overflow-wrap: anywhere; }
.whitespace-prewrap { white-space: pre-wrap; }

/* modal base styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

/* fade-in animation for output sections */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* title content styling (for bullet points) */
.title-content {
    white-space: pre-wrap;
    font-family: inherit;
}

/* streaming button effect */
.streaming {
    position: relative;
    overflow: hidden;
}

.streaming::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: streaming 1.5s infinite;
}

@keyframes streaming {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* exceptional modal special animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* break word utilities for long text */
.break-anywhere {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* responsive modal adjustments */
@media (max-width: 768px) {
    .modal > div {
        width: 90%;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* hover effects for pricing cards */
.border-2:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* button hover effects */
button {
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* gradient background for exceptional modal */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-yellow-50 {
    --tw-gradient-from: #fefce8;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(254, 252, 232, 0));
}

.to-orange-50 {
    --tw-gradient-to: #fff7ed;
}

/* custom scrollbar for modals */
.modal > div {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.modal > div::-webkit-scrollbar {
    width: 6px;
}

.modal > div::-webkit-scrollbar-track {
    background: transparent;
}

.modal > div::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.modal > div::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* loading spinner for buttons */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* success/error message animations */
#statusMessage {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* highlight effect for user bar */
#userBar {
    transition: all 0.3s ease;
}

#userBar:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* credits badge styling */
#userCredits {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background-color: rgba(37, 99, 235, 0.1);
}

/* exceptional offer badge animation */
.border-yellow-400,
.border-orange-500 {
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    }
}

/* copy button feedback */
#copyBtn.copied {
    background-color: #10b981 !important;
}

/* pricing comparison table enhancements */
.line-through {
    position: relative;
}

.line-through::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    opacity: 0.6;
}

/* focus states for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* print styles */
@media print {
    .modal,
    #userBar,
    button,
    #generateForm {
        display: none !important;
    }
    
    #outputContainer {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}