/* Custom styles for LibertyX Bitcoin ATM website */

/* Smooth transitions for all interactive elements */
a, button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
a:focus, button:focus {
    outline: 2px solid #c72848;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom selection color */
::selection {
    background-color: #ffd0d9;
    color: #6e1c32;
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Prevent layout shift */
img {
    aspect-ratio: auto;
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
}

img[lazy] {
    opacity: 0;
}

img[lazy].loaded {
    opacity: 1;
}

/* Print styles */
@media print {
    nav, .mobile-menu, button {
        display: none !important;
    }
    
    body {
        color: #000 !important;
        background: #fff !important;
    }
    
    .hero-grid {
        grid-template-columns: 1fr !important;
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .btn-primary {
        border: 2px solid ButtonText;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Better touch targets for mobile */
@media (hover: none) and (pointer: coarse) {
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Animation classes (only applied when JS is enabled) */
.js-enabled .reveal {
    animation: fadeInUp 0.6s ease forwards;
}

.js-enabled .reveal-left {
    animation: slideInLeft 0.6s ease forwards;
}

.js-enabled .reveal-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Stagger animations for children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* Loading state */
.loading {
    position: relative;
    overflow: hidden;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-image {
        min-height: 400px;
    }
    
    .float-animation {
        animation: none;
    }
}

/* Better form styling */
input, textarea, select {
    border: 2px solid #ffe8ec;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    background-color: white;
    color: #3D3533;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #c72848;
    box-shadow: 0 0 0 3px rgba(199, 40, 72, 0.1);
}

input::placeholder, textarea::placeholder {
    color: #a0a0a0;
}

/* Custom checkbox styling */
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #ffd0d9;
    border-radius: 0.25rem;
    cursor: pointer;
    accent-color: #c72848;
}

/* Custom radio styling */
input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #ffd0d9;
    border-radius: 50%;
    cursor: pointer;
    accent-color: #c72848;
}

/* Scrollbar styling for webkit */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #F5EDE8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #c72848, #a31d38);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #dc4466, #c72848);
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #a31d38, #c72848);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(163, 29, 56, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(163, 29, 56, 0.4);
}

/* Notification toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: white;
    padding: 1rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}
