/* ============================================
   தமிழ் Google Fonts - நேர்த்தியான எழுத்துரு
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@300;400;500;600;700;800&family=Hind+Madurai:wght@300;400;500;600;700&family=Catamaran:wght@400;500;600;700;800&display=swap');

/* ============================================
   Base Font Settings
   ============================================ */
:root {
    --font-primary: 'Noto Sans Tamil', 'Hind Madurai', system-ui, -apple-system, sans-serif;
    --font-heading: 'Catamaran', 'Noto Sans Tamil', sans-serif;
    --font-body: 'Noto Sans Tamil', 'Hind Madurai', sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.8;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
    letter-spacing: 0.01em;
}

/* ============================================
   Headings - Catamaran font
   ============================================ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.005em;
}

h1, .h1 { font-weight: 700; }
h2, .h2 { font-weight: 700; }
h3, .h3 { font-weight: 600; }

/* ============================================
   Body Text
   ============================================ */
p, li, td, th, .card-text, .list-group-item, label {
    font-family: var(--font-body);
    line-height: 1.8;
    letter-spacing: 0.01em;
}

/* Tamil தமிழ் எழுத்துரு சிறப்பு அமைப்புகள் */
.tamil-text,
.tamil-heading {
    font-family: var(--font-primary);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* ============================================
   Buttons & Links
   ============================================ */
.btn, .nav-link, a {
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

.btn {
    font-weight: 500;
}

/* ============================================
   Form Elements
   ============================================ */
input, textarea, select, .form-control, .form-select {
    font-family: var(--font-body);
    letter-spacing: 0.01em;
}

/* ============================================
   Navbar & Navigation
   ============================================ */
.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.navbar-nav .nav-link {
    font-family: var(--font-body);
    font-weight: 500;
}

/* ============================================
   Mobile Bottom Nav
   ============================================ */
.mobile-bottom-nav {
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    z-index: 1030;
}
.mobile-bottom-nav small {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.72rem;
    display: block;
    margin-top: 3px;
    letter-spacing: 0.02em;
}
.mobile-bottom-nav a {
    display: block;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}
.mobile-bottom-nav a:active {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   Footer
   ============================================ */
footer, .footer {
    font-family: var(--font-body);
    line-height: 1.7;
}

footer h5, footer h6 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ============================================
   Badge & Small Text
   ============================================ */
.badge, small, .small {
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

/* ============================================
   Alert & Card
   ============================================ */
.alert, .card-title, .modal-title {
    font-family: var(--font-body);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* ============================================
   Tables
   ============================================ */
.table th {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.table td {
    font-family: var(--font-body);
}

/* ============================================
   Blockquote & Quran Verses
   ============================================ */
blockquote, .quran-verse, .fst-italic {
    font-family: 'Noto Sans Tamil', serif;
    font-style: italic;
    line-height: 1.9;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    body { font-size: 15px; }
    
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    
    .btn { min-height: 44px; padding: 10px 16px; font-size: 16px; }
    .btn-sm { min-height: 38px; font-size: 14px; }
    .btn-lg { min-height: 52px; font-size: 18px; }
    
    .form-control, .form-select {
        min-height: 48px;
        font-size: 16px;
    }
    
    body { padding-bottom: 80px !important; }
    
    .container { padding-left: 15px; padding-right: 15px; }
    .card-body { padding: 15px; }
    
    .navbar-nav .nav-link {
        padding: 12px 15px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table { font-size: 13px; }
    .table th, .table td { padding: 8px 6px; }
    
    .profile-header { padding: 25px 0; text-align: center; }
    .profile-header img { width: 120px !important; height: 120px !important; }
    
    .pricing-card.premium { transform: none; }
    .price { font-size: 2rem; }
    
    .hero-section { padding: 50px 0; }
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section .btn { width: 100%; margin-bottom: 10px; }
    
    .footer { padding: 30px 0 15px; text-align: center; }
    
    .message-bubble { max-width: 85%; font-size: 14px; }
    
    .modal-dialog { margin: 10px; }
    .modal-footer .btn { width: 100%; margin: 5px 0; }
}

/* ============================================
   Touch Improvements
   ============================================ */
.btn:active, .nav-link:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

a, button {
    -webkit-tap-highlight-color: rgba(40,167,69,0.2);
}

/* ============================================
   Safe Area (iPhone notch)
   ============================================ */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar, .footer, .mobile-bottom-nav, .btn {
        display: none !important;
    }
    body {
        font-size: 12pt;
        line-height: 1.6;
    }
}