/**
 * GlobalWatch - Custom Styles
 * Animations, custom utilities, and brand styles
 */

/* ==================== BASE STYLES ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Franklin', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1a1a1a;
    background-color: #ffffff;
    min-height: 100vh;
}

/* Font families */
.font-franklin {
    font-family: 'Libre Franklin', system-ui, sans-serif;
}

.font-baskerville {
    font-family: 'Libre Baskerville', Georgia, serif;
}

/* Brand colors */
.text-brand-red { color: #DC2626; }
.bg-brand-red { background-color: #DC2626; }
.border-brand-red { border-color: #DC2626; }
.hover\:text-brand-red:hover { color: #DC2626; }
.hover\:bg-brand-red:hover { background-color: #DC2626; }
.hover\:bg-red-700:hover { background-color: #B91C1C; }

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==================== ANIMATIONS ==================== */

/* Fade animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@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);
    }
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Slide animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Bounce and spring animations */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes springUp {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    80% {
        transform: translateY(4px) scale(0.99);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* Blur animations */
@keyframes blurIn {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes blurUp {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* Text reveal */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotate */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(220, 38, 38, 0);
    }
}

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

/* Skeleton pulse */
@keyframes skeletonPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.7;
    }
}

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

/* Menu animations */
@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes menuSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Page transitions */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==================== ANIMATION CLASSES ==================== */

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

.animate-fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-scale-up {
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-down {
    animation: slideDown 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.animate-spring-up {
    animation: springUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.animate-blur-in {
    animation: blurIn 0.6s ease-out forwards;
}

.animate-blur-up {
    animation: blurUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-text-reveal {
    animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.animate-rotate-in {
    animation: rotateIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.animate-skeleton {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

.animate-spin-slow {
    animation: spin 2s linear infinite;
}

.page-content {
    animation: contentFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==================== STAGGER DELAYS ==================== */

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

.delay-75 { animation-delay: 75ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ==================== HOVER EFFECTS ==================== */

/* Animated underline on hover */
.hover-underline-animation {
    position: relative;
    display: inline-block;
}

.hover-underline-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-underline-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Card lift effect */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* Subtle scale on hover */
.hover-scale {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Image zoom */
.hover-zoom {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-zoom:hover {
    transform: scale(1.08);
}

/* Glow effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.3);
}

/* Button press */
.active-scale:active {
    transform: scale(0.98);
}

/* ==================== LOADING STATES ==================== */

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

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e5e5;
    border-top-color: #DC2626;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== FORM STYLES ==================== */

input:focus,
textarea:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #DC2626;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #DC2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* ==================== PROSE STYLES ==================== */

.prose {
    max-width: 65ch;
    color: #374151;
}

.prose p {
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: #111827;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.75em;
}

.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.5em; }
.prose h3 { font-size: 1.25em; }

.prose a {
    color: #DC2626;
    text-decoration: underline;
}

.prose a:hover {
    color: #B91C1C;
}

.prose ul,
.prose ol {
    margin: 1.25em 0;
    padding-left: 1.5em;
}

.prose li {
    margin: 0.5em 0;
}

.prose blockquote {
    border-left: 4px solid #DC2626;
    padding-left: 1em;
    margin: 1.5em 0;
    font-style: italic;
    color: #6b7280;
}

.prose img {
    margin: 2em 0;
    border-radius: 0.5rem;
}

/* ==================== UTILITIES ==================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-2xs {
    font-size: 0.625rem;
}

/* Transition utilities */
.transition-400 {
    transition-duration: 400ms;
}

.transition-600 {
    transition-duration: 600ms;
}

.ease-out-expo {
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Grid item animation */
.grid-item-animate {
    opacity: 0;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
