/**
 * Premium Design System - Shared Styles
 * Glassmorphism, typography, and component styles for consistent branding
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
    --dm-bg-primary: #F8F8F8;
    --dm-bg-secondary: #FAFAFA;
    --dm-bg-tertiary: #FFFFFF;
    --dm-text-primary: #0A0A0A;
    --dm-text-secondary: #525252;
    --dm-text-tertiary: #5A5A5A;
    --dm-border-primary: #E5E5E5;
    --dm-border-secondary: #D4D4D4;
    --dm-accent-primary: #0A0A0A;
    --dm-accent-hover: #262626;
    --dm-shadow-sm: rgba(0, 0, 0, 0.05);
    --dm-shadow-md: rgba(0, 0, 0, 0.08);
    --dm-shadow-lg: rgba(0, 0, 0, 0.1);
    --dm-shadow-xl: rgba(0, 0, 0, 0.12);
    --dm-glow: rgba(10, 10, 10, 0.1);
    --logo-invert: 0;
}

[data-theme="dark"] {
    --dm-bg-primary: #0F0F0F;
    --dm-bg-secondary: #1A1A1A;
    --dm-bg-tertiary: #2A2A2A;
    --dm-text-primary: #F5F5F5;
    --dm-text-secondary: #B4B4B4;
    --dm-text-tertiary: #8A8A8A;
    --dm-border-primary: #3A3A3A;
    --dm-border-secondary: #4A4A4A;
    --dm-accent-primary: #F5F5F5;
    --dm-accent-hover: #E0E0E0;
    --dm-shadow-sm: rgba(0, 0, 0, 0.4);
    --dm-shadow-md: rgba(0, 0, 0, 0.6);
    --dm-shadow-lg: rgba(0, 0, 0, 0.8);
    --dm-shadow-xl: rgba(0, 0, 0, 1);
    --dm-glow: rgba(245, 245, 245, 0.1);
    --logo-invert: 1;
}

[data-theme="dark"] body {
    background: var(--dm-bg-primary) !important;
    color: var(--dm-text-primary) !important;
}

/* ============================================
   GLASSMORPHISM BACKGROUND
   ============================================ */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(10, 10, 10, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(10, 10, 10, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(10, 10, 10, 0.03), transparent);
    pointer-events: none;
    z-index: 0;
}

[data-theme="dark"] body::before {
    background:
        radial-gradient(circle at 20% 30%, rgba(245, 245, 245, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(245, 245, 245, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(245, 245, 245, 0.04), transparent);
}

body > main {
    position: relative;
    z-index: 1;
}

/* ============================================
   PREMIUM GLASSMORPHISM CARDS
   ============================================ */

.glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255, 255, 255, 0.7) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .glass-card {
    background: rgba(42, 42, 42, 0.4) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px var(--dm-shadow-lg), 0 0 0 1px var(--dm-border-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Legacy class name for backwards compatibility */
.premium-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    background: rgba(255, 255, 255, 0.7) !important;
    border: 0.5px solid rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .premium-card {
    background: rgba(42, 42, 42, 0.4) !important;
    border: 0.5px solid rgba(255, 255, 255, 0.1) !important;
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px var(--dm-shadow-lg), 0 0 0 1px var(--dm-border-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    letter-spacing: -0.035em;
    font-weight: 500;
    line-height: 1.1;
}

h2 {
    letter-spacing: -0.025em;
    font-weight: 500;
    line-height: 1.2;
}

/* ============================================
   PREMIUM INPUTS
   ============================================ */

input[type="text"],
input[type="email"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

input[type="text"]:hover,
input[type="email"]:hover {
    border-color: var(--dm-border-secondary);
}

input[type="text"]:focus,
input[type="email"]:focus {
    border-color: var(--dm-accent-primary) !important;
    box-shadow: 0 0 0 3px var(--dm-glow) !important;
    transform: translateY(-1px);
}

/* ============================================
   PREMIUM BUTTONS
   ============================================ */

button[type="submit"] {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button[type="submit"]:hover::before {
    left: 100%;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--dm-shadow-xl), 0 0 0 1px var(--dm-accent-primary);
}

button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--dm-shadow-lg);
}

/* ============================================
   FEATURE ITEMS
   ============================================ */

.feature-item {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 16px;
    margin: -16px;
    border-radius: 8px;
}

.feature-item:hover {
    background: var(--dm-bg-secondary);
    transform: translateX(4px);
}

.feature-item svg {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover svg {
    transform: scale(1.1);
}

/* ============================================
   COFRAME-INSPIRED PREMIUM ENHANCEMENTS
   ============================================ */

/* Enhanced card hover states with depth */
.premium-card.group:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px var(--dm-shadow-lg), 0 0 0 1px var(--dm-border-secondary);
}

/* Icon container animations */
.premium-card .w-8.h-8 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover .w-8.h-8 {
    transform: scale(1.05);
    background: var(--dm-bg-primary) !important;
}

/* Smooth icon color transitions */
.premium-card svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover svg {
    color: var(--dm-accent-primary) !important;
}

/* Badge pill hover effect */
.inline-block.px-4.py-1\.5.rounded-full {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inline-block.px-4.py-1\.5.rounded-full:hover {
    transform: scale(1.02);
    border-color: var(--dm-border-secondary);
}

/* Subtle gradient overlays for case studies */
.premium-card.relative.overflow-hidden::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, var(--dm-glow) 100%);
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 0;
}

.premium-card.relative.overflow-hidden:hover::after {
    opacity: 1;
}

/* Ensure content stays above gradient */
.premium-card.relative.overflow-hidden > .relative {
    z-index: 1;
}

/* Smooth text color transitions */
.premium-card .text-base.md\:text-lg.font-medium,
.premium-card .text-3xl.md\:text-4xl.font-light {
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add subtle glow to headings on hover */
@media (prefers-reduced-motion: no-preference) {
    .premium-card:hover .text-3xl.md\:text-4xl.font-light {
        text-shadow: 0 0 20px var(--dm-glow);
    }
}

/* Stagger animations for grid items */
@media (min-width: 768px) {
    .grid > .premium-card:nth-child(1) {
        animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
    }

    .grid > .premium-card:nth-child(2) {
        animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
    }

    .grid > .premium-card:nth-child(3) {
        animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
    }

    .grid > .premium-card:nth-child(4) {
        animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
    }
}

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

/* Section header animations */
h2.text-3xl.md\:text-4xl.lg\:text-5xl {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.smooth-scroll {
    scroll-behavior: smooth;
}

::selection {
    background: var(--dm-accent-primary);
    color: white;
}

a {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
    color: var(--dm-accent-primary);
}
