/* =====================================================
   DevCamp4Zero.fr - Modern Tutorials Blog Styles
   ===================================================== */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --light: #f8fafc;
    --html-color: #e34c26;
    --css-color: #264de4;
    --js-color: #f7df1e;
    --python-color: #3776ab;
    --react-color: #61dafb;
    --node-color: #339933;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

/* Logo & Brand */
.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

/* Navigation */
.navbar {
    padding: 0.75rem 0;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.95) !important;
}

.navbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s;
}

.navbar .nav-link:hover {
    color: var(--primary) !important;
}

.navbar .form-control {
    background: var(--dark-light);
    border: none;
    color: white;
}

.navbar .form-control::placeholder {
    color: var(--gray);
}

.navbar .form-control:focus {
    background: var(--dark-light);
    box-shadow: 0 0 0 2px var(--primary);
    color: white;
}

/* Hero Section */
.hero-section {
    background: var(--dark);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(14, 165, 233, 0.15) 0%, transparent 50%);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.min-vh-50 {
    min-height: 50vh;
}

.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-row {
    opacity: 0.9;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.5rem;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Cards */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: white;
    border-radius: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.category-card span {
    color: var(--dark);
    font-weight: 600;
    margin-top: 0.75rem;
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    transition: transform 0.3s;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon.html {
    background: rgba(227, 76, 38, 0.1);
    color: var(--html-color);
}

.category-icon.css {
    background: rgba(38, 77, 228, 0.1);
    color: var(--css-color);
}

.category-icon.js {
    background: rgba(247, 223, 30, 0.15);
    color: #b8a900;
}

.category-icon.python {
    background: rgba(55, 118, 171, 0.1);
    color: var(--python-color);
}

.category-icon.react {
    background: rgba(97, 218, 251, 0.15);
    color: #00a0c4;
}

.category-icon.node {
    background: rgba(51, 153, 51, 0.1);
    color: var(--node-color);
}

/* Tutorial Cards */
.tutorial-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.tutorial-image {
    position: relative;
    overflow: hidden;
    height: 180px;
}

.tutorial-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.tutorial-card:hover .tutorial-image img {
    transform: scale(1.05);
}

.tutorial-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tutorial-badge.html { background: var(--html-color); }
.tutorial-badge.css { background: var(--css-color); }
.tutorial-badge.js { background: #b8a900; }
.tutorial-badge.python { background: var(--python-color); }
.tutorial-badge.react { background: #00a0c4; }
.tutorial-badge.node { background: var(--node-color); }

.tutorial-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray);
}

.tutorial-meta i {
    margin-right: 0.25rem;
}

.tutorial-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.tutorial-content h3 a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s;
}

.tutorial-content h3 a:hover {
    color: var(--primary);
}

.tutorial-content p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex: 1;
}

.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.author span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
}

.tutorial-footer .date {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Newsletter Section */
.newsletter-section {
    background: var(--gradient);
    color: white;
}

.newsletter-form .form-control {
    border: none;
    padding: 1rem 1.25rem;
    border-radius: 10px 0 0 10px;
}

.newsletter-form .btn {
    border-radius: 0 10px 10px 0;
    padding: 1rem 2rem;
}

/* Feature Boxes */
.feature-box {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    height: 100%;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.feature-box:hover {
    transform: translateY(-3px);
}

.feature-box i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.feature-box h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-box p {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
}

.footer h5 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: white;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer ul a:hover {
    color: var(--primary);
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--dark-light);
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    margin-right: 0.5rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .stat-item {
        padding: 0 1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .tutorial-image {
        height: 150px;
    }

    .newsletter-form .input-group {
        flex-direction: column;
    }

    .newsletter-form .form-control {
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }

    .newsletter-form .btn {
        border-radius: 10px;
        width: 100%;
    }
}

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

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

/* Selection Color */
::selection {
    background: var(--primary);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =====================================================
   Article Page Styles
   ===================================================== */

/* Article Header */
.article-header {
    background: var(--dark);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    color: white;
    padding: 3rem 0 4rem;
}

.article-header .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.article-header .breadcrumb-item a {
    color: var(--gray);
    text-decoration: none;
    transition: color 0.2s;
}

.article-header .breadcrumb-item a:hover {
    color: var(--primary);
}

.article-header .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.7);
}

.article-header .breadcrumb-item + .breadcrumb-item::before {
    color: var(--gray);
}

.article-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.article-badge.html { background: var(--html-color); }
.article-badge.css { background: var(--css-color); }
.article-badge.js { background: #b8a900; }
.article-badge.python { background: var(--python-color); }
.article-badge.react { background: #00a0c4; }
.article-badge.node { background: var(--node-color); }

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-excerpt {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.author-info > div {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: white;
}

.author-role {
    font-size: 0.85rem;
    color: var(--gray);
}

.meta-details {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

/* Featured Image */
.article-featured-image {
    margin-top: -3rem;
    margin-bottom: 3rem;
}

.article-featured-image img {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Article Content */
.article-content {
    padding: 2rem 0 4rem;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.article-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 1.25rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 0.5rem;
}

.article-content code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.article-content pre {
    background: #282c34;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
    color: #abb2bf;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Table of Contents */
.toc-card {
    background: var(--light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary);
}

.toc-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.toc-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-card li {
    margin-bottom: 0.5rem;
}

.toc-card a {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.toc-card a::before {
    content: '→';
    margin-right: 0.5rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.toc-card a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

.toc-card a:hover::before {
    opacity: 1;
}

/* Info/Warning/Tip Boxes */
.info-box,
.warning-box,
.tip-box {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.info-box {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary);
}

.info-box i {
    color: var(--primary);
    font-size: 1.25rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
}

.warning-box i {
    color: #f59e0b;
    font-size: 1.25rem;
}

.tip-box {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10b981;
}

.tip-box i {
    color: #10b981;
    font-size: 1.25rem;
}

.info-box strong,
.warning-box strong,
.tip-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

.info-box p,
.warning-box p,
.tip-box p {
    margin: 0;
    font-size: 0.95rem;
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 3rem;
}

.tags-label {
    font-weight: 600;
    color: var(--dark);
    margin-right: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--light);
    color: var(--gray);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    color: white;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.share-buttons span {
    font-weight: 600;
    color: var(--dark);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    text-decoration: none;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #1877f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.copy { background: var(--gray); }

/* Author Card */
.author-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--light);
    border-radius: 16px;
    margin: 2rem 0;
}

.author-card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-card-info h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.author-card-info p {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 1rem;
}

.author-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    color: var(--dark);
    margin-right: 0.5rem;
    transition: all 0.2s;
}

.author-social a:hover {
    background: var(--primary);
    color: white;
}

/* Article Navigation */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.nav-prev,
.nav-next {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-prev:hover,
.nav-next:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.1);
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.nav-title {
    font-weight: 600;
    color: var(--dark);
}

/* Comments Section */
.comments-section {
    background: white;
}

.comment-form {
    background: var(--light);
    padding: 1.5rem;
    border-radius: 12px;
}

.comment-form h5 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.comment-form .form-control {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.comment-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.comments-list {
    margin-top: 2rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment:last-child {
    border-bottom: none;
}

.comment.reply {
    margin-left: 3rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
    border-bottom: none;
}

.comment-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--dark);
}

.author-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-weight: 500;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--gray);
}

.comment-body p {
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.75rem;
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
}

.comment-actions .btn {
    font-size: 0.85rem;
    color: var(--gray);
    padding: 0.25rem 0.75rem;
}

.comment-actions .btn:hover {
    background: var(--light);
    color: var(--primary);
}

/* Related Articles */
.related-articles .tutorial-card {
    animation: none;
}

/* Responsive Article Styles */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.75rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-details {
        gap: 1rem;
    }

    .article-navigation {
        grid-template-columns: 1fr;
    }

    .author-card {
        flex-direction: column;
        text-align: center;
    }

    .author-card-avatar {
        margin: 0 auto;
    }

    .comment.reply {
        margin-left: 1rem;
    }
}
