/* File: static/css/mobile.css */
/* Mobile app styles */
/* Version: 1.3.0 */
/* Last Modified: 2026-02-14 */
/* Change: Global desktop header alignment for consistent icon positioning */

/* ============================================
   App Header
   ============================================ */
.app-header {
    background: #1a5f3c;
    color: white;
    padding: 16px 20px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.app-logo {
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}
.app-logo:hover {
    opacity: 0.8;
}
.app-logo:active {
    opacity: 0.6;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

/* ============================================
   Search Bar
   ============================================ */
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 16px;
    gap: 12px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-size: 15px;
    outline: none;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding: 20px;
    padding-bottom: 100px;
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.section-link {
    font-size: 14px;
    color: #1a5f3c;
    text-decoration: none;
    font-weight: 500;
}

/* ============================================
   Live Section
   ============================================ */
.live-section {
    margin-bottom: 24px;
}

.live-card {
    background: linear-gradient(135deg, #1a5f3c, #0d3320);
    border-radius: 16px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e53935;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.live-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-mosque {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.live-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.live-play-btn {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a5f3c;
    border: none;
    position: absolute;
    right: 20px;
    bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.live-wave {
    position: absolute;
    right: 90px;
    bottom: 30px;
    display: flex;
    gap: 3px;
    height: 36px;
    align-items: flex-end;
}

.wave-bar {
    width: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 8px; }
    50% { height: 24px; }
}

/* ============================================
   Mosque Cards (Horizontal Scroll)
   ============================================ */
.mosques-scroll {
    display: flex;
    align-items: stretch;
    gap: 12px;
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px 8px;
    -webkit-overflow-scrolling: touch;
}

.mosques-scroll::-webkit-scrollbar {
    display: none;
}

.mosque-card {
    width: 170px;
    min-width: 170px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.mosque-icon {
    width: 48px;
    height: 48px;
    background: #e8f5e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a5f3c;
    margin-bottom: 12px;
}

.mosque-names {
    flex: 1;
    margin-bottom: 4px;
}

.mosque-name-ar {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    line-height: 1.3;
    word-wrap: break-word;
}

.mosque-name-en {
    font-weight: 400;
    font-size: 12px;
    color: #666;
    line-height: 1.3;
    margin-top: 2px;
    word-wrap: break-word;
}

.mosque-distance {
    font-size: 12px;
    color: #888;
}

.mosque-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 12px;
}

.mosque-status.live {
    background: #ffebee;
    color: #c62828;
}

.mosque-status.upcoming {
    background: #e3f2fd;
    color: #1565c0;
}

/* ============================================
   Sermon Cards
   ============================================ */
.sermon-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 16px;
    cursor: pointer;
}

.sermon-thumb {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #1a5f3c, #2e7d32);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sermon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sermon-title {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
}

.sermon-mosque {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.sermon-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
}

.sermon-play {
    width: 40px;
    height: 40px;
    background: #e8f5e9;
    border-radius: 50%;
    border: none;
    color: #1a5f3c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    cursor: pointer;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 12px 20px 24px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 24px 24px 0 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #888;
    text-decoration: none;
    font-size: 11px;
}

.nav-item.active {
    color: #1a5f3c;
}

.nav-icon {
    width: 24px;
    height: 24px;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.quick-icon.scan {
    background: #2196F3;
}

.quick-icon.downloads {
    background: #9C27B0;
}

.quick-icon.favorites {
    background: #FF9800;
}

.quick-icon.history {
    background: #607D8B;
}

.quick-label {
    font-size: 12px;
    color: #666;
}

/* ============================================
   View All Mosque Card
   ============================================ */
.mosque-card-view-all {
    background: transparent;
    border: 2px dashed #c8e6c9;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1a5f3c;
    transition: background 0.2s ease;
}
.mosque-card-view-all:hover {
    background: rgba(26, 95, 60, 0.05);
}
.mosque-card-view-all .view-all-arrow {
    font-size: 28px;
    font-weight: 300;
}
.mosque-card-view-all .view-all-label {
    font-size: 14px;
    font-weight: 600;
}

/* ============================================
   RTL Support
   ============================================ */
[dir="rtl"] .header-top {
    flex-direction: row-reverse;
}

[dir="rtl"] .section-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .live-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .sermon-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .live-play-btn {
    right: auto;
    left: 20px;
}

[dir="rtl"] .live-wave {
    right: auto;
    left: 90px;
}

/* ============================================
   Desktop Header Alignment
   Keep profile icon at same position across all pages
   ============================================ */
@media (min-width: 768px) {
    .app-header {
        padding-left: calc((100% - 720px) / 2 + 20px);
        padding-right: calc((100% - 720px) / 2 + 20px);
    }
}
@media (min-width: 1024px) {
    .app-header {
        padding-left: calc((100% - 900px) / 2 + 20px);
        padding-right: calc((100% - 900px) / 2 + 20px);
    }
}
