/* TendPOS Static Site Styles
   Shared animations and styles for all static pages */

/* ============================================
   Base & Typography
   ============================================ */
* {
    font-family: 'Inter', sans-serif;
}

/* ============================================
   Gradient Utilities
   ============================================ */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-border {
    position: relative;
    background: white;
    border-radius: 1rem;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: inherit;
    z-index: -1;
}

/* ============================================
   Hero Backgrounds
   ============================================ */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: heroShine 15s linear infinite;
}

@keyframes heroShine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animated mesh background */
.mesh-bg {
    background:
        radial-gradient(at 40% 20%, hsla(268, 82%, 50%, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(240, 82%, 60%, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(270, 82%, 50%, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(240, 82%, 50%, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(268, 82%, 50%, 0.2) 0px, transparent 50%);
}

/* ============================================
   Animations - Fade In
   ============================================ */
.fade-in {
    animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }
.fade-in-delay-5 { animation-delay: 0.5s; }

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

/* Fade in from different directions */
.fade-in-left {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out forwards;
}

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

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

/* ============================================
   Animations - Scale
   ============================================ */
.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Animations - Float
   ============================================ */
.float {
    animation: float 6s ease-in-out infinite;
}

.float-slow {
    animation: float 8s ease-in-out infinite;
}

.float-delay-1 { animation-delay: -2s; }
.float-delay-2 { animation-delay: -4s; }

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

/* ============================================
   Animations - Pulse & Glow
   ============================================ */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.glow {
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

.glow-text {
    animation: glowText 3s ease-in-out infinite;
}

@keyframes glowText {
    0%, 100% {
        text-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
    }
}

/* ============================================
   Card Effects
   ============================================ */
.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.card-3d {
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-5px);
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.1);
}

/* Shine effect on hover */
.card-shine {
    position: relative;
    overflow: hidden;
}

.card-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: rotate(30deg) translateX(-100%);
    transition: transform 0.6s ease;
}

.card-shine:hover::after {
    transform: rotate(30deg) translateX(100%);
}

/* ============================================
   Button Effects
   ============================================ */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.btn-glow:hover::before {
    left: 100%;
}

.btn-glow:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* Ripple effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-ripple:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* ============================================
   Icon Animations
   ============================================ */
.icon-bounce {
    transition: transform 0.3s ease;
}

.icon-bounce:hover {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.icon-spin:hover i {
    animation: spin 0.5s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   Scroll Reveal (triggered by JS)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Counter Animation
   ============================================ */
.counter {
    display: inline-block;
}

/* ============================================
   Gradient Animations
   ============================================ */
.gradient-animate {
    background: linear-gradient(-45deg, #667eea, #764ba2, #6366f1, #8b5cf6);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================
   Underline Animation
   ============================================ */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* ============================================
   Stagger Animation Utility
   ============================================ */
.stagger > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

/* ============================================
   Blob Animation
   ============================================ */
.blob {
    border-radius: 50%;
    filter: blur(60px);
    animation: blobMove 20s ease-in-out infinite;
}

@keyframes blobMove {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(30px, 10px) scale(1.05); }
}

/* ============================================
   Typing Animation
   ============================================ */
.typing {
    overflow: hidden;
    border-right: 2px solid;
    white-space: nowrap;
    animation: typing 3s steps(40) forwards, blink 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ============================================
   Parallax-ready
   ============================================ */
.parallax {
    will-change: transform;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Dark mode skeleton */
[data-theme="dark"] .skeleton,
.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading container states */
[data-loading] {
    position: relative;
    min-height: 100px;
}

[data-loading="spinner"] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Button loading state */
button[data-loading="button"] {
    pointer-events: none;
    opacity: 0.7;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Loading overlay for modals/sections */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: inherit;
}

[data-theme="dark"] .loading-overlay,
.dark .loading-overlay {
    background: rgba(17, 24, 39, 0.8);
}

/* Skeleton container spacing */
.loading-skeleton-container > * + * {
    margin-top: 1rem;
}

/* ============================================
   Form Validation Styles
   ============================================ */

/* Form group wrapper for proper error placement */
.form-group {
    position: relative;
    margin-bottom: 1rem;
}

/* Error state for inputs */
input.border-red-500,
select.border-red-500,
textarea.border-red-500 {
    border-color: #ef4444 !important;
}

input.border-red-500:focus,
select.border-red-500:focus,
textarea.border-red-500:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    outline: none;
}

/* Success state for inputs */
input.border-green-500,
select.border-green-500,
textarea.border-green-500 {
    border-color: #22c55e !important;
}

/* Validation error message */
.validation-error {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.validation-error::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ef4444'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

/* Dark mode validation error */
[data-theme="dark"] .validation-error,
.dark .validation-error {
    color: #f87171;
}

/* Shake animation for invalid submit */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

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

/* Required field indicator */
.required-indicator::after {
    content: ' *';
    color: #ef4444;
}

/* Helper text for form fields */
.form-helper {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

[data-theme="dark"] .form-helper,
.dark .form-helper {
    color: #9ca3af;
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    background: #e5e7eb;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-bar.weak { width: 25%; background: #ef4444; }
.password-strength-bar.fair { width: 50%; background: #f59e0b; }
.password-strength-bar.good { width: 75%; background: #3b82f6; }
.password-strength-bar.strong { width: 100%; background: #22c55e; }

/* Character counter */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.char-counter.warning { color: #f59e0b; }
.char-counter.error { color: #ef4444; }

/* ============================================
   Number Counter Animation
   ============================================ */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Section Dividers
   ============================================ */
.section-wave {
    position: relative;
}

.section-wave::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23f9fafb' d='M0,30 C480,60 960,0 1440,30 L1440,60 L0,60 Z'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
}

/* ============================================
   Global Checkbox Styles Fix
   Ensures checkmarks are visible in all modes
   ============================================ */

/* Base checkbox styling - ensure proper visibility in all modes */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]) {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid #9ca3af;
    border-radius: 0.25rem;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease-in-out;
    flex-shrink: 0;
}

/* Checkbox hover state */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):hover {
    border-color: #7c3aed;
}

/* Checkbox focus state */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
    border-color: #7c3aed;
}

/* Checked state - purple background with white checkmark */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Indeterminate state */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):indeterminate {
    background-color: #7c3aed;
    border-color: #7c3aed;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3crect x='3' y='7' width='10' height='2' rx='1'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Dark mode checkbox - unchecked */
[data-theme="dark"] input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]),
.dark input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]) {
    background-color: #374151;
    border-color: #4b5563;
}

/* Dark mode checkbox - hover */
[data-theme="dark"] input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):hover,
.dark input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):hover {
    border-color: #8b5cf6;
}

/* Dark mode checkbox - focus */
[data-theme="dark"] input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):focus,
.dark input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.4);
    border-color: #8b5cf6;
}

/* Dark mode checkbox - checked (purple background, white checkmark) */
[data-theme="dark"] input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):checked,
.dark input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

/* Dark mode checkbox - indeterminate */
[data-theme="dark"] input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):indeterminate,
.dark input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):indeterminate {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
}

/* Disabled checkbox */
input[type="checkbox"]:not(.hidden):not(.sr-only):not([class*="peer"]):disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Color variants - text-* classes set the checked background color */
input[type="checkbox"].text-purple-600:checked,
input[type="checkbox"].text-purple-500:checked {
    background-color: #9333ea !important;
    border-color: #9333ea !important;
}

input[type="checkbox"].text-blue-600:checked,
input[type="checkbox"].text-blue-500:checked {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}

input[type="checkbox"].text-green-600:checked,
input[type="checkbox"].text-green-500:checked {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

input[type="checkbox"].text-indigo-600:checked,
input[type="checkbox"].text-indigo-500:checked {
    background-color: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

input[type="checkbox"].text-red-600:checked,
input[type="checkbox"].text-red-500:checked {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* ============================================
   Drag and Drop Styles
   ============================================ */
.drag-over {
    border-color: #9333ea !important;
    background-color: #faf5ff !important;
    box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.3);
}
