/* =================================== */
/*          Global Styles              */
/* =================================== */
:root {
    --primary-color: #34495e;   /* Deep Slate Blue */
    --secondary-color: #333; /* Soft Black for Text */
    --highlight-color: #00a896;  /* Vibrant Teal for Active Elements */
    --light-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --global-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f8f9; /* Very light, cool gray */
    color: var(--secondary-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
}

main {
    flex-grow: 1;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 600;
}

a {
    color: var(--highlight-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
a:hover {
    color: var(--primary-color);
}

/* =================================== */
/*             Header                  */
/* =================================== */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-weight: 600;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
}
.navbar-brand img {
    margin-right: 10px;
}

.breadcrumb-item a {
    color: var(--highlight-color);
}

/* =================================== */
/*       Homepage (City Grid)          */
/* =================================== */
.search-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--global-shadow);
    margin-bottom: 3rem !important;
}

.city-card-wrapper {
    transition: transform 0.2s ease-in-out;
}
.city-card-wrapper:hover {
    transform: translateY(-8px);
}
.card-link {
    text-decoration: none;
    color: inherit;
}
.city-card {
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 0.5rem;
    transition: box-shadow 0.3s, border-color 0.3s;
}
.city-card:hover {
    box-shadow: var(--global-shadow) !important;
    border-color: var(--highlight-color);
}
.city-card .card-title {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 1.1rem;
}

/* =================================== */
/*      City Prayer Times Page         */
/* =================================== */
.prayer-cards-container {
    background-color: var(--card-bg);
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: var(--global-shadow);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Allow cards to wrap on smaller screens */
}
.prayer-card {
    flex: 1;
    min-width: 120px; /* Ensure cards don't get too squished */
    padding: 1rem 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background-color: #f7f9fa;
}
.prayer-card h6 {
    color: #7f8c8d;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}
.prayer-card .time {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}
.countdown-wrapper {
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    background-color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
}

/* Active Prayer Card */
.prayer-card.active-prayer {
    background-color: var(--highlight-color);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 168, 150, 0.3);
}
.prayer-card.active-prayer h6 {
    color: rgba(255, 255, 255, 0.9);
}
.prayer-card.active-prayer .time {
    color: #fff;
}
.prayer-card.active-prayer .countdown-wrapper {
    opacity: 1; /* Show only on active card */
    background-color: rgba(0, 0, 0, 0.2);
}

/* Timetable */
.namaz-timetable .table {
    box-shadow: var(--global-shadow);
    border-radius: 0.5rem;
    overflow: hidden; /* Ensures border-radius is respected by table */
}
.namaz-timetable .table thead {
    background-color: var(--primary-color);
    color: #fff;
}
.namaz-timetable .today-row {
    background-color: #e6fffd;
    font-weight: bold;
    color: var(--highlight-color);
}
.table > :not(caption) > * > * {
    padding: 1rem 0.75rem;
    vertical-align: middle;
}

/* Other Cities Buttons */
.city-link-btn {
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    background-color: var(--card-bg);
}
.city-link-btn:hover {
    background-color: var(--highlight-color);
    color: #fff;
    border-color: var(--highlight-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =================================== */
/*             Footer                  */
/* =================================== */
footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    padding-bottom: 1rem;
}
footer .text-muted {
    transition: color 0.2s ease-in-out;
    color: #6c757d !important;
}
footer a.text-muted {
    text-decoration: none;
}
footer a.text-muted:hover {
    color: var(--highlight-color) !important;
}

@media (max-width: 767px) {
    .prayer-card {
        flex-basis: calc(33.33% - 1rem); /* 3 cards per row on mobile */
    }
    .prayer-card .time {
        font-size: 1.25rem;
    }
}
@media (max-width: 576px) {
     .prayer-card {
        flex-basis: calc(50% - 1rem); /* 2 cards per row on small mobile */
    }
}