/* Modern Blog Styles - Tailwind CSS Enhancement */

/* ========================================
   Base Styles
   ======================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

.prose {
    color: #334155;
    line-height: 1.8;
}

.dark .prose {
    color: #cbd5e1;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
}

.dark .prose h1, .dark .prose h2, .dark .prose h3, .dark .prose h4, .dark .prose h5, .dark .prose h6 {
    color: #f8fafc;
}

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

.prose p {
    margin-bottom: 1.5em;
}

.prose a {
    color: #0ea5e9;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.prose a:hover {
    border-bottom-color: #0ea5e9;
}

.prose code {
    background: #f1f5f9;
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
    font-size: 0.875em;
    font-family: 'SF Mono', Monaco, monospace;
}

.dark .prose code {
    background: #1e293b;
}

.prose pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5em;
    border-radius: 0.75em;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose pre code {
    background: transparent;
    padding: 0;
}

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

.dark .prose blockquote {
    color: #94a3b8;
}

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

.prose li {
    margin: 0.5em 0;
}

.prose img {
    max-width: 100%;
    border-radius: 0.75em;
    margin: 1.5em 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.prose th, .prose td {
    padding: 0.75em;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.dark .prose th, .dark .prose td {
    border-color: #334155;
}

.prose th {
    background: #f8fafc;
    font-weight: 600;
}

.dark .prose th {
    background: #1e293b;
}

/* ========================================
   Markdown Content Styles
   ======================================== */

.markdown-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #334155;
}

.dark .markdown-content {
    color: #cbd5e1;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.dark .markdown-content h1,
.dark .markdown-content h2,
.dark .markdown-content h3,
.dark .markdown-content h4,
.dark .markdown-content h5,
.dark .markdown-content h6 {
    color: #f8fafc;
}

.markdown-content h1 { font-size: 2.25rem; }
.markdown-content h2 { font-size: 1.875rem; }
.markdown-content h3 { font-size: 1.5rem; }
.markdown-content h4 { font-size: 1.25rem; }

.markdown-content p {
    margin-bottom: 1.5rem;
}

.markdown-content a {
    color: #0ea5e9;
    text-decoration: none;
    transition: color 0.2s;
}

.markdown-content a:hover {
    color: #0284c7;
    text-decoration: underline;
}

.markdown-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    color: #ec4899;
}

.dark .markdown-content code {
    background: #1e293b;
    color: #f472b6;
}

.markdown-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

.markdown-content blockquote {
    border-left: 4px solid #0ea5e9;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8fafc;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
}

.dark .markdown-content blockquote {
    background: #1e293b;
}

.markdown-content blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin: 0.5rem 0;
}

.markdown-content li > ul,
.markdown-content li > ol {
    margin: 0.5rem 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 2rem 0;
}

.dark .markdown-content hr {
    border-color: #334155;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.markdown-content th,
.markdown-content td {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.dark .markdown-content th,
.dark .markdown-content td {
    border-color: #334155;
}

.markdown-content th {
    background: #f8fafc;
    font-weight: 600;
    color: #0f172a;
}

.dark .markdown-content th {
    background: #1e293b;
    color: #f8fafc;
}

.markdown-content tr:nth-child(even) {
    background: #f8fafc;
}

.dark .markdown-content tr:nth-child(even) {
    background: #1e293b;
}

/* ========================================
   Animation Utilities
   ======================================== */

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

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

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

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

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

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

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

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

/* ========================================
   Utility Classes
   ======================================== */

.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;
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover Card Effect */
.hover-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

/* Button Hover Effect */
.btn-hover {
    position: relative;
    overflow: hidden;
}

.btn-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-hover:hover::before {
    width: 300px;
    height: 300px;
}

/* Link Underline Animation */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

/* ========================================
   Responsive Utilities
   ======================================== */

@media (max-width: 640px) {
    .markdown-content {
        font-size: 1rem;
    }
    
    .markdown-content h1 { font-size: 1.875rem; }
    .markdown-content h2 { font-size: 1.5rem; }
    .markdown-content h3 { font-size: 1.25rem; }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .markdown-content {
        color: black !important;
    }
}
