:root {
    --primary-color: #1a5f3c;
    --secondary-color: #2d8b57;
    --accent-color: #f8c537;
    --bg-color: #e8f5e9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --header-height: 64px;
    --nav-height: 75px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.header-logo-link {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 48px;
    width: 48px;
    border-radius: 6px;
    object-fit: cover;
}

.header-title-link {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.header-subtitle {
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-back {
    color: white;
    text-decoration: none;
    font-size: 22px;
}

.notification-bell {
    color: white;
    text-decoration: none;
    font-size: 22px;
    position: relative;
}

.install-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    margin-right: 8px;
    transition: background 0.2s;
}

.install-btn:hover {
    background: rgba(255,255,255,0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    min-width: 18px;
    padding: 2px 5px;
}

.app-content {
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
    min-height: 100vh;
}

.app-content.has-nav {
    padding-bottom: calc(var(--nav-height) + 20px);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 5px;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 25px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    padding: 8px 12px;
    position: relative;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 28px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: white;
}

.nav-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 9px;
    padding: 2px 5px;
}

.flash-messages {
    margin-bottom: 16px;
}

.flash-messages .alert {
    margin-bottom: 8px;
    border-radius: var(--border-radius);
}

.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo img, .login-logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 16px 0 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-control {
    border-radius: 10px;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    font-size: 16px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 60, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.home-welcome {
    text-align: center;
    padding: 10px 0;
}

.home-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin-bottom: 16px;
}

.home-logo-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 40px;
    color: white;
}

.home-welcome h2 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.home-welcome p {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 0;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 24px;
    padding: 8px 0;
}

.social-icons a {
    color: var(--primary-color);
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.social-icons a:hover {
    opacity: 1;
}

.home-footer {
    text-align: center;
    padding: 16px 16px 8px;
    margin-top: 8px;
}

.home-footer p {
    color: var(--text-muted);
    font-size: 11px;
    margin: 0;
    line-height: 1.5;
}

.home-footer p:first-child {
    font-weight: 500;
}

.next-jamaat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(26, 95, 60, 0.3);
}

.next-jamaat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.next-jamaat-info {
    flex: 1;
}

.next-jamaat-label {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-jamaat-prayer {
    font-size: 18px;
    font-weight: 600;
}

.next-jamaat-time {
    font-size: 14px;
    opacity: 0.9;
}

.next-jamaat-countdown {
    font-size: 10px;
    background: rgba(255,255,255,0.2);
    padding: 5px 8px;
    border-radius: 20px;
    white-space: nowrap;
}

.next-jamaat-card.in-progress {
    background: linear-gradient(135deg, #d4a017, #f8c537);
    animation: pulse-glow 2s ease-in-out infinite;
}

.next-jamaat-card.in-progress .next-jamaat-countdown {
    background: rgba(0,0,0,0.15);
    font-weight: 600;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(212, 160, 23, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(212, 160, 23, 0.6); }
}

.next-event-card {
    background: linear-gradient(135deg, #145230, #1a5f3c);
    color: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(20, 82, 48, 0.3);
    text-decoration: none;
}

.next-event-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.next-event-info {
    flex: 1;
}

.next-event-label {
    font-size: 11px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-event-title {
    font-size: 16px;
    font-weight: 600;
}

.next-event-date {
    font-size: 13px;
    opacity: 0.9;
}

.next-event-badge {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.next-event-badge .event-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.next-event-badge .event-month {
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.9;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.resource-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 1px 5px rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.resource-item:hover {
    transform: translateX(1px);
}

.resource-item i {
    font-size: 18px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.resource-text {
    flex: 1;
    min-width: 0;
}

.resource-title {
    font-size: 11px;
    font-weight: 600;
    display: block;
}

.resource-desc {
    font-size: 9px;
    color: var(--text-muted);
    display: block;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 16px;
}

.service-tile {
    background: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 10px 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    position: relative;
    transition: transform 0.2s, opacity 0.2s;
}

.service-tile:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.service-tile > i:first-child {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.service-tile span {
    font-size: 11px;
    font-weight: 500;
    display: block;
}

.service-external {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.service-tile:hover .service-external {
    opacity: 0.7;
}

.primary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.primary-tile {
    background: white;
    border-radius: var(--border-radius);
    padding: 14px 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.primary-tile i {
    font-size: 22px;
    color: var(--primary-color);
    margin-bottom: 4px;
    display: block;
}

.primary-tile span {
    font-size: 12px;
    font-weight: 500;
}

.secondary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.secondary-tile {
    background: white;
    border-radius: var(--border-radius);
    padding: 8px 2px;
    text-align: center;
    text-decoration: none;
    color: var(--text-muted);
    box-shadow: 0 1px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s;
}

.secondary-tile:hover {
    transform: translateY(-1px);
}

.secondary-tile i {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 2px;
    display: block;
}

.secondary-tile span {
    font-size: 8px;
    font-weight: 500;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 24px;
}

.feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 14px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.feature-card i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.feature-card span {
    display: block;
    font-size: 11px;
    font-weight: 500;
}

.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}

.card-header {
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 16px;
    font-weight: 600;
}

.card-body {
    padding: 16px;
}

.prayer-time-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.prayer-name {
    font-weight: 600;
    font-size: 16px;
}

.prayer-time {
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 600;
}

.event-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.event-date {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.event-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.event-desc {
    font-size: 14px;
    color: var(--text-muted);
}

.post-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.post-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: 600;
}

.post-author {
    font-weight: 600;
    font-size: 14px;
}

.post-time {
    font-size: 12px;
    color: var(--text-muted);
}

.post-content {
    font-size: 15px;
    line-height: 1.5;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.4;
}

.message-sent {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message-received {
    background: #e9ecef;
    color: var(--text-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-container {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    background: white;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    border-radius: 24px;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
}

.alert-item.unread {
    border-left: 4px solid var(--primary-color);
}

.alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(26, 95, 60, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--primary-color);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    font-size: 14px;
}

.alert-message {
    font-size: 13px;
    color: var(--text-muted);
}

.alert-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.profile-header {
    text-align: center;
    padding: 20px 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 16px;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 40px;
    color: white;
}

.admin-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.admin-menu-item {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-menu-item i {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: block;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.conversation-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.conversation-info {
    flex: 1;
}

.conversation-name {
    font-weight: 600;
    font-size: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 12px;
    color: var(--text-color);
}

.list-group-item {
    border: none;
    border-radius: var(--border-radius) !important;
    margin-bottom: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.textarea-auto {
    min-height: 100px;
    resize: vertical;
}

@media (max-width: 320px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.push-prompt-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.push-prompt-content i {
    font-size: 24px;
    color: var(--primary-color);
}

.push-prompt-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.push-prompt-content .btn {
    margin-left: auto;
}

.prayer-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prayer-toast-content i {
    font-size: 24px;
}

.prayer-toast-content p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.prayer-toast .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.event-date-badge {
    min-width: 45px;
    padding: 5px;
    background: #f8f9fa;
    border-radius: 8px;
}

.month-card .list-group-item {
    border-left: none;
    border-right: none;
}

.month-card .list-group-item:first-child {
    border-top: none;
}

.month-card .list-group-item:last-child {
    border-bottom: none;
}
