/* ═══════════════════════════════════════════════
   OneNextLabs AI - Custom Styles
   ═══════════════════════════════════════════════ */

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --gradient-start: #4f46e5;
    --gradient-end: #7c3aed;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.7;
}

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

.text-gradient {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Hero Section ─── */
.hero-gradient {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 50%, #faf5ff 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.08), transparent 70%);
    border-radius: 50%;
}

.hero-blob {
    width: 320px;
    height: 320px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    animation: blob 8s ease-in-out infinite;
    box-shadow: 0 20px 60px rgba(79, 70, 229, 0.3);
}

@keyframes blob {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

.hero-placeholder {
    width: 100%;
    height: 100%;
    border-radius: inherit;
}

/* ─── Cards ─── */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.bg-gradient-subtle {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

/* ─── Book Cover 3D ─── */
.book-cover {
    width: 140px;
    height: 190px;
    position: relative;
    perspective: 600px;
}

.book-front {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px 8px 8px 2px;
    box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    transform: rotateY(-5deg);
    transition: transform 0.3s ease;
}

.card-hover:hover .book-front {
    transform: rotateY(0deg);
}

.book-spine {
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(135deg, #3730a3, #4f46e5);
    border-radius: 2px 0 0 2px;
    transform: rotateY(30deg);
    transform-origin: left;
}

/* ─── Timeline ─── */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--gradient-start), var(--gradient-end));
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

.timeline-marker {
    position: absolute;
    left: 12px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px currentColor;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
}

/* ─── Blog Content ─── */
.blog-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.blog-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.blog-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', monospace;
}

.blog-content pre code {
    background: none;
    padding: 0;
}

.blog-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

.blog-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

/* ─── Paywall ─── */
.paywall-overlay {
    position: relative;
}

.paywall-blur {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, white);
}

/* ─── Navbar ─── */
.navbar .nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar .nav-link:hover {
    background: #f1f5f9;
}

.navbar .nav-link.active {
    color: var(--primary) !important;
    background: #eef2ff;
}

/* ─── Sidebar (Admin) ─── */
.sidebar .nav-link {
    padding: 0.6rem 1rem;
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
}

/* ─── Buttons ─── */
.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: none;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
}

/* ─── Forms ─── */
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-blob {
        width: 220px;
        height: 220px;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-item {
        padding-left: 45px;
    }

    .timeline-marker {
        left: 8px;
    }
}

/* ─── Animations ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-hover {
    animation: fadeInUp 0.5s ease forwards;
}

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

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

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

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

/* ─── Print Styles ─── */
@media print {
    .navbar, footer, .btn, .paywall-overlay { display: none !important; }
}
