/* Common styles for all pages - RESPONSIVE DESIGN */

/* Base responsive setup */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

/* Image styles - Responsive */
.imagestyle {
    width: 30% !important;
    height: auto !important;
    max-width: 300px !important;
    min-width: 150px !important;
}

/* Add space between list items */
li {
    margin-bottom: 15px;
}

/* Add space before and after standalone images */
ol > img {
    margin-top: 15px;
    margin-bottom: 15px;
    display: block;
    max-width: 100%;
    height: auto;
}

ul li img {
    margin-top: 15px;
    margin-bottom: 15px;
    display: block;
    max-width: 100%;
    height: auto;
}

/* Added horizontal line with styling */
hr {
    border: 1px solid #003f2d;
}

/* Added styling for image stack */
.image-stack {
    display: flex;
    flex-direction: column;
}

.icon-plus {
    font-weight: bold;
    font-size: 1.2em;
    padding: 0 2px;
}

/* Styles for Talk to Krushna pages - Responsive */
body {
    font-family: 'Arial', sans-serif;
    text-align: center;
    background-color: #f9f9f9;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: #e8f5e9;
    padding: clamp(15px, 4vw, 20px);
    font-size: clamp(18px, 5vw, 24px);
    font-weight: bold;
    color: #244D58;
}

img {
    width: clamp(150px, 40vw, 200px);
    height: auto;
    margin-top: 20px;
    border-radius: 10px;
    max-width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 20px;
    color: #244D58;
    line-height: 1.4;
}

h1 {
    font-size: clamp(1.8em, 6vw, 2.5em);
}

h2 {
    font-size: clamp(1.5em, 5vw, 2em);
}

h3 {
    font-size: clamp(1.3em, 4vw, 1.8em);
}

.input-section {
    margin-top: 20px;
    padding: 0 10px;
}

input {
    padding: 12px 15px;
    font-size: clamp(14px, 4vw, 16px);
    width: min(300px, 90vw);
    max-width: 100%;
    border: 2px solid #244D58;
    border-radius: 8px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: #E1A328;
    box-shadow: 0 0 8px rgba(225, 163, 40, 0.3);
    background-color: #fefefe;
}

input::placeholder {
    color: #888;
    font-style: italic;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    margin-left: 10px;
    background-color: #E1A328;
    color: #244D58;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

button:hover {
    background-color: #E1A328;
}

#message-box {
    margin-top: 18px;
    font-size: 18px;
    color: #2c3e50;
    padding: 25px;
    border: 3px solid #E1A328;
    border-radius: 15px;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    box-shadow: 0 8px 25px rgba(225, 163, 40, 0.2);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#message-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E1A328, #f4c430, #E1A328);
    border-radius: 15px 15px 0 0;
}

#message-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(225, 163, 40, 0.3);
}

/* Styles for Index page */
* {
    box-sizing: border-box;
}

body.index-page {
    font-family: Arial, Helvetica, sans-serif;
    max-height: 100%;
    font-size: 15px;
    background-color: #f9f9f9;
    color: #244D58;
    margin: 0;
    padding: 0;
    text-align: left;
}

.height {
    line-height: 30px;
    height: 100%;
    min-height: 100vh;
    text-align: center;
    color: #244D58;
}

/* Style the header for index page */
header.index-header {
    background-color: #E1A328;
    padding: 5px;
    text-align: center;
    color: #244D58;
}

/* Create two columns/boxes that floats next to each other */
nav {
    float: left;
    width: 20%;
    background: #E1A328;
    padding: 0 0 0 10px;
    max-height: 100%;
    overflow-y: scroll;
    height: 1000px;
}

/* Style the list inside the menu */
nav ul {
    list-style-type: none;
    padding: 0;
}

article {
    float: left;
    padding: 20px;
    width: 80%;
    background-color: #edeff1;
}

/* Clear floats after the columns */
section::after {
    content: "";
    display: table;
    clear: both;
}

/* Style the footer */
footer {
    height: 50px;
    background: #f5f7f7;
    display: flex;
    align-items: center;
    color: #433d3d;
    font-size: 14px;
    font-family: Calibre, "Helvetica Neue", sans-serif;
    padding: 0 16px;
}

#search {
    font-size: 25px;
}

/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
@media (max-width: 600px) {
    nav,
    article {
        width: 100%;
        height: auto;
    }
}

/* ============================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ============================================ */

/* Mobile First - Extra Small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding: 5px;
        font-size: 14px;
    }
    
    .container, .gita-container {
        margin: 5px;
        padding: 10px;
        border-radius: 10px;
    }
    
    .chapter-header, .header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }
    
    .page-title, .gita-title, .chapter-title {
        font-size: 1.5em;
        line-height: 1.3;
    }
    
    .chapter-subtitle {
        font-size: 1.1em;
    }
    
    .mantra-text {
        font-size: 1.2em;
        line-height: 1.6;
    }
    
    .saint-figure {
        font-size: 2.5em;
    }
    
    .theme-section, .benefit {
        padding: 15px;
        margin: 15px 0;
    }
    
    .nav-grid, .chapter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .nav-card {
        padding: 15px;
    }
    
    input {
        width: 95%;
        font-size: 14px;
        padding: 10px;
    }
    
    img, .krishna-img {
        max-width: 90%;
        height: auto;
    }
    
    .imagestyle {
        width: 80% !important;
        max-width: 250px !important;
    }
}

/* Small devices (portrait tablets and large phones, 600px to 768px) */
@media only screen and (min-width: 600px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .container, .gita-container {
        margin: 10px;
        padding: 15px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chapter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .saint-figure {
        font-size: 3em;
    }
    
    .theme-section, .benefit {
        padding: 20px;
    }
    
    input {
        width: 80%;
        max-width: 400px;
    }
}

/* Medium devices (landscape tablets, 768px to 992px) */
@media only screen and (min-width: 768px) and (max-width: 992px) {
    .container, .gita-container {
        max-width: 750px;
        padding: 20px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chapter-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .saint-figure {
        font-size: 3.5em;
    }
}

/* Large devices (laptops/desktops, 992px to 1200px) */
@media only screen and (min-width: 992px) and (max-width: 1200px) {
    .container, .gita-container {
        max-width: 970px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chapter-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {
    .container, .gita-container {
        max-width: 1170px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chapter-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .nav-card, .theme-section {
        break-inside: avoid;
    }
    
    .saint-figure {
        font-size: 2em;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nav-card, .theme-section, .benefit {
        border: 2px solid;
    }
}

ul li {
    line-height: 40px;
}

ul li li {
    padding-left: 25px;
    line-height: 40px;
}

/* Default link styles */
a {
    color: #0066cc;
}

a:hover {
    color: #003f2d;
    font-size: 18px;
}

/* Index page specific link styles */
.index-page a {
    color: #244D58;
    font-weight: 600;
}

.index-page a:hover {
    color: #fff;
    font-size: 16px;
}

/* ============================================
   KRISHNA-THEMED BACK TO TOP BUTTON - COMMON STYLES
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #1e40af 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.5);
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffdf00;
    text-decoration: none;
    animation: pulseButton 2s infinite;
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.15);
    box-shadow: 0 20px 50px rgba(30, 58, 138, 0.8);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    animation: divine-pulse-gita 1.5s ease-in-out infinite;
}

.back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.back-to-top.show:hover {
    animation: divine-pulse-gita 1.5s ease-in-out infinite;
}

@keyframes divine-pulse-gita {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(30, 58, 138, 0.5);
    }
    50% {
        box-shadow: 0 15px 40px rgba(30, 58, 138, 0.8), 0 0 20px rgba(255, 223, 0, 0.6);
    }
}

@keyframes pulseButton {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(30, 58, 138, 0.5), 0 0 0 0 rgba(255, 223, 0, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(30, 58, 138, 0.7), 0 0 0 10px rgba(255, 223, 0, 0.1);
    }
}

/* Common Back to Top JavaScript Functionality */
.btk-scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #1e3a8a 0%, #ffdf00 50%, #ff9933 100%);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1001;
    transition: transform 0.1s ease;
}

/* 
COMMON BACK-TO-TOP JAVASCRIPT - ADD THIS TO YOUR PAGES:

<script>
// Krishna-themed Back to Top Button - Common initialization
document.addEventListener('DOMContentLoaded', function() {
    const backToTopBtn = document.getElementById('backToTop') || document.getElementById('backToTopBtn');
    const scrollIndicator = document.getElementById('scrollIndicator');
    
    // Ensure button is always visible
    if (backToTopBtn) {
        backToTopBtn.style.opacity = '1';
        backToTopBtn.style.visibility = 'visible';
        backToTopBtn.classList.add('show');
    }
    
    window.addEventListener('scroll', function() {
        if (scrollIndicator) {
            const scrolled = (window.pageYOffset / (document.documentElement.scrollHeight - window.innerHeight)) * 100;
            scrollIndicator.style.transform = `scaleX(${scrolled / 100})`;
        }
    });

    if (backToTopBtn) {
        backToTopBtn.addEventListener('click', function(e) {
            e.preventDefault();
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });
    }
});
</script>

HTML STRUCTURE:
<a href="#" class="back-to-top" id="backToTop" title="Back to Top">⬆️</a>
<div class="btk-scroll-indicator" id="scrollIndicator"></div>
*/

/* Responsive adjustments for back-to-top button */
@media (max-width: 768px) {
    .back-to-top {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2em;
        border: 2px solid #ffdf00;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 1em;
    }
}

