/* ===================================
   Антиплагиат Онлайн - Main CSS
   Анимации и дополнительные стили
   =================================== */

/* Selection Colors */
::selection {
    background-color: #FFD700;
    color: #0F172A;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Reset WordPress defaults that interfere */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

main,
section,
header,
footer,
.min-w-0 {
    min-width: 0;
}

#app-landing > header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999;
    margin-top: 0 !important;
}

#app-landing > header > div {
    min-width: 0;
}

.ap-cabinet-short {
    display: none !important;
}

.ap-cabinet-full {
    display: inline !important;
}

.ap-cabinet-icon {
    display: block !important;
}

@media (max-width: 640px) {
    #app-landing > header .h-20 {
        height: 4rem !important;
    }

    .ap-cabinet-link {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0 !important;
        justify-content: center;
    }

    .ap-cabinet-icon,
    .ap-cabinet-full {
        display: none !important;
    }

    .ap-cabinet-short {
        display: inline !important;
        line-height: 1;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

/* Fade Up Animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s ease-out forwards;
}

/* Fade In from Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-right {
    animation: fadeInRight 1s ease-out 0.2s forwards;
    opacity: 0;
}

/* Floating Animation (for the stats card) */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

/* Scroll-triggered animation (initial state) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   FAQ Accordion
   =================================== */

.faq-item .faq-chevron {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.faq-item.open .faq-answer {
    opacity: 1;
}

/* ===================================
   Upload Dropzone 
   =================================== */

#upload-dropzone.drag-over {
    border-color: #3B82F6 !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
    transform: scale(1.02);
}

#upload-file-label,
#checking-file-info,
#result-filename {
    display: inline-block;
    max-width: min(72vw, 560px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

#checking-file-info {
    max-width: 100%;
}

#result-filename {
    max-width: 100%;
}

.result-summary-info {
    min-width: 0;
    max-width: 100%;
}

.result-summary-info p {
    display: flex;
    align-items: baseline;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
}

.result-summary-info #result-filename {
    flex: 1 1 auto;
    min-width: 0;
}

.result-summary-actions {
    flex: 0 0 auto;
    max-width: 100%;
}

/* ===================================
   View Transitions
   =================================== */

#app-check {
    min-height: 100vh;
}

#view-checking,
#view-result {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===================================
   Step indicators in checking view 
   =================================== */

.step-indicator.done {
    background-color: #22c55e !important;
    color: white !important;
}

.step-indicator.done .animate-pulse {
    display: none;
}

.step-label.done {
    color: #0f172a !important;
}

/* ===================================
   Responsive adjustments
   =================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    #upload-file-label,
    #checking-file-info,
    #result-filename {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    #upload-file-label,
    #checking-file-info,
    #result-filename {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ===================================
   WordPress Admin Bar Fix
   =================================== */

body.admin-bar header.sticky {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar header.sticky {
        top: 46px;
    }
}
