@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

@layer base {
 :root{
     --background: 220 15% 6%;
     --foreground: 220 10% 95%;
     --card: 220 15% 8%;
     --card-foreground: 220 10% 95%;
     --popover: 220 15% 8%;
     --popover-foreground: 220 10% 95%;
     --primary: 192 85% 55%;
     --primary-foreground: 220 15% 6%;
     --secondary: 220 15% 12%;
     --secondary-foreground: 220 10% 95%;
     --muted: 220 15% 15%;
     --muted-foreground: 220 10% 55%;
     --accent: 192 85% 55%;
     --accent-foreground: 220 15% 6%;
     --destructive: 0 62.8% 50%;
     --destructive-foreground: 210 40% 98%;
     --border: 220 15% 15%;
     --input: 220 15% 15%;
     --ring: 192 85% 55%;
     --code-bg: 220 20% 10%;
     --code-header: 220 20% 14%;
     --code-text: 220 10% 90%;
}
}

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

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

.bg-background{
    background-color: hsl(var(--background));
}

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

.border-b {
    border-bottom-width: 2px;
}

.text-center {
    text-align: center;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(.4, 0, .2, 1);
    transition-duration: .15s;
}

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

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

.text-primary {
    color: hsl(var(--primary)) !important;
}

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

.blog-container {
    margin-left: auto;
    margin-right: auto;
    max-width: 700px;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* MARKDOWN ELEMENTLARI */

/* 1. INLINE CODE (backtick `) */
.prose-blog code:not(pre code) {
    background-color: hsl(var(--code-bg));
    color: hsl(var(--code-text));
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    font-weight: 500;
}

/* 2. CODE BLOCKS (```) */
.prose-blog pre {
    background-color: hsl(var(--code-bg));
    color: hsl(var(--code-text));
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid hsl(var(--border));
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

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

/* 3. BLOCKQUOTE (>) */
.prose-blog blockquote {
    border-left: 4px solid hsl(var(--primary));
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: hsl(var(--muted-foreground));
    background-color: hsl(var(--secondary));
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose-blog blockquote p {
    margin-bottom: 0.5rem;
}

.prose-blog blockquote p:last-child {
    margin-bottom: 0;
}

/* 4. TABLES (jadval) */
.prose-blog table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    overflow: hidden;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
}

.prose-blog thead {
    background-color: hsl(var(--secondary));
}

.prose-blog th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: hsl(var(--foreground));
    border-bottom: 2px solid hsl(var(--border));
}

.prose-blog td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
}

.prose-blog tbody tr:hover {
    background-color: hsl(var(--secondary) / 0.5);
}

.prose-blog tbody tr:last-child td {
    border-bottom: none;
}

/* 5. LISTS (ro'yxatlar) */
.prose-blog ul, .prose-blog ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose-blog ul li {
    list-style-type: disc;
    margin-bottom: 0.5rem;
}

.prose-blog ol li {
    list-style-type: decimal;
    margin-bottom: 0.5rem;
}

.prose-blog li p {
    margin-bottom: 0.5rem;
}

/* 6. HORIZONTAL RULE (---) */
.prose-blog hr {
    border: none;
    height: 1px;
    background-color: hsl(var(--border));
    margin: 2rem 0;
}

/* 7. IMAGES (rasmlar) */
.prose-blog img {
    margin: 1.5rem auto;
    max-width: 100%;
    border-radius: 0.5rem;
    display: block;
}

/* 8. STRONG (qalin matn) */
.prose-blog strong {
    font-weight: 700;
    color: hsl(var(--foreground));
}

/* 9. EM (kursiv matn) */
.prose-blog em {
    font-style: italic;
    color: hsl(var(--muted-foreground));
}

.prose-blog a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color 0.2s;
}

.prose-blog a:hover {
    text-decoration: underline;
    color: hsl(var(--primary));
    opacity: 0.9;
}

.prose-blog h1, .prose-blog h2, .prose-blog h3, 
.prose-blog h4, .prose-blog h5, .prose-blog h6 {
    color: hsl(var(--foreground));
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose-blog h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    border-bottom: 2px solid hsl(var(--border));
    padding-bottom: 0.5rem;
}

.prose-blog h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.prose-blog h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

.prose-blog h4 {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

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

.prose-blog h6 {
    font-size: 1rem;
    line-height: 1.5rem;
    color: hsl(var(--muted-foreground));
}

.prose-blog p {
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.code-wrapper {
    position: relative;
    margin-bottom: 1.5em;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.code-wrapper:hover .copy-btn {
    opacity: 1;
}

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

.prose-blog {
    line-height: 1.625;
    color: hsl(var(--foreground));
    font-family: 'Inter', sans-serif;
}

@media (max-width: 768px) {
    .time_block{
        display: none;
    }
    .prose-blog {
        font-size: 0.9375rem;
    }
    
    .prose-blog h1 {
        font-size: 1.75rem;
        line-height: 2rem;
    }
    
    .prose-blog h2 {
        font-size: 1.5rem;
        line-height: 1.75rem;
    }
    
    .prose-blog h3 {
        font-size: 1.25rem;
        line-height: 1.5rem;
    }
    
    .prose-blog table {
        display: block;
        overflow-x: auto;
    }
}

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

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

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
    z-index: 100;
    transition: width 0.1s;
}

html {
    scroll-behavior: smooth;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary), 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary), 0);
    }
}

#scrollToTop {
    animation: pulse 2s infinite;
}

#scrollToTop:hover {
    animation: none;
}