/* Modern Tutorial Page Styles */
.tutorial-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.tutorial-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #E8F4FD;
}

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

.tutorial-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #F7FAFC;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #4A5568;
}

.difficulty-easy { 
    background: #C6F6D5; 
    color: #22543D; 
}

.difficulty-medium { 
    background: #FEEBC8; 
    color: #C05621; 
}

.difficulty-hard { 
    background: #FED7D7; 
    color: #C53030; 
}

.tutorial-content {
    line-height: 1.8;
    color: #2D3748;
}

/* Tutorial intro paragraph */
.tutorial-intro {
    font-size: 1.1rem;
    color: #4A5568;
    text-align: center;
    margin-bottom: 2rem;
}

.step-container {
    margin-bottom: 3rem;
    padding: 2rem;
    background: #F8FAFC;
    border-radius: 12px;
    border-left: 4px solid #3182CE;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

.step-title {
    color: #2D3748;
    font-size: 1.5rem;
    margin: 0;
}

.step-content {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tutorial-image {
    margin: 2rem 0;
    text-align: center;
}

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

.image-caption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #718096;
    font-style: italic;
    display: none; /* Hide generic captions */
}

/* Image error placeholder */
.image-error {
    display: none;
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    background: #f9f9f9;
    margin: 10px 0;
}

.image-error-title {
    color: #666;
    margin: 0;
    font-weight: bold;
}

.image-error-subtitle {
    color: #999;
    font-size: 12px;
    margin: 5px 0 0 0;
}

.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #E8F4FD;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #3182CE;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.nav-button:hover {
    background: #2C5AA0;
    color: white;
}

.tutorial-info {
    background: #EBF8FF;
    border: 1px solid #BEE3F8;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.tutorial-info h3 {
    color: #2B6CB0;
    margin-top: 0;
}

/* Sidebar styles */
.sidebar-modern {
    width: 300px;
    float: right;
    margin-left: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
}

.sidebar-title {
    color: #2d3748;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.related-tutorial {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-tutorial img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    flex-shrink: 0;
}

.related-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.related-content h4 a {
    color: #3182ce;
    text-decoration: none;
}

.related-content h4 a:hover {
    text-decoration: underline;
}

.related-content p {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #718096;
}

/* Logo positioning fix */
.logo-position {
    position: absolute;
    margin-top: -68px;
}

/* Search functionality styles */
.search-container {
    margin: 20px 0;
    position: relative;
}

.search-box {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
}

#tutorial-search {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#tutorial-search:focus {
    border-color: #3182ce;
}

#search-btn {
    padding: 12px 16px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#search-btn:hover {
    background: #2c5aa0;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 16px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background: #f7fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
}

.search-result-description {
    color: #718096;
    font-size: 14px;
    margin-bottom: 8px;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.search-result-difficulty {
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
    color: #4a5568;
}

.search-result-category {
    color: #3182ce;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #718096;
}

/* Tutorial cards for category pages */
.tutorial-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.tutorial-card h2 {
    color: #2D3748;
    margin-bottom: 1rem;
}

.tutorial-card p {
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tutorial-card .meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.difficulty-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.difficulty-beginner {
    background: #C6F6D5;
    color: #22543D;
}

.difficulty-intermediate {
    background: #FEEBC8;
    color: #C05621;
}

.difficulty-advanced {
    background: #FED7D7;
    color: #C53030;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #3182CE;
    color: white;
}

.btn-primary:hover {
    background: #2C5AA0;
    color: white;
}

.btn-secondary {
    background: #E2E8F0;
    color: #4A5568;
}

.btn-secondary:hover {
    background: #CBD5E0;
    color: #2D3748;
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 2rem;
}

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

.icon-mega {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .tutorial-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .tutorial-title {
        font-size: 2rem;
    }
    
    .tutorial-meta {
        gap: 1rem;
    }
    
    .step-container {
        padding: 1.5rem;
    }
    
    .tutorial-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .grid-menu {
        grid-template-columns: 1fr;
    }
    
    .sidebar-modern {
        width: 100%;
        float: none;
        margin-left: 0;
        margin-top: 2rem;
    }
}

/* Print styles */
@media print {
    .tutorial-navigation,
    .search-container,
    #header,
    #footer,
    .sidebar-modern {
        display: none;
    }
    
    .tutorial-container {
        box-shadow: none;
        margin: 0;
        padding: 1rem;
    }
    
    .step-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

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

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

#latest-tutorials-section table {
    width: 100%;
    border-collapse: collapse;
}

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

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

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

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

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

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

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

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

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

#latest-tutorials-section table {
    width: 100%;
    border-collapse: collapse;
}

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

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

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

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

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

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #latest-tutorials-section {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    #latest-tutorials-section table td {
        padding: 0.5rem;
    }
    
    #latest-tutorials-section table td:first-child {
        width: 50px;
    }
    
    #latest-tutorials-section table img {
        max-width: 40px;
    }
}

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

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

#latest-tutorials-section table {
    width: 100%;
    border-collapse: collapse;
}

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

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

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

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

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

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #latest-tutorials-section {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    #latest-tutorials-section table td {
        padding: 0.5rem;
    }
    
    #latest-tutorials-section table td:first-child {
        width: 50px;
    }
    
    #latest-tutorials-section table img {
        max-width: 40px;
    }
}