/*
Theme Name: Naat Academy Web
Theme URI: https://naatacademy.org
Author: Owais Razvi Siddiqui
Author URI: https://naatacademy.org
Description: A professional, Islamic-themed WordPress theme for Naat, Hamd, and Manqabat collections. Exact replica of the provided design with Tailwind integration.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: naat-academy-Web
Tags: two-columns, right-sidebar, custom-colors, custom-menu, rtl-language-support, translation-ready, sticky-post
*/

/* ==========================================================================
   Custom Styles from Design
   ========================================================================== */

@font-face {
    font-family: 'NaatFont';
    src: url('https://res.cloudinary.com/awescreative/raw/upload/v1749150996/Awes/naatfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

html {
    font-size: 110%;
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f8fafc;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.urdu-text {
    font-family: 'NaatFont', serif;
    line-height: 1.8;
}

h1.urdu-text,
h2.urdu-text,
h3.urdu-text,
h4.urdu-text {
    line-height: 1.6 !important;
    padding-bottom: 0.2em;
    padding-top: 0.1em;
    display: inline-block;
    width: 100%;
}

.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.section-title-bar {
    position: relative;
    padding-right: 1rem;
}

.section-title-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 4px;
    border-radius: 99px;
}

.typo-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 1.0rem;
}

.book-cover {
    box-shadow:
        -2px 0 5px rgba(0, 0, 0, 0.1),
        inset 2px 0 5px rgba(255, 255, 255, 0.2),
        inset -2px 0 5px rgba(0, 0, 0, 0.1);
    background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 20%, rgba(0, 0, 0, 0.05) 100%);
}

.book-spine {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.1));
}

.book-3d-wrapper {
    perspective: 1000px;
}

.book-3d {
    transition: transform 0.4s ease;
    transform: rotateY(-10deg) translateX(5px);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.15), -1px 0 2px rgba(0, 0, 0, 0.1) inset;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.group:hover .book-3d {
    transform: rotateY(0deg) translateX(0) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.shine-edge {
    position: relative;
    overflow: hidden;
}

.shine-edge::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    opacity: 0.7;
}

.notification-slider {
    height: 24px;
    overflow: hidden;
    position: relative;
}

/* Modal Transitions */
#ai-modal,
#story-modal {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#ai-modal.hidden,
#story-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#ai-modal:not(.hidden),
#story-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#ai-modal:not(.hidden) .modal-content,
#story-modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.story-progress-bar {
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    flex: 1;
}

.story-progress-fill {
    height: 100%;
    background-color: white;
    width: 0%;
    transition: width 0.1s linear;
}

.story-progress-fill.active {
    width: 100%;
}

.gsc-control-cse {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Ensure admin bar doesn't break sticky header */
body.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}

/* ==========================================================================
   Single Naat Page Styles
   ========================================================================== */

/* Section Card */
.section-card {
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.8);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

/* ==========================================================================
   Clickable Card Pattern - Site-Wide
   ========================================================================== */

/* Base card - NO pointer by default */
.typo-card,
.section-card,
.card {
    cursor: default;
}

/* Clickable card - only with link */
.clickable-card {
    position: relative;
    transition: all 0.3s ease;
}

/* Only apply pointer when card has actual link */
.clickable-card:has(> .card-link),
a.clickable-card,
.clickable-card[data-href] {
    cursor: pointer;
}

/* Stretching link covers entire card */
.clickable-card>.card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Content inside card */
.clickable-card .card-content {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Re-enable pointer events for interactive elements inside */
.clickable-card .card-content a,
.clickable-card .card-content button,
.clickable-card .card-content input,
.clickable-card .card-content .clickable {
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

/* Dictionary Word - Dotted Underline */
.dict-word {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #10b981;
    text-underline-offset: 6px;
    cursor: help;
    transition: background-color 0.2s;
}

.dict-word:hover {
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
}

/* Mobile Bottom Nav */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.bottom-nav-item.active {
    color: #10b981;
}

.bottom-nav-item:hover {
    color: #059669;
}

/* Safe Bottom Padding for iOS */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Background Pattern */
.bg-mesh-green {
    background-color: #f0fdf4;
    background-image:
        radial-gradient(at 0% 0%, rgba(52, 211, 153, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(251, 191, 36, 0.05) 0px, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2310b981' fill-opacity='0.03' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
}

/* Nastaliq Typography Classes */
.text-nastaliq {
    font-family: 'NaatFont', 'Noto Naskh Arabic', serif;
    line-height: 1.8;
}

.text-nastaliq-lg {
    font-family: 'NaatFont', 'Noto Naskh Arabic', serif;
    line-height: 2.2;
}

.font-naskh {
    font-family: 'Noto Naskh Arabic', serif;
}

.font-sans-eng {
    font-family: 'Inter', 'Outfit', system-ui, sans-serif;
    direction: ltr;
}

/* Dictionary Modal Transitions */
#meaning-popup {
    transition: opacity 0.2s ease;
}

#meaning-popup.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#meaning-popup:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

#meaning-content {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Lyrics Content Adjustable Font */
.lyrics-content {
    --lyrics-font-size: 1.3rem;
    --lyrics-line-height: 2.2rem;
}

.lyrics-content p {
    font-size: var(--lyrics-font-size);
    line-height: var(--lyrics-line-height);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .lyrics-content {
        --lyrics-font-size: 1.1rem;
        --lyrics-line-height: 1.9rem;
    }
}

/* Scroll Smooth for Anchor Navigation */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   Enhanced Naat Single Page - Tab System & Typography
   ========================================================================== */

/* Tab Navigation Container */
.naat-tabs-nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.naat-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* Tab Button */
.naat-tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'NaatFont', serif;
}

.naat-tab-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #334155;
}

.naat-tab-btn.active {
    background: white;
    color: #047857;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.naat-tab-btn[data-tab="roman"] {
    font-family: 'Inter', 'Outfit', sans-serif;
    direction: ltr;
}

/* Tab Panel Container */
.naat-tabs-content {
    position: relative;
    min-height: 200px;
}

/* Tab Panel */
.naat-tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.naat-tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Tazmeen Block Styling
   ========================================================================== */

.tazmeen-block {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    position: relative;
}

.tazmeen-block::before {
    content: attr(data-band);
    position: absolute;
    top: 0;
    right: 0;
    background: #3b82f6;
    color: white;
    font-size: 0.65rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0 1rem 0 0.5rem;
    font-weight: 600;
}

/* ==========================================================================
   Sharh (Explanation) Styling
   ========================================================================== */

.sharh-block {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sharh-explanation {
    font-family: 'NaatFont', serif;
    font-size: 1rem;
    line-height: 2;
    color: #475569;
    text-align: justify;
}

/* ==========================================================================
   Roman Content Styling - Now handled by NaatPoetryEngine (.na-roman)
   Legacy classes removed. Engine provides unified styling.
   ========================================================================== */


/* Mobile Tab Nav Adjustments */
@media (max-width: 768px) {
    .naat-tabs-nav {
        padding: 0.375rem;
        margin-bottom: 1rem;
    }

    .naat-tab-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Dictionary Word Highlight (Enhanced)
   ========================================================================== */

.dict-word {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #10b981;
    text-underline-offset: 6px;
    cursor: help;
    transition: all 0.2s ease;
    padding: 0 0.1em;
    border-radius: 3px;
}

.dict-word:hover {
    background-color: rgba(16, 185, 129, 0.12);
    text-decoration-color: #059669;
}

/* ==========================================================================
   Font Size Controls
   ========================================================================== */

.font-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
}

.font-controls button {
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.font-controls button:hover {
    background: white;
    color: #047857;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Mobile Bottom Navigation Enhancement
   ========================================================================== */

.mobile-tab-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tab-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: white;
        border-top: 1px solid #e2e8f0;
        padding: 0.5rem 0.25rem;
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
        gap: 0.25rem;
    }

    .mobile-tab-nav .mobile-tab-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        padding: 0.5rem 0.25rem;
        background: none;
        border: none;
        color: #64748b;
        font-size: 0.6rem;
        font-weight: 600;
        cursor: pointer;
        border-radius: 0.5rem;
        transition: all 0.2s ease;
        font-family: 'NaatFont', serif;
    }

    .mobile-tab-nav .mobile-tab-btn i {
        font-size: 1.25rem;
    }

    .mobile-tab-nav .mobile-tab-btn.active {
        color: #047857;
        background: #ecfdf5;
    }

    .mobile-tab-nav .mobile-tab-btn:hover {
        color: #059669;
    }
}