/* Main CSS file for davydany.com */

/* Navigation styles */
.nav-link {
    @apply text-gray-600 hover:text-gray-900 px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200;
}

.nav-link.active {
    @apply text-primary-600 bg-primary-50;
}

.mobile-nav-link {
    @apply text-gray-600 hover:text-gray-900 hover:bg-gray-50 block px-3 py-2 rounded-md text-base font-medium transition-colors duration-200;
}

.mobile-nav-link.active {
    @apply text-primary-600 bg-primary-50;
}

/* Custom animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-slide-up {
    animation: slide-up 0.6s ease-out forwards;
}

.animate-slide-down {
    animation: slide-down 0.3s ease-out forwards;
}

.animate-scale-in {
    animation: scale-in 0.3s ease-out forwards;
}

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

.transition-base {
    transition: all 0.2s ease;
}

.transition-smooth {
    transition: all 0.3s ease;
}

/* Focus styles for better accessibility */
.focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2;
}

/* Custom button styles */
.btn-base {
    @apply inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md transition-colors duration-200 focus-ring;
}

.btn-primary {
    @apply btn-base text-white bg-primary-600 hover:bg-primary-700;
}

.btn-secondary {
    @apply btn-base text-primary-600 bg-white border-primary-600 hover:bg-primary-50;
}

.btn-outline {
    @apply btn-base text-gray-700 bg-white border-gray-300 hover:bg-gray-50;
}

/* Card styles */
.card {
    @apply bg-white rounded-lg shadow-md border border-gray-200 overflow-hidden;
}

.card-hover {
    @apply card transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
}

/* Content styles */
.prose-custom {
    @apply prose prose-gray max-w-none;
}

.prose-custom h1,
.prose-custom h2,
.prose-custom h3,
.prose-custom h4 {
    @apply text-gray-900 font-semibold;
}

.prose-custom a {
    @apply text-primary-600 no-underline hover:underline;
}

.prose-custom code {
    @apply bg-gray-100 text-gray-800 px-1.5 py-0.5 rounded text-sm;
}

.prose-custom pre {
    @apply bg-gray-900 text-gray-100 rounded-lg;
}

/* Comprehensive Markdown/Prose styles - Fallback for blog posts */
.prose,
.prose-lg,
.prose-blue {
    color: #374151;
    line-height: 1.75;
}

/* Headings */
.prose h1,
.prose-lg h1,
.prose-blue h1 {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0;
    margin-bottom: 2rem;
    color: #111827;
}

.prose h2,
.prose-lg h2,
.prose-blue h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.prose h3,
.prose-lg h3,
.prose-blue h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.prose h4,
.prose-lg h4,
.prose-blue h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: #374151;
}

.prose h5,
.prose-lg h5,
.prose-blue h5 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.prose h6,
.prose-lg h6,
.prose-blue h6 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: #6b7280;
}

/* Paragraphs */
.prose p,
.prose-lg p,
.prose-blue p {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    line-height: 1.75;
}

/* Links */
.prose a,
.prose-lg a,
.prose-blue a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s ease;
}

.prose a:hover,
.prose-lg a:hover,
.prose-blue a:hover {
    border-bottom-color: #2563eb;
}

/* Strong/Bold */
.prose strong,
.prose-lg strong,
.prose-blue strong {
    font-weight: 700;
    color: #111827;
}

/* Emphasis/Italic */
.prose em,
.prose-lg em,
.prose-blue em {
    font-style: italic;
}

/* Lists */
.prose ul,
.prose-lg ul,
.prose-blue ul,
.prose ol,
.prose-lg ol,
.prose-blue ol {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.75rem;
}

.prose ul,
.prose-lg ul,
.prose-blue ul {
    list-style-type: disc;
}

.prose ol,
.prose-lg ol,
.prose-blue ol {
    list-style-type: decimal;
}

.prose li,
.prose-lg li,
.prose-blue li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    line-height: 1.75;
}

.prose ul ul,
.prose-lg ul ul,
.prose-blue ul ul,
.prose ol ul,
.prose-lg ol ul,
.prose-blue ol ul {
    list-style-type: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose ul ol,
.prose-lg ul ol,
.prose-blue ul ol,
.prose ol ol,
.prose-lg ol ol,
.prose-blue ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Code */
.prose code,
.prose-lg code,
.prose-blue code {
    background-color: #f3f4f6;
    color: #dc2626;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.prose pre,
.prose-lg pre,
.prose-blue pre {
    background-color: #1f2937;
    color: #f9fafb;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.prose pre code,
.prose-lg pre code,
.prose-blue pre code {
    background-color: transparent;
    color: inherit;
    font-size: inherit;
    padding: 0;
    border-radius: 0;
}

/* Blockquotes */
.prose blockquote,
.prose-lg blockquote,
.prose-blue blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    font-style: italic;
    color: #4b5563;
    background-color: #f9fafb;
    padding: 1rem 1.5rem;
    border-radius: 0.25rem;
}

.prose blockquote p,
.prose-lg blockquote p,
.prose-blue blockquote p {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Tables */
.prose table,
.prose-lg table,
.prose-blue table {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.prose thead,
.prose-lg thead,
.prose-blue thead {
    background-color: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.prose th,
.prose-lg th,
.prose-blue th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #111827;
}

.prose td,
.prose-lg td,
.prose-blue td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.prose tbody tr:hover,
.prose-lg tbody tr:hover,
.prose-blue tbody tr:hover {
    background-color: #f9fafb;
}

/* Horizontal Rule */
.prose hr,
.prose-lg hr,
.prose-blue hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

/* Images */
.prose img,
.prose-lg img,
.prose-blue img {
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    max-width: 100%;
    height: auto;
}

.prose figure,
.prose-lg figure,
.prose-blue figure {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prose figcaption,
.prose-lg figcaption,
.prose-blue figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    font-style: italic;
}

/* Task Lists */
.prose input[type="checkbox"],
.prose-lg input[type="checkbox"],
.prose-blue input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* First/Last element margins */
.prose > *:first-child,
.prose-lg > *:first-child,
.prose-blue > *:first-child {
    margin-top: 0;
}

.prose > *:last-child,
.prose-lg > *:last-child,
.prose-blue > *:last-child {
    margin-bottom: 0;
}

/* Responsive typography */
.text-responsive-xl {
    @apply text-xl sm:text-2xl lg:text-3xl;
}

.text-responsive-2xl {
    @apply text-2xl sm:text-3xl lg:text-4xl;
}

.text-responsive-3xl {
    @apply text-3xl sm:text-4xl lg:text-5xl;
}

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

.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes shine {
    0% { transform: translateX(-100%) skewX(-12deg); }
    100% { transform: translateX(200%) skewX(-12deg); }
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break-before {
        page-break-before: always;
    }
    
    .print-break-after {
        page-break-after: always;
    }
    
    .print-avoid-break {
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    a {
        color: inherit !important;
        text-decoration: none !important;
    }
    
    .bg-primary-600,
    .bg-primary-700,
    .bg-primary-500 {
        background-color: #374151 !important;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1f2937;
        --text-primary: #f9fafb;
        --border-primary: #374151;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        @apply border-2 border-gray-900;
    }
    
    .btn-primary {
        @apply border-2 border-primary-900;
    }
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}