/**
 * ITX Beginner Section Styles - Bybit Inspired Light Theme
 * ForTraders.org - Modern flat 2D design
 * Version: 1.0.0
 */

/* ========================================
   CSS VARIABLES - Bybit Light Theme
======================================== */

:root {
    --itx-orange: #F7A600;
    --itx-orange-grad: #FFD748;
    --itx-bg-light: #ffffff;
    --itx-bg-secondary: #f8f9fa;
    --itx-border: #e2e8f0;
    --itx-border-hover: #cbd5e1;
    --itx-text-dark: #1e293b;
    --itx-text-muted: #64748b;
    --itx-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --itx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --itx-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --itx-radius-sm: 8px;
    --itx-radius-md: 12px;
    --itx-radius-lg: 16px;
}

/* ========================================
   MAIN SECTION CONTAINER
======================================== */

.itx-beginner-section {
    background: var(--itx-bg-light);
    border-radius: var(--itx-radius-md);
    padding: 16px;
    margin: 28px 0;
    box-shadow: var(--itx-shadow-sm);
    border: 1px solid var(--itx-border);
    position: relative;
    overflow: hidden;
}

.itx-beginner-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--itx-orange), var(--itx-orange-grad));
    border-radius: var(--itx-radius-lg) var(--itx-radius-lg) 0 0;
}

/* ========================================
   SECTION HEADER
======================================== */

.itx-beginner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--itx-border);
}

.itx-beginner-title {
    font-size: 30px;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    color: var(--itx-text-dark);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.itx-beginner-nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.itx-beginner-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--itx-border);
    background: var(--itx-bg-light);
    color: var(--itx-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.itx-beginner-nav-btn:hover {
    background: var(--itx-bg-secondary);
    border-color: var(--itx-orange);
    color: var(--itx-orange);
    transform: translateY(-1px);
    box-shadow: var(--itx-shadow-sm);
}

/* ========================================
   HERO POST (Featured)
======================================== */

.itx-beginner-hero {
    margin-bottom: 16px;
    border-radius: var(--itx-radius-sm);
    overflow: hidden;
    background: var(--itx-bg-secondary);
    border: 1px solid var(--itx-border);
    transition: all 0.3s ease;
    position: relative;
}

.itx-beginner-hero:hover {
    box-shadow: var(--itx-shadow-lg);
    transform: translateY(-2px);
    border-color: var(--itx-orange);
}

.itx-beginner-hero-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.itx-beginner-hero-image,
.itx-beginner-hero img {
    width: 100%;
    aspect-ratio: 2.5 / 1;
    object-fit: cover;
    object-position: center center;
    display: block;
    background: var(--itx-bg-secondary);
    filter: brightness(0.7) saturate(0.9);
    transition: filter 0.3s ease;
}

.itx-beginner-hero:hover .itx-beginner-hero-image,
.itx-beginner-hero:hover img {
    filter: brightness(0.65) saturate(0.85);
}

.itx-beginner-hero img {
    height: auto;
}

/* Overlay для уменьшения отвлекающего эффекта - Best Practices 2025 */
.itx-beginner-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.75) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.itx-beginner-hero:hover .itx-beginner-hero-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0.85) 70%,
        rgba(0, 0, 0, 0.95) 100%
    );
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.itx-beginner-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: transparent;
    z-index: 2;
}

.itx-beginner-hero-title,
.itx-beginner-hero-content .itx-beginner-hero-title,
.itx-beginner-hero-link .itx-beginner-hero-title,
h4.itx-beginner-hero-title {
    font-size: 32px;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 700;
    color: #ffffff !important;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.itx-beginner-hero-link:hover .itx-beginner-hero-title,
.itx-beginner-hero:hover .itx-beginner-hero-title {
    color: #ffffff !important;
}

.itx-beginner-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #ffffff !important;
    text-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.95),
        0 1px 4px rgba(0, 0, 0, 0.8),
        0 0 1px rgba(0, 0, 0, 0.7);
}

.itx-beginner-hero-meta * {
    color: #ffffff !important;
}

.itx-beginner-hero-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.itx-beginner-hero-comments {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   GRID POSTS
======================================== */

.itx-beginner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.itx-beginner-post {
    background: var(--itx-bg-light);
    border: 1px solid var(--itx-border);
    border-radius: var(--itx-radius-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.itx-beginner-post:hover {
    box-shadow: var(--itx-shadow-md);
    transform: translateY(-2px);
    border-color: var(--itx-orange);
}

.itx-beginner-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.itx-beginner-post-image,
.itx-beginner-post img {
    width: 100%;
    aspect-ratio: 1.73 / 1; /* Соответствует размеру 346x200 */
    object-fit: cover;
    object-position: center center;
    display: block;
    background: var(--itx-bg-secondary);
    filter: brightness(0.75) saturate(0.9);
    transition: filter 0.3s ease;
}

.itx-beginner-post:hover .itx-beginner-post-image,
.itx-beginner-post:hover img {
    filter: brightness(0.7) saturate(0.85);
}

.itx-beginner-post img {
    height: auto;
}

/* Overlay для grid постов - Best Practices 2025 */
.itx-beginner-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.5) 60%,
        rgba(0, 0, 0, 0.8) 85%,
        rgba(0, 0, 0, 0.95) 100%
    );
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
    z-index: 1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.itx-beginner-post:hover .itx-beginner-post-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.9) 85%,
        rgba(0, 0, 0, 0.98) 100%
    );
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.itx-beginner-post-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: transparent;
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.itx-beginner-post-title {
    font-size: 28px;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 0 6px 0;
    line-height: 1.4;
    flex: 1;
}

.itx-beginner-post-link:hover .itx-beginner-post-title {
    color: #ffffff !important;
}

.itx-beginner-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 22px;
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #ffffff !important;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    text-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.95),
        0 1px 3px rgba(0, 0, 0, 0.8),
        0 0 1px rgba(0, 0, 0, 0.7);
}

.itx-beginner-post-meta * {
    color: #ffffff !important;
}

.itx-beginner-post-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.itx-beginner-post-comments {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========================================
   LOAD MORE BUTTON
======================================== */

.itx-beginner-load-more {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.itx-beginner-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--itx-bg-light);
    background: linear-gradient(135deg, var(--itx-orange), var(--itx-orange-grad));
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(247, 166, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.itx-beginner-load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.itx-beginner-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(247, 166, 0, 0.3);
}

.itx-beginner-load-more-btn:hover::before {
    left: 100%;
}

.itx-beginner-load-more-btn:active {
    transform: translateY(0);
}

.itx-beginner-load-more-btn[data-loading="true"] {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.itx-beginner-load-more-btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.itx-beginner-load-more-btn:hover .itx-beginner-load-more-btn-icon {
    transform: translateX(4px);
}

/* ========================================
   LOADER
======================================== */

.itx-beginner-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.itx-beginner-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--itx-border);
    border-top-color: var(--itx-orange);
    border-radius: 50%;
    animation: itx-spin 0.8s linear infinite;
}

@keyframes itx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 768px) {
    .itx-beginner-section {
        padding: 12px;
        margin: 20px 0;
    }
    
    .itx-beginner-title {
        font-size: 28px;
    }
    
    .itx-beginner-hero-image {
        aspect-ratio: 2.5 / 1;
    }
    
    .itx-beginner-hero-title {
        font-size: 24px;
    }
    
    .itx-beginner-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .itx-beginner-post-image {
        aspect-ratio: 1.73 / 1;
    }
    
    .itx-beginner-nav {
        gap: 4px;
    }
    
    .itx-beginner-nav-btn {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .itx-beginner-section {
        padding: 10px;
    }
    
    .itx-beginner-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .itx-beginner-hero-image {
        aspect-ratio: 2.5 / 1;
    }
    
    .itx-beginner-hero-content {
        padding: 10px;
    }
    
    .itx-beginner-post-content {
        padding: 8px;
    }
}

