/**
 * ByteBays Website - Custom Styles
 * Supplementary styles beyond Tailwind CSS
 */

/* ========================================
   1. SMOOTH SCROLL BEHAVIOR
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   2. CUSTOM ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ========================================
   3. COOKIE BANNER ANIMATION
   ======================================== */
#cookie-consent {
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

#cookie-consent:not(.hidden) {
    transform: translateY(0);
}

/* ========================================
   4. GRADIENT TEXT
   ======================================== */
.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   5. GRID PATTERN BACKGROUND
   ======================================== */
.bg-grid-pattern {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ========================================
   6. BUTTON HOVER EFFECTS
   ======================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* Gradient Button Hover - Darker Right Side */
.btn-gradient-hover:hover {
    background-image: linear-gradient(to right, rgb(67, 56, 202), rgb(49, 46, 129)) !important;
}

/* For buttons with from-primary-700 to-primary-800 hover */
button.bg-gradient-to-r:hover,
a.bg-gradient-to-r:hover,
.bg-gradient-to-r.hover\:from-primary-700:hover {
    background-image: linear-gradient(to right, rgb(67, 56, 202), rgb(49, 46, 129)) !important;
}

/* ========================================
   7. CARD HOVER EFFECTS
   ======================================== */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   8. FOCUS STATES FOR ACCESSIBILITY
   ======================================== */
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

/* ========================================
   9. SCREENSHOT IMAGE EFFECTS
   ======================================== */
.screenshot-hover {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.screenshot-hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(79, 70, 229, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.screenshot-hover:hover::after {
    transform: translateX(100%);
}

/* ========================================
   10. MOBILE MENU ANIMATION
   ======================================== */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu:not(.hidden) {
    max-height: 500px;
}

/* ========================================
   11. LOADING SPINNER
   ======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   12. PROSE IMPROVEMENTS (for terms page)
   ======================================== */
.prose {
    max-width: none;
}

.prose h3 {
    scroll-margin-top: 100px; /* Account for sticky header */
}

.prose a {
    color: #4f46e5;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: #3730a3;
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

/* ========================================
   13. BACK TO TOP BUTTON
   ======================================== */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 40;
}

#back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#back-to-top.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   14. FORM VALIDATION STATES
   ======================================== */
input.error,
textarea.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

input.success,
textarea.success {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* ========================================
   15. RESPONSIVE TYPOGRAPHY
   ======================================== */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
        line-height: 2.5rem;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 2rem;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

/* ========================================
   16. PRINT STYLES
   ======================================== */
@media print {
    header,
    footer,
    #cookie-consent,
    #back-to-top,
    .no-print {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href^="http"]::after {
        content: " (" attr(href) ")";
    }
}

/* ========================================
   17. DARK MODE SUPPORT (future)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Will be implemented in future versions */
}

/* ========================================
   18. REDUCE MOTION FOR ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
