/*
 * Cooply - Design System
 * Dark charcoal theme with coral accent
 * Based on Tailwind CSS utility classes
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Dark charcoal theme */
    --background: 0 0% 6%;
    --foreground: 0 0% 98%;
    --card: 0 0% 8%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 8%;
    --popover-foreground: 0 0% 98%;

    /* Coral accent color */
    --primary: 12 76% 61%;
    --primary-foreground: 0 0% 98%;

    --secondary: 0 0% 12%;
    --secondary-foreground: 0 0% 98%;

    --muted: 0 0% 15%;
    --muted-foreground: 0 0% 65%;

    --accent: 0 0% 15%;
    --accent-foreground: 0 0% 98%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 98%;

    --border: 0 0% 18%;
    --input: 0 0% 18%;
    --ring: 12 76% 61%;

    --radius: 0.5rem;
}

/* ========================================
   Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    border-radius: 2px;
}

.btn:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
}

/* ========================================
   Color Utilities
   ======================================== */
.bg-background { background-color: hsl(var(--background)); }
.bg-foreground { background-color: hsl(var(--foreground)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-transparent { background-color: transparent; }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-primary\/5 { background-color: hsl(var(--primary) / 0.05); }
.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-muted\/50 { background-color: hsl(var(--muted) / 0.5); }
.bg-destructive { background-color: hsl(var(--destructive)); }
.bg-destructive\/10 { background-color: hsl(var(--destructive) / 0.1); }

.text-foreground { color: hsl(var(--foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }

.border-border { border-color: hsl(var(--border)); }
.border-primary { border-color: hsl(var(--primary)); }
.border-primary\/20 { border-color: hsl(var(--primary) / 0.2); }
.border-primary\/30 { border-color: hsl(var(--primary) / 0.3); }
.border-primary\/50 { border-color: hsl(var(--primary) / 0.5); }
.hover\:border-primary\/20:hover { border-color: hsl(var(--primary) / 0.2); }
.border-destructive { border-color: hsl(var(--destructive)); }

.fill-primary { fill: hsl(var(--primary)); }

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1.1; }
.text-6xl { font-size: 3.75rem; line-height: 1.1; }
.text-8xl { font-size: 6rem; line-height: 1; }
.text-9xl { font-size: 8rem; line-height: 1; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }

.tracking-tight { letter-spacing: -0.025em; }

.text-center { text-align: center; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ========================================
   Layout
   ======================================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.flex { display: flex; }
.flex-1 { flex: 1 1 0%; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-16 { gap: 4rem; }

.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }

.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }
.w-full { width: 100%; }
.max-w-none { max-width: none; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

/* Fixed sizes */
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }

.shrink-0 { flex-shrink: 0; }
.resize-none { resize: none; }

/* ========================================
   Spacing
   ======================================== */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.pt-8 { padding-top: 2rem; }
.pt-16 { padding-top: 4rem; }
.pb-8 { padding-bottom: 2rem; }

.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* ========================================
   Borders
   ======================================== */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-y { border-top-width: 1px; border-bottom-width: 1px; border-style: solid; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: var(--radius); }
.rounded-full { border-radius: 9999px; }

/* ========================================
   Positioning
   ======================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.-top-3 { top: -0.75rem; }
.left-6 { left: 1.5rem; }

.z-50 { z-index: 50; }

.overflow-hidden { overflow: hidden; }

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.btn-outline {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background-color: hsl(var(--muted));
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

/* ========================================
   Inputs
   ======================================== */
.input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
    color: hsl(var(--muted-foreground));
}

.input:focus {
    outline: none;
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

textarea.input {
    min-height: 120px;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

/* ========================================
   Navigation
   ======================================== */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bg-background\/80 {
    background-color: hsl(var(--background) / 0.8);
}

/* ========================================
   Cards
   ======================================== */
.group:hover .group-hover\:text-primary {
    color: hsl(var(--primary));
}

.group:hover .group-hover\:border-primary\/50 {
    border-color: hsl(var(--primary) / 0.5);
}

.hover\:text-primary:hover {
    color: hsl(var(--primary));
}

.hover\:underline:hover {
    text-decoration: underline;
}

.hover\:bg-primary\/90:hover {
    background-color: hsl(var(--primary) / 0.9);
}

.hover\:bg-muted\/80:hover {
    background-color: hsl(var(--muted) / 0.8);
}

.hover\:border-primary\/50:hover {
    border-color: hsl(var(--primary) / 0.5);
}

/* ========================================
   Transitions
   ======================================== */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.transition-all {
    transition-property: all;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.transition-transform {
    transition-property: transform;
    transition-timing-function: ease;
}

.cursor-pointer { cursor: pointer; }

/* ========================================
   Lists
   ======================================== */
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }
.list-inside { list-style-position: inside; }

/* ========================================
   Text 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
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in-delay-1 {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.1s forwards;
}

.animate-fade-in-delay-2 {
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.2s forwards;
}

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

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

/* Alpine.js cloak */
[x-cloak] {
    display: none !important;
}

/* Transform utilities for dropdown */
.translate-y-0 { transform: translateY(0); }
.translate-y-1 { transform: translateY(0.25rem); }
.-translate-x-1\/2 { transform: translateX(-50%); }
.left-1\/2 { left: 50%; }

/* Combined transforms */
.left-1\/2.-translate-x-1\/2 {
    left: 50%;
    transform: translateX(-50%);
}

/* Transition duration */
.duration-100 { transition-duration: 100ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }

/* Rotate utilities */
.rotate-180 { transform: rotate(180deg); }

/* Additional spacing */
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.pl-3 { padding-left: 0.75rem; }
.gap-1 { gap: 0.25rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.ml-4 { margin-left: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-16 { margin-bottom: 4rem; }
.mx-6 { margin-left: 1.5rem; margin-right: 1.5rem; }
.min-w-\[200px\] { min-width: 200px; }
.p-1 { padding: 0.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.pb-5 { padding-bottom: 1.25rem; }

/* Additional widths */
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }

/* Hover states */
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:bg-muted\/50:hover { background-color: hsl(var(--muted) / 0.5); }

/* Background opacity */
.bg-background\/95 { background-color: hsl(var(--background) / 0.95); }

/* ========================================
   Prose Styles (for blog content)
   ======================================== */
.prose {
    color: hsl(var(--muted-foreground));
}

.prose h1,
.prose h2,
.prose h3 {
    color: hsl(var(--foreground));
}

.prose a {
    color: hsl(var(--primary));
}

.prose a:hover {
    text-decoration: underline;
}

.prose strong {
    color: hsl(var(--foreground));
    font-weight: 600;
}

.prose hr {
    border-color: hsl(var(--border));
}

.prose-invert {
    color: hsl(var(--muted-foreground));
}

.prose-lg {
    font-size: 1.125rem;
    line-height: 1.75;
}

/* ========================================
   Responsive Grid
   ======================================== */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:col-span-1 { grid-column: span 1 / span 1; }
    .md\:text-left { text-align: left; }
    .md\:justify-start { justify-content: flex-start; }
    .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
    .md\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-5xl { font-size: 3rem; line-height: 1.1; }
    .md\:text-9xl { font-size: 8rem; line-height: 1; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1.1; }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .no-print { display: none !important; }
}
