/* Root variables for theme colors */
:root {
    --bg-color: #f8f9fa;
    --text-color: #2c3e50;
    --footer-text-color: #5fb350;
    --card-bg: #fff;
    --border-color: #e1e8ed;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --hover-bg: #f8f9fa;
    --close-btn-text-color: #fff;
    --primary-color: #5fb350;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e1e8ed;
    --close-btn-text-color: #fff;
    --footer-text-color: #5fb350;
    --card-bg: #2c2c2c;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --hover-bg: #363636;
    --primary-color: #5fb350;
}


/* Global styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Quicksand', sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Header styles */
header {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* This spreads the children across the header */
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--shadow-color);
    height: 5rem;
}


#homeLink {
    color: #5fb350;
    text-decoration: none;
    transition: color 0.3s;
}

#homeLink:hover {
    color: var(--primary-color);
}

.theme-toggle {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}

.hamburger {
    cursor: pointer;
    margin-right: 1.5rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}
.download {
  background-color: #5fb350;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover & active effects */
.download:hover {
  background-color: #4a9841;
  transform: scale(1.05);
}

.download:active {
  transform: scale(0.98);
}

/* ❌ Hide on screens smaller than 768px (typical mobile/tablet breakpoint) */
@media (max-width: 767px) {
  .download {
    display: none;
  }
}


.hamburger:hover {
    background-color: var(--hover-bg);
}

.bar {
    width: 22px;
    height: 2px;
    background-color: var(--text-color);
    margin: 4px 0;
    transition: 0.4s;
    border-radius: 2px;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 300px;
    height: 100%;
    background-color: var(--card-bg);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 2px 0 10px var(--shadow-color);
}

.sidebar.active {
    left: 0;
}

.sidebar-content {
    padding: 2rem;
    padding-top: 5rem;
}

.sidebar h2 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 500;
}

.verse-search {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.verse-search input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: 0.3s;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.verse-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

#goToVerse {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
}

#goToVerse:hover {
    background-color: #2980b9;
}

/* Main content styles */
main {
    margin-top: 5rem; /* matches your header height */
    padding: 1.5rem;
    min-height: calc(100vh - 5rem - 10rem); /* full height minus header & footer */
  }
  

.search-container {
    max-width: 600px;
    margin: 0.1rem auto;
}

#searchInput {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 2px 10px var(--shadow-color);
    background-color: var(--card-bg);
    color: var(--text-color);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 2px 15px var(--shadow-color);
}

.search-guidance {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-align: center;
    min-height: 20px;
    transition: opacity 0.3s;
}

.search-guidance.valid {
    color: #27ae60;
}

.search-guidance.hidden {
    opacity: 0;
}

.chapters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.chapter-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow-color);
    border-color: var(--primary-color);
    background-color: var(--hover-bg);
}

.chapter-card h3 {
    color: var(--text-color);
    font-weight: 500;
}
.chapter-card h5 {
    color: var(--text-color);
    font-weight: 400;
    margin-bottom: 1rem;
}
.chapter-card p {
    color: var(--text-color);
    font-weight: 400;
    font-size: 0.9rem;
}

/* Chapter view styles */
.chapter-view {
    display: none;
    padding: 0.5rem;
    margin-top: 4rem;
}

.chapter-view.active {
    display: block;
}

.chapter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    margin-top: 1rem;
    padding:1.5rem;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    transition: 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.forward-btn{
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: 50%;
    transition: 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background-color: var(--hover-bg);
}

.chapter-title {
    color: var(--text-color);
    font-weight: 500;
}

.verses-container {
    max-width: 1200px;
    margin: 0 auto;
}

.verse {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: 0.3s;
}

.verse:hover {
    box-shadow: 0 4px 15px var(--shadow-color);
}

.verse-arabic {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.8rem;
    text-align: right;
    margin-bottom: 1.5rem;
    line-height: 2.2;
    color: var(--text-color);
}

.verse-english {
    color: var(--text-color);
    line-height: 1.8;
    font-weight: 450;
}

.verse-number {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tafsir-btn {
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    float: right;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    outline: none;
  }
  
  .tafsir-btn:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  }
  
  .tafsir-btn:active {
    transform: scale(0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .other-content{
    margin-top: 1rem;
    /*push to bottom of sidebar*/
    position: absolute;
    bottom: 0;
    
  }
  .other-content h3{
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
  }
  .other-content ul{
    list-style: none;
    padding: 0;
  }
  .other-content ul li{
    margin-bottom: 0.5rem;
  }
  .other-content ul li a{
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
  }
  .other-content ul li a:hover{
    color: var(--primary-color);
  }

  footer{
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--card-bg);
    height: 10rem;
  }
  footer h3{
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
  }
  footer ul{
    list-style: none;
    padding: 0;
  }
  footer ul li{
    margin-bottom: 0.5rem;
  }
  footer ul li a{
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
  }
  footer ul li a:hover{
    color: var(--primary-color);
  }
  footer p{
    margin-bottom: 0.5rem;
  }
  footer p a{
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
  }
  footer p a:hover{
    color: var(--primary-color);
  }
  .footer-link{
    color: var(--footer-text-color);
    text-decoration: none;
    transition: color 0.3s;
  }

/* Responsive design */
@media (max-width: 768px) {
    .chapters-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .verse-arabic {
        font-size: 1.4rem;
        line-height: 2;
    }
    
    .verse {
        padding: 1.5rem;
    }

    .sidebar {
        width: 280px;
        left: -280px;
    }
    h1{
        font-size: 1.5rem;
    }
    h2{
        font-size: 1.2rem;
    }
    h4{
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes highlight {
    0% {
        background-color: rgba(52, 152, 219, 0.1);
    }
    100% {
        background-color: var(--card-bg);
    }
}