/* ==========================================================================
   i-Liquid.be - Clean & Consistent CSS
   ========================================================================== */

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F8F9FA;
    color: #2C3E50;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1 {
    color: #1F1F1F;
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    line-height: 1.3;
}

h2 {
    color: #1F1F1F;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

h3 {
    color: #2C3E50;
    font-size: 1.4rem;
    font-weight: 500;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

a {
    color: #0066CC;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0052A3;
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   Header
   ========================================================================== */
#header {
    background: linear-gradient(135deg, #23282B 0%, #1B1E1F 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

#header .section1 {
    height: 70px;
    background: #23282B;
    border-bottom: 1px solid #2F3538;
}

#header .section2 {
    height: 70px;
    background: #1B1E1F;
    display: flex;
    align-items: center;
}

#header .menu {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

#header .menu a {
    color: #bebebe;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#header .menu a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.logo-position {
    position: absolute;
    top: -25px;
    left: 20px;
    z-index: 101;
}

/* ==========================================================================
   Main Content Area - Expanded Width
   ========================================================================== */
#main {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* Single column layout for pages without sidebar */
#main.single-column {
    grid-template-columns: 1fr;
    max-width: 1000px;
}

/* ==========================================================================
   Content Areas
   ========================================================================== */
.content-main {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    min-height: 600px;
}

.content-sidebar {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    height: fit-content;
    order: 2;
}

/* Standardized Latest Tutorials Section */
.standardized-tutorials {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.standardized-tutorials #panelPopular h3 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #007bff;
}

.standardized-tutorials table {
    width: 100%;
    border-collapse: collapse;
}

.standardized-tutorials table td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #e9ecef;
}

.standardized-tutorials table td:first-child {
    width: 60px;
    text-align: center;
}

.standardized-tutorials table img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.standardized-tutorials .listedestuto_titre a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
}

.standardized-tutorials .listedestuto_titre a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.standardized-tutorials .listedestuto_desc {
    color: #666;
    font-size: 0.85rem;
    margin: 0.25rem 0;
    line-height: 1.4;
}

.standardized-tutorials .listedestuto_info {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Force sidebar to bottom on all pages */
.content-main {
    order: 1;
}

/* ==========================================================================
   Tutorial Cards
   ========================================================================== */
.tutorial-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.tutorial-card h2 {
    margin: 0 0 12px 0;
    font-size: 1.5rem;
}

.tutorial-card p {
    color: #6C757D;
    margin: 0 0 16px 0;
}

.tutorial-card .meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #6C757D;
    margin: 16px 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-menu {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: #0066CC;
    color: white;
}

.btn-primary:hover {
    background: #0052A3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
    text-decoration: none;
}

.btn-secondary {
    background: #6C757D;
    color: white;
}

.btn-secondary:hover {
    background: #545B62;
    text-decoration: none;
}

/* ==========================================================================
   Difficulty Badges
   ========================================================================== */
.difficulty-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty-beginner {
    background: #D4EDDA;
    color: #155724;
}

.difficulty-intermediate {
    background: #FFF3CD;
    color: #856404;
}

.difficulty-advanced {
    background: #F8D7DA;
    color: #721C24;
}

/* ==========================================================================
   Tutorial List Sidebar - Consistent Bottom Placement
   ========================================================================== */
#panelPopular {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    margin-top: 24px;
}

#panelPopular h3 {
    color: #1F1F1F;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #E9ECEF;
    text-align: center;
}

#panelPopular table {
    width: 100%;
    border-collapse: collapse;
}

#panelPopular table td {
    padding: 12px 8px;
    vertical-align: top;
    border-bottom: 1px solid #F1F3F4;
}

#panelPopular table td:first-child {
    width: 60px;
    text-align: center;
}

#panelPopular table td img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 1px solid #E9ECEF;
}

.listedestuto_titre a {
    color: #1F1F1F;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.listedestuto_titre a:hover {
    color: #0066CC;
}

.listedestuto_desc {
    color: #6C757D;
    font-size: 13px;
    margin: 4px 0;
    line-height: 1.4;
}

.listedestuto_info {
    color: #6C757D;
    font-size: 12px;
    margin: 4px 0 0 0;
}

/* ==========================================================================
   News Section
   ========================================================================== */
.news-section {
    margin-top: 40px;
}

.news-section h2 {
    color: #1F1F1F;
    font-size: 1.8rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E9ECEF;
}

.news-item {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #E9ECEF;
}

.news-item h3 {
    color: #1F1F1F;
    font-size: 1.3rem;
    margin: 0 0 16px 0;
}

.news-item img {
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #E9ECEF;
}

/* ==========================================================================
   Video Containers
   ========================================================================== */
.video-center {
    text-align: center;
    margin: 20px 0;
}

.video-center iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Footer
   ========================================================================== */
#footer {
    background: #ffffff;
    border-top: 1px solid #E9ECEF;
    margin-top: 60px;
    padding: 40px 0;
    text-align: center;
    color: #6C757D;
}

#footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

#footer a {
    color: #6C757D;
    text-decoration: none;
}

#footer a:hover {
    color: #0066CC;
    text-decoration: underline;
}

#footer hr {
    border: none;
    height: 1px;
    background: #E9ECEF;
    margin: 20px 0;
}

/* ==========================================================================
   Menu Page Specific Styles
   ========================================================================== */
.menu-page .tutorial-card {
    text-align: center;
    padding: 40px 24px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-page .icon-mega {
    font-size: 60px;
    display: block;
    margin: 0 auto 20px auto;
    width: 100px;
    height: 100px;
    line-height: 100px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    border: 3px solid #dee2e6;
    transition: all 0.3s ease;
}

.menu-page .tutorial-card:hover .icon-mega {
    transform: scale(1.1);
    border-color: #0066CC;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

/* ==========================================================================
   Tutorial Page Specific Styles
   ========================================================================== */
.tutorial-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    margin-bottom: 40px;
}

.tutorial-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #E9ECEF;
}

.tutorial-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1F1F1F;
    margin-bottom: 16px;
    line-height: 1.2;
}

.tutorial-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F8F9FA;
    border-radius: 20px;
    font-size: 14px;
    color: #6C757D;
}

.step-container {
    margin-bottom: 32px;
    padding: 24px;
    background: #F8F9FA;
    border-radius: 12px;
    border-left: 4px solid #0066CC;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.step-number {
    background: #0066CC;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1F1F1F;
    margin: 0;
}

.step-content {
    font-size: 16px;
    line-height: 1.7;
    color: #2C3E50;
}

.tutorial-image {
    margin: 24px 0;
    text-align: center;
}

.tutorial-image img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #E9ECEF;
}

.image-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #6C757D;
    font-style: italic;
}

/* ==========================================================================
   Sidebar Placement - Always at Bottom
   ========================================================================== */
.sidebar-modern {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #E9ECEF;
    margin-top: 40px;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1F1F1F;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E9ECEF;
    text-align: center;
}

.related-tutorial {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    border-bottom: 1px solid #F1F3F4;
}

.related-tutorial:hover {
    background: #F8F9FA;
    transform: translateX(4px);
}

.related-tutorial img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #E9ECEF;
}

.related-content h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1F1F1F;
}

.related-content h4 a {
    color: #1F1F1F;
    text-decoration: none;
}

.related-content h4 a:hover {
    color: #0066CC;
}

.related-content p {
    margin: 0;
    font-size: 13px;
    color: #6C757D;
    line-height: 1.4;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-center {
    text-align: center;
}

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

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.clear-both {
    clear: both;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    #header .menu {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }
    
    #header .section2 {
        height: auto;
        padding: 16px 0;
    }
    
    .logo-position {
        position: static;
        margin: 16px auto;
        display: block;
    }
    
    #main {
        grid-template-columns: 1fr;
        gap: 24px;
        margin: 16px auto;
        padding: 0 16px;
    }
    
    .content-main,
    .content-sidebar {
        padding: 20px;
    }
    
    .tutorial-container {
        padding: 24px 20px;
    }
    
    .tutorial-title {
        font-size: 2rem;
    }
    
    .tutorial-meta {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .step-container {
        padding: 20px 16px;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .grid-2,
    .grid-3,
    .grid-menu {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .video-center iframe {
        width: 100%;
        height: 200px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #main {
        grid-template-columns: 1fr 320px;
        gap: 30px;
    }
    
    .grid-menu {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .grid-menu {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    #header,
    #footer,
    .content-sidebar,
    .btn {
        display: none;
    }
    
    #main {
        grid-template-columns: 1fr;
        max-width: none;
        margin: 0;
        padding: 0;
    }
    
    .content-main,
    .tutorial-container {
        box-shadow: none;
        border: 1px solid #ccc;
        padding: 20px;
    }
    
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}
