/* Text to URL Slug Converter Styles */

/* Preset Buttons */
.preset-btn {
    position: relative;
    overflow: hidden;
}

.preset-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.preset-btn:hover::before {
    left: 100%;
}

.preset-btn.active {
    background-color: #2563eb !important;
    color: white !important;
    border-color: #1d4ed8 !important;
    transform: scale(1.05);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.25);
}

.preset-btn.active span {
    color: white !important;
}

/* Advanced Options Animation */
#advancedOptions {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

#advancedOptions.show {
    max-height: 200px;
    opacity: 1;
    display: block !important;
}

#advancedIcon.rotated {
    transform: rotate(180deg);
}

/* Input/Output Styling */
#inputText {
    position: relative;
    transition: all 0.2s ease;
}

#inputText:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

#primarySlug {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: relative;
    transition: all 0.3s ease;
}

#primarySlug:not(:placeholder-shown) {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Slug Preview Animation */
#slugPreview {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

#slugPreview.show {
    opacity: 1;
    max-height: 100px;
    display: block !important;
}

#previewUrl {
    word-break: break-all;
    position: relative;
}

#previewUrl::before {
    content: "🔗";
    margin-right: 8px;
}

/* Alternative Suggestions */
.alternative-item {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.alternative-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.4s;
}

.alternative-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px -8px rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
}

.alternative-item:hover::before {
    left: 100%;
}

.alternative-item:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px -4px rgba(59, 130, 246, 0.3);
}

.alternative-slug {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    color: #1f2937;
    background: rgba(249, 250, 251, 0.8);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
    word-break: break-all;
    transition: all 0.2s ease;
}

.alternative-item:hover .alternative-slug {
    background: rgba(239, 246, 255, 0.8);
    border-color: #3b82f6;
    color: #1e40af;
}

.alternative-score {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}

.score-bar {
    width: 40px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #10b981, #059669);
    border-radius: 2px;
    transition: width 0.5s ease;
    position: relative;
}

.score-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* SEO Analysis Panel */
.seo-factor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(219, 234, 254, 0.5);
}

.seo-factor:last-child {
    border-bottom: none;
}

.seo-factor-icon {
    width: 12px;
    height: 12px;
    margin-right: 6px;
    transition: transform 0.2s ease;
}

.seo-factor.good .seo-factor-icon {
    color: #10b981;
    animation: bounce 0.5s ease;
}

.seo-factor.warning .seo-factor-icon {
    color: #f59e0b;
}

.seo-factor.error .seo-factor-icon {
    color: #ef4444;
    animation: shake 0.5s ease;
}

@keyframes bounce {
    0%,
    20%,
    53%,
    80%,
    100% {
        transform: translate3d(0, 0, 0);
    }
    40%,
    43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

/* SEO Score Bar Animation */
#seoScoreBar {
    transition: width 1s ease-out, background-color 0.5s ease;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #10b981 70%, #059669 100%);
    position: relative;
    overflow: hidden;
}

#seoScoreBar::after {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: scoreShimmer 2s infinite;
}

@keyframes scoreShimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* Character Analysis Counters */
.counter-animate {
    animation: countUp 0.5s ease-out;
}

@keyframes countUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Button States and Animations */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -6px rgba(59, 130, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #059669 !important;
    color: white !important;
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Copy Success Animation */
.copy-success {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0) !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
    animation: copySuccess 0.6s ease;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* History Items */
.history-item {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.history-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    transition: left 0.5s;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 20px -4px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.history-item:hover::before {
    left: 100%;
}

.history-slug {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    color: #1f2937;
    word-break: break-all;
    margin: 4px 0;
    padding: 4px 8px;
    background: rgba(249, 250, 251, 0.8);
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.history-timestamp {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Modal Animations */
#sampleModal {
    transition: opacity 0.3s ease;
}

#sampleModal.show {
    display: flex !important;
    opacity: 1;
}

.sample-text-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.sample-text-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.4s;
}

.sample-text-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.sample-text-btn:hover::before {
    left: 100%;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .preset-btn {
        min-height: 60px;
        padding: 8px;
    }

    .preset-btn span:first-child {
        font-size: 12px;
    }

    .preset-btn span:last-child {
        font-size: 10px;
    }

    .alternative-item {
        margin-bottom: 8px;
    }

    .history-item {
        padding: 12px;
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Tooltip Styles */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 8px;
}

.tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    margin-bottom: 4px;
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Focus States for Accessibility */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .preset-btn,
    .alternative-item,
    .history-item {
        border-width: 2px;
    }

    #primarySlug:not(:placeholder-shown) {
        border-width: 3px;
    }
}
