/* Additional custom styles for SEO-OK - Integral Media Theme */

/* Root variables for theme colors */
:root {
    --integral-yellow: #ffcc00;
    --integral-blue: #173d81;
    --integral-blue-light: #2563eb;
}

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progressBar {
    0% {
        width: 0%;
    }
    25% {
        width: 35%;
    }
    50% {
        width: 55%;
    }
    75% {
        width: 75%;
    }
    100% {
        width: 90%;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Progress bar animation */
.progress-bar {
    animation: progressBar 90s ease-out forwards;
}

/* Integral Media themed gradient */
.integral-gradient {
    background: linear-gradient(135deg, var(--integral-blue) 0%, var(--integral-blue-light) 100%);
}

/* Score card hover effects */
.score-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.score-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Button press effect */
button:active {
    transform: scale(0.98);
}

/* Loading spinner enhancement */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#loading {
    animation: fadeIn 0.3s ease-out;
}

/* Results container entrance */
#resultsContainer {
    animation: fadeIn 0.5s ease-out;
}

/* Enhanced mobile optimizations */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    header p {
        font-size: 1.125rem;
        line-height: 1.5;
    }

    .score-number {
        font-size: 2.5rem !important;
    }

    #potentialScore {
        font-size: 3.5rem !important;
    }

    /* Increase touch targets on mobile */
    button {
        min-height: 48px;
    }

    input {
        min-height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Better spacing for mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Stack cards on mobile */
    .grid {
        gap: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .score-number {
        font-size: 2rem !important;
    }

    #potentialScore {
        font-size: 3rem !important;
    }

    /* Even larger touch targets for small screens */
    button {
        min-height: 52px;
        font-size: 1rem;
    }
}

/* Tablet portrait */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 720px;
    }
}

/* Print styles (for reports) */
@media print {
    body {
        background: white;
    }

    header, footer, button {
        display: none;
    }

    .bg-gradient-to-r,
    .bg-gradient-to-br {
        background: white !important;
        color: black !important;
    }
}

/* Enhanced focus states for accessibility */
input:focus,
button:focus,
a:focus {
    outline: 3px solid var(--integral-yellow);
    outline-offset: 2px;
}

/* Improved contrast for accessibility */
a {
    text-decoration-skip-ink: auto;
}

/* Skip to main content link (accessibility) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--integral-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar with Integral Media theme */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--integral-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--integral-blue-light);
}

/* Loading state pulse animation */
@keyframes pulse-blue {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

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

/* Smooth hover transitions for cards */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(23, 61, 129, 0.15);
}

/* Potential score pulse animation */
.potential-score-hero {
    animation: potentialPulse 2s ease-in-out infinite;
}

@keyframes potentialPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
    }
}

/* Better text selection color */
::selection {
    background-color: var(--integral-yellow);
    color: var(--integral-blue);
}

::-moz-selection {
    background-color: var(--integral-yellow);
    color: var(--integral-blue);
}

/* Improve button active states */
button:active {
    transform: scale(0.97);
}

/* Loading spinner color override */
.animate-spin {
    border-color: var(--integral-blue);
    border-bottom-color: var(--integral-yellow);
}

/* Max-width content containers */
main .container {
    max-width: 1200px;
}

/* Section spacing improvements */
#resultsContainer > div {
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    #resultsContainer > div {
        margin-bottom: 3rem;
    }
}

/* Truncate long competitor URLs */
.competitor-url {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Button pulse animation for CTAs */
@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(23, 61, 129, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(23, 61, 129, 0.5);
    }
}

.pulse-cta {
    animation: ctaPulse 2s ease-in-out infinite;
}

/* Sticky section headers enhancement */
.sticky-header {
    position: sticky;
    top: 64px;
    background: white;
    z-index: 10;
    padding: 1rem 0;
    border-bottom: 2px solid #f3f4f6;
}

/* Improve card gradients */
.score-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e5e7eb;
}

/* Mobile sticky CTA animation */
#mobileCTASheet {
    animation: slideUpFade 0.3s ease-out;
}

@keyframes slideUpFade {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Back to top button animation */
#backToTop {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Divider pulse */
.divider {
    display: inline-block;
    animation: dividerPulse 3s ease-in-out infinite;
}

@keyframes dividerPulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Enhanced button touch targets */
button, a {
    -webkit-tap-highlight-color: rgba(255, 204, 0, 0.2);
}

/* Results entrance animation */
#resultsContainer > div {
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: backwards;
}

#resultsContainer > div:nth-child(1) { animation-delay: 0s; }
#resultsContainer > div:nth-child(2) { animation-delay: 0.1s; }
#resultsContainer > div:nth-child(3) { animation-delay: 0.2s; }
#resultsContainer > div:nth-child(4) { animation-delay: 0.3s; }
#resultsContainer > div:nth-child(5) { animation-delay: 0.4s; }

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