/* 
 * Telugu Aksharalu - Main Stylesheet
 * Design: Modern, Mobile-First, SEO-Ready
 */

:root {
    --primary: #1e40af;
    --primary-hover: #1e3a8a;
    --secondary: #f97316;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.3s ease;
}

html,
body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

.english-font,
.english {
    font-family: 'Poppins', sans-serif;
}

.telugu-font,
.telugu {
    font-family: 'Ramabhadra', sans-serif !important;
    font-weight: 500;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Category Sections */
.grid-section {
    margin-top: 4rem;
}

.section-title {
    text-align: center;
    color: var(--text-main);
    margin-bottom: 3rem;
    font-size: clamp(2rem, 8vw, 4rem);
    line-height: 1.2;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    padding: 0 10px;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin-top: 5px;
}

.section-title span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
}

/* Letters Grid */
/* Letters Grid */
.letters-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Mobile: 2 columns */
    gap: 12px;
}

/* Tablet: 3 columns */
@media (min-width: 600px) {
    .letters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 5 columns */
@media (min-width: 1024px) {
    .letters-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
}

.letter-box {
    background: var(--white);
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    overflow: hidden;
}

.letter-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.letter-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: var(--primary);
    background: var(--white);
}

.letter-box:hover .telugu {
    color: var(--primary);
    transform: scale(1.1);
}

.letter-box .telugu {
    transition: transform 0.3s ease;
    margin-bottom: 5px;
}

.letter-box .telugu {
    font-size: 3.5rem;
}

.letter-box .english {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Header & Nav Redesign - Professional & Beautiful */
.site-header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(30px);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    padding: 0.65rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(30, 64, 175, 0.15);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: visible;
    /* Prevent accidental scrollbars */
}

/* Logo Styles */
.navbar-brand {
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    color: white;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-family: 'Ramabhadra', sans-serif;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.35);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    transition: all 0.6s;
}

.navbar-brand:hover .logo-icon {
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.4);
}

.navbar-brand:hover .logo-icon::before {
    left: 100%;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.navbar-brand:hover .logo-text {
    letter-spacing: 0px;
}

/* Desktop Menu */
.desktop-menu {
    display: none;
    /* Hidden on mobile */
    list-style: none;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 10px 0;
    letter-spacing: 0.3px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-link.active {
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1002;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.mobile-toggle:hover {
    background: rgba(30, 64, 175, 0.05);
}

.bar-top,
.bar-mid,
.bar-bot {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 10px;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hamburger Animation to X */
.mobile-toggle.active .bar-top {
    transform: translateY(8.5px) rotate(45deg);
    background: var(--text-main);
}

.mobile-toggle.active .bar-mid {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-toggle.active .bar-bot {
    transform: translateY(-8.5px) rotate(-45deg);
    background: var(--text-main);
}

/* Mobile Drawer (Slider) - Enhanced */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100dvh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    z-index: 1001;
    transition: all 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95) translateY(-20px);
}

.mobile-drawer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(30, 64, 175, 0.05), transparent 70%);
    pointer-events: none;
}

.mobile-drawer::-webkit-scrollbar {
    display: none;
}

.mobile-drawer.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.drawer-header {
    position: absolute;
    top: 5rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.logo-iconSmall {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-family: 'Ramabhadra', sans-serif;
    font-size: 1rem;
}

.drawer-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

.mobile-nav-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    overflow-x: hidden !important;
    margin-top: 8rem !important;
}

.mobile-nav-link {
    text-decoration: none !important;
    color: var(--text-main) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 0.8rem 1rem !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
    background: transparent !important;
    opacity: 0;
    transform: translateX(-20px);
    width: 100% !important;
    text-align: left !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 12px;
    position: relative;
}

.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.08), rgba(59, 130, 246, 0.08));
    border-radius: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.mobile-drawer.active .mobile-nav-link {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav-link:hover::before,
.mobile-nav-link.active::before {
    width: 100%;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--primary);
    transform: translateX(0) scale(1.05);
}

.mobile-nav-link.active {
    font-weight: 800;
}

/* Hero Section */
.hero {
    padding: 5rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-bottom: none;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    font-size: clamp(2.2rem, 10vw, 3.8rem);
    font-weight: 500;
    color: var(--white);
    margin-bottom: 1.5rem;
    line-height: 1.25;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0 15px;
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Ad Containers */
.ad-container {
    text-align: center;
    margin: 30px 0;
}

.ad-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Global Content Grid - Responsive Columns */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile: 1 column */
    gap: 25px;
}



/* Desktop: 3 columns starting at 1024px */
@media (min-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Specific Adjustments */
@media (min-width: 1024px) {
    .desktop-menu {
        display: flex;
    }

    .mobile-toggle {
        display: none;
    }

    .site-header {
        padding: 1rem 0;
    }

    .hero h1 {
        font-size: 4rem;
    }

    .main-layout {
        display: grid !important;
        grid-template-columns: 1fr 300px !important;
        gap: 40px !important;
    }
}

/* Body Overlay when menu open */
body.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
}

/* Drawer Item Animations */
.mobile-drawer.active .mobile-nav-links li {
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.mobile-nav-links li:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-nav-links li:nth-child(2) {
    animation-delay: 0.15s;
}

.mobile-nav-links li:nth-child(3) {
    animation-delay: 0.2s;
}

.mobile-nav-links li:nth-child(4) {
    animation-delay: 0.25s;
}

.mobile-nav-links li:nth-child(5) {
    animation-delay: 0.3s;
}

.mobile-nav-links li:nth-child(6) {
    animation-delay: 0.35s;
}

/* ===========================
   Responsive Ad Containers
   =========================== */
.ad-responsive {
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-responsive[data-ad-size="mobile-banner"] {
    min-height: 50px;
    max-width: 320px;
}

.ad-responsive[data-ad-size="medium-rectangle"] {
    min-height: 250px;
    max-width: 300px;
}

.ad-responsive[data-ad-size="leaderboard"] {
    min-height: 90px;
    max-width: 728px;
}

.ad-responsive[data-ad-size="billboard"] {
    min-height: 90px;
    max-width: 970px;
}

.ad-responsive[data-ad-size="half-page"] {
    min-height: 600px;
    max-width: 300px;
}

/* ===========================
   Premium Footer Design
   =========================== */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #cbd5e1;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    border-top: 4px solid var(--primary);
}

.footer-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .footer-grid-premium {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.logo-icon-footer {
    background: var(--primary);
    color: white;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-family: 'Ramabhadra', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.footer-logo h3 {
    color: white;
    font-size: 1.3rem;
    margin: 0;
}

.footer-tagline {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-weight: bold;
    font-size: 1.1rem;
}

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-block;
    position: relative;
}

.footer-col a::before {
    content: '›';
    margin-right: 0.5rem;
    color: var(--primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
}

.footer-col a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

.footer-col a:hover {
    color: white;
    padding-left: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0.5rem 0;
}

.footer-credit {
    font-size: 0.85rem;
    opacity: 0.8;
    font-style: italic;
}

/* Guninthalu Grid in individual pages */
.gunintham-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}

.gunintham-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow);
}

.gunintham-item .char {
    display: block;
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 5px;
}

.gunintham-item .combo {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.gunintham-item .pron {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 5px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.example-card {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--secondary);
}

.example-card .te {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 5px;
}

.example-card .en {
    font-weight: 600;
    color: var(--primary);
}

/* Enhanced Mobile Responsiveness - Prevent Overflow */
.gunintham-grid,
.example-grid {
    max-width: 100%;
    overflow-x: hidden;
}

.gunintham-item,
.example-card {
    max-width: 100%;
    word-wrap: break-word;
}

/* Responsive Grid Adjustments for Small Screens */
@media (max-width: 640px) {
    .gunintham-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .example-grid {
        grid-template-columns: 1fr;
    }

    .gunintham-item {
        padding: 1rem;
    }

    .gunintham-item .char {
        font-size: 1.8rem;
    }
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.breadcrumbs a:hover {
    color: var(--primary) !important;
    text-decoration: underline !important;
}

/* Global Info Cards & Deep Content Sections */
.deep-content-section {
    margin-top: 6rem;
    border-top: 1px solid var(--border);
    padding-top: 4rem;
    padding-bottom: 6rem;
}

.info-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--primary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
}

.info-card p {
    margin-bottom: 1.2rem;
    color: #475569;
    line-height: 1.8;
    font-size: 1rem;
    text-align: justify;
}

.info-card strong {
    color: var(--text-main);
}

.info-card em {
    color: var(--secondary);
}

.info-card .english {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}