/* CSS Variables for theme management */
:root {
    --brand-lilac: #B794F6;
    --brand-mint: #68D391;
    --brand-emerald: #2F855A;
    --brand-purple: #805AD5;
    --brand-teal: #38B2AC;
    --dark-bg: #0F2027;
    --dark-bg-secondary: #203A43;
    --dark-bg-tertiary: #2C5364;
}

/* Custom styles for components not covered by Tailwind */

/* Navigation styling */
.nav-link {
    @apply hover:text-brand-emerald dark:hover:text-brand-lilac transition-colors;
}

/* Social links */
.social-link {
    @apply text-gray-600 dark:text-gray-400 hover:text-brand-emerald dark:hover:text-brand-lilac transition-colors;
}

/* CTA buttons */
.cta-button {
    @apply transform hover:scale-105 transition-all duration-300;
}

/* Quick navigation icons */
.quick-nav-icon {
    @apply p-3 rounded-full bg-white dark:bg-gray-800 shadow-lg hover:shadow-xl transition-all duration-300;
}

/* Animation classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Landing page animations */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

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

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

.animate-typewriter {
    animation: typewriter 0.8s ease-out forwards;
}

/* Fact cards */
.fact-card {
    @apply transform hover:scale-105 transition-all duration-300;
}

/* Timeline styles */
.timeline-item {
    @apply relative;
}

.timeline-icon {
    @apply relative z-10 flex-shrink-0;
}

.timeline-date {
    @apply inline-block px-3 py-1 rounded-full bg-brand-emerald/10 dark:bg-brand-lilac/10;
}

/* Accordion styles */
.accordion-button {
    @apply hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors;
}

.accordion-content {
    @apply transition-all duration-300;
}

.accordion-icon {
    @apply transition-transform duration-300;
}

/* Skill category cards */
.skill-category {
    @apply transform hover:scale-105 transition-all duration-300;
}

/* Post cards */
.post-card {
    @apply transform hover:scale-105 transition-all duration-300;
}

/* 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;
}

/* Project card styles */
.project-card {
    @apply relative overflow-hidden;
}

.project-overlay {
    @apply absolute inset-0 bg-black bg-opacity-75 flex items-center justify-center transition-all duration-300;
}

.project-card:hover .project-overlay {
    @apply opacity-100;
}

/* Filter chips */
.filter-chip {
    @apply px-4 py-2 rounded-full border border-gray-300 dark:border-gray-600 text-sm font-medium transition-all duration-200 hover:bg-gray-50 dark:hover:bg-gray-800;
}

.filter-chip.active {
    @apply bg-brand-emerald text-white border-brand-emerald;
}

.filter-chip:hover {
    @apply transform scale-105;
}

/* Masonry grid */
.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
    column-fill: balance;
}

@media (min-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
    break-inside: avoid;
}

/* Parallax effects */
.parallax-container {
    @apply relative overflow-hidden;
}

.parallax-map {
    @apply w-full h-full;
}

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

::-webkit-scrollbar-track {
    @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
    @apply bg-gray-300 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
    @apply bg-gray-400 dark:bg-gray-500;
}

/* Loading spinner */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus {
    @apply outline-none ring-2 ring-brand-emerald ring-offset-2 dark:ring-offset-dark-bg;
}

/* Responsive iframe containers */
.aspect-w-16 {
    position: relative;
    width: 100%;
}

.aspect-w-16::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.aspect-h-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        color: #000 !important;
    }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* 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;
    }
    
    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-link {
        @apply text-black dark:text-white;
    }
    
    .social-link {
        @apply text-black dark:text-white;
    }
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
    
    .timeline-item {
        @apply text-left;
    }
    
    .timeline-icon {
        @apply mx-0 ml-4;
    }
    
    .parallax-map {
        transform: none !important;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }
}

/* Large screen adjustments */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background-color: var(--brand-lilac);
    color: var(--brand-emerald);
}

::-moz-selection {
    background-color: var(--brand-lilac);
    color: var(--brand-emerald);
}

/* Custom utility classes */
.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

/* Backdrop blur fallback */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur-md {
        background-color: rgba(255, 255, 255, 0.95);
    }
    
    .dark .backdrop-blur-md {
        background-color: rgba(15, 23, 42, 0.95);
    }
}

/* Interactive elements */
.interactive-hover {
    @apply transform transition-all duration-300 hover:scale-105 hover:shadow-lg;
}

/* Error states */
.error-state {
    @apply text-red-600 dark:text-red-400;
}

.error-border {
    @apply border-red-300 dark:border-red-600;
}

/* Success states */
.success-state {
    @apply text-green-600 dark:text-green-400;
}

.success-border {
    @apply border-green-300 dark:border-green-600;
}

/* Loading states */
.loading-skeleton {
    @apply animate-pulse bg-gray-200 dark:bg-gray-700 rounded;
}

/* Glassmorphism effects */
.glass-effect {
    @apply bg-white/20 dark:bg-gray-900/20 backdrop-blur-md border border-white/30 dark:border-gray-700/30;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-emerald), var(--brand-lilac));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Custom shadows */
.shadow-brand {
    box-shadow: 0 4px 14px 0 rgba(233, 216, 253, 0.3);
}

.dark .shadow-brand {
    box-shadow: 0 4px 14px 0 rgba(6, 95, 70, 0.3);
}

/* Hover effects */
.hover-lift {
    @apply transform transition-all duration-300 hover:-translate-y-1 hover:shadow-lg;
}

.hover-glow {
    @apply transition-all duration-300 hover:shadow-lg hover:shadow-brand-lilac/20;
}

/* Text effects */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .text-shadow {
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Border gradients */
.border-gradient {
    border: 1px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--brand-lilac), var(--brand-mint)) border-box;
}

.dark .border-gradient {
    background: linear-gradient(var(--dark-bg), var(--dark-bg)) padding-box,
                linear-gradient(135deg, var(--brand-lilac), var(--brand-mint)) border-box;
}

/* Responsive utilities */
.container-responsive {
    @apply container mx-auto px-4 sm:px-6 lg:px-8;
}

.grid-responsive {
    @apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6;
}

.flex-responsive {
    @apply flex flex-col sm:flex-row gap-4;
}

/* Animation delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
