/**
 * Homepage Redesign - Coding Seven Scribes
 * Clean, minimal, developer-friendly
 * Inspired by GeeksforGeeks, W3Schools, CodeWithHarry
 */

/* ── Hero Section ── */
.hero-section {
    padding: 64px 0 72px;
    background: linear-gradient(135deg, var(--primary-color, #3498db) 0%, var(--secondary-color, #2ecc71) 100%);
    position: relative;
    overflow: hidden;
    color: #fff;
    text-align: center;
}

/* Subtle code-grid background pattern */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: 0;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-badge svg {
    width: 13px;
    height: 13px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    text-shadow: none;
}

.hero-title span {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 6px;
    letter-spacing: 0;
}

.hero-description {
    font-size: 1.08rem;
    color: rgba(255,255,255,0.88);
    margin-bottom: 32px;
    line-height: 1.7;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: none;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
    min-width: 0;
}

.hero-button.primary {
    background: #fff;
    color: var(--primary-color);
}

.hero-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    color: var(--primary-color);
}

.hero-button.secondary {
    background: rgba(255,255,255,0.18);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    backdrop-filter: blur(8px);
}

.hero-button.secondary:hover {
    background: rgba(255,255,255,0.28);
    transform: translateY(-2px);
    color: #fff;
}

/* Hero Stats Strip */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 14px 24px;
    max-width: 560px;
    margin: 0 auto;
}

.hero-stat {
    flex: 1;
    text-align: center;
    padding: 0 16px;
}

.hero-stat + .hero-stat {
    border-left: 1px solid rgba(255,255,255,0.25);
}

.hero-stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 3px;
}

.hero-stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Floating shapes */
.shape { position: absolute; z-index: 1; border-radius: 50%; }
.shape-1 {
    top: 12%;
    left: 4%;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.07);
    animation: hfloat 7s ease-in-out infinite;
}
.shape-2 {
    top: 55%;
    right: 5%;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
    animation: hfloat 9s ease-in-out infinite 1s;
}
.shape-3 {
    bottom: 18%;
    left: 7%;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    animation: hfloat 8s ease-in-out infinite 2s;
}

@keyframes hfloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-16px) rotate(5deg); }
}

/* ── Category Topics Bar ── */
.topics-bar {
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    overflow: hidden;
}

.topics-bar .container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    padding: 0 20px;
}

.topics-bar .container::-webkit-scrollbar { display: none; }

.topic-tab {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 14px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.18s, border-color 0.18s;
    flex-shrink: 0;
    opacity: 0.75;
}

.topic-tab:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    opacity: 1;
}

.topic-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
    opacity: 1;
}

.topic-tab-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ── Section Headers ── */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-heading-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-heading-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-heading-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
    stroke: #fff;
}

.section-heading-text h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 2px;
    line-height: 1.2;
}

.section-heading-text p {
    font-size: 0.84rem;
    color: var(--text-color);
    opacity: 0.6;
    margin: 0;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid rgba(52,152,219,0.3);
    border-radius: 7px;
    transition: background 0.18s, border-color 0.18s;
    white-space: nowrap;
}

.view-all-link:hover {
    background: rgba(52,152,219,0.07);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-all-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.18s;
}

.view-all-link:hover svg {
    transform: translateX(3px);
}

/* ── Language Cards Grid ── */
.languages-sections-wrapper {
    padding: 0;
    background-color: var(--background-color);
}

/* New grid-based language section */
.lang-grid-section {
    padding: 56px 0;
    background-color: var(--background-color);
}

.lang-grid-section.alt-bg {
    background-color: var(--card-bg-color);
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ── Language Card ── */
.lang-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 22px 20px;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}

.lang-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.2s;
}

.lang-card:hover {
    border-color: rgba(52,152,219,0.35);
    box-shadow: 0 4px 18px rgba(52,152,219,0.1);
    transform: translateY(-3px);
    color: var(--text-color);
}

.lang-card:hover::before {
    opacity: 1;
}

body.dark-theme .lang-card {
    background: var(--card-background);
}

.lang-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lang-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: rgba(52,152,219,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    overflow: hidden;
}

.lang-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.lang-card-meta {
    flex: 1;
}

.lang-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 3px;
    line-height: 1.2;
}

.lang-card-count {
    font-size: 0.78rem;
    color: var(--primary-color);
    font-weight: 600;
    opacity: 0.85;
}

.lang-card-desc {
    font-size: 0.86rem;
    color: var(--text-color);
    opacity: 0.7;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.lang-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.lang-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 6px 12px;
    border: 1px solid rgba(52,152,219,0.3);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.lang-card-btn:hover {
    background: rgba(52,152,219,0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.lang-card-btn.watch {
    color: #e53935;
    border-color: rgba(229,57,53,0.25);
}

.lang-card-btn.watch:hover {
    background: rgba(229,57,53,0.06);
    border-color: #e53935;
}

.lang-card-btn svg {
    width: 13px;
    height: 13px;
}

/* ── Old language-full-section (keep working but simplify) ── */
.language-full-section {
    padding: 52px 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-color);
    position: relative;
}

.language-full-section:last-child { border-bottom: none; }

.language-full-section.alt-bg,
.language-full-section:nth-child(even) {
    background-color: var(--card-bg-color);
}

.language-section-background { display: none; }

.language-section-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 48px;
    align-items: center;
}

.language-full-section.reverse .language-section-content {
    grid-template-columns: 380px 1fr;
}

.language-full-section.reverse .language-section-text {
    order: 2;
}

.language-full-section.reverse .language-section-image {
    order: 1;
}

.language-section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

.language-section-subtitle {
    font-size: 1rem;
    color: var(--text-color);
    opacity: 0.72;
    line-height: 1.65;
    margin-bottom: 28px;
    max-width: 480px;
}

.language-section-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.language-section-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.language-section-button.primary {
    background: var(--primary-color);
    color: #fff;
}

.language-section-button.primary:hover {
    background: var(--link-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(52,152,219,0.28);
    color: #fff;
}

.language-section-button.secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.language-section-button.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.language-section-button svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.language-section-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.language-image-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    background: var(--card-bg-color);
}

.language-image-wrapper img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.language-image-wrapper:hover img {
    transform: scale(1.03);
}

/* ── Quick Access / Shortcut Tiles ── */
.quick-access-section {
    padding: 48px 0;
    background-color: var(--card-bg-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.quick-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.quick-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.quick-tile:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(52,152,219,0.1);
    transform: translateY(-2px);
    color: var(--text-color);
}

.quick-tile-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.quick-tile-text strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 2px;
}

.quick-tile-text span {
    font-size: 0.78rem;
    color: var(--text-color);
    opacity: 0.55;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .hero-title { font-size: 2.2rem; }
    .hero-description { font-size: 1rem; }
    .hero-stats { max-width: 100%; padding: 12px 16px; }
    .hero-stat-number { font-size: 1.25rem; }

    .language-section-content {
        grid-template-columns: 1fr !important;
        gap: 28px;
    }

    .language-full-section.reverse .language-section-text { order: 1; }
    .language-full-section.reverse .language-section-image { order: 2; }

    .language-image-wrapper img { height: 200px; }
    .language-section-title { font-size: 1.65rem; }

    .quick-tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

@media (max-width: 767px) {
    .hero-section { padding: 44px 0 52px; }
    .hero-title { font-size: 1.85rem; }
    .hero-title span { font-size: 1.1rem; }
    .hero-description { font-size: 0.95rem; }
    .hero-buttons { gap: 10px; }
    .hero-button { padding: 10px 18px; font-size: 0.9rem; }
    .hero-stats { flex-wrap: wrap; border-radius: 8px; padding: 12px; }
    .hero-stat { flex: 0 0 50%; padding: 8px 12px; }
    .hero-stat + .hero-stat { border-left: none; }
    .hero-stat:nth-child(2) { border-left: 1px solid rgba(255,255,255,0.25); }
    .hero-stat:nth-child(3),
    .hero-stat:nth-child(4) { border-top: 1px solid rgba(255,255,255,0.2); }

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

    .language-section-title { font-size: 1.45rem; }
    .language-full-section { padding: 36px 0; }

    .section-heading-text h2 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.55rem; }
    .hero-buttons { flex-direction: column; align-items: stretch; }
    .hero-button { justify-content: center; }
    .hero-stat { flex: 0 0 100%; border-left: none !important; border-top: 1px solid rgba(255,255,255,0.2); }
    .hero-stat:first-child { border-top: none; }

    .quick-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
    .quick-tile { padding: 12px 14px; }
    .quick-tile-icon { font-size: 1.3rem; }
    .quick-tile-text strong { font-size: 0.85rem; }
}
