:root {
    --bg-main: #fcfcfc;
    --bg-panel: #ffffff;
    --text-main: #1c1917;
    --text-muted: #78716c;
    --accent-primary: #10b981;
    --accent-primary-hover: #059669;
    --accent-gold: #eab308;
    --border-color: #e7e5e4;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
}

.app-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-logo {
    font-size: 2rem;
    color: var(--accent-gold);
    background: rgba(234, 179, 8, 0.1);
    padding: 10px;
    border-radius: 12px;
}

.nav-brand h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.nav-brand span {
    color: var(--accent-primary);
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.nav-menu::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    background: var(--bg-main);
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 1rem;
}

.nav-item:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 2.5rem 2rem;
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 3rem;
}

.prayer-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.prayer-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
    line-height: 1.3;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.read-action {
    width: 100%;
    background: transparent;
    color: var(--accent-primary);
    border: none;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s;
}

.prayer-card:hover .read-action {
    color: var(--accent-primary-hover);
}

/* Modal Reader */
.text-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 25, 23, 0.5);
    /* Neutral dark tint */
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.text-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.text-modal {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-lg);
    margin: 20px;
    overflow: hidden;
    /* Contains inner absolute elements */
}

.text-modal-overlay.active .text-modal {
    transform: translateY(0) scale(1);
}

.modal-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.modal-category-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-modal {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--border-color);
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
    line-height: 1.2;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.prayer-content-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px 24px;
    background: var(--bg-main);
}

.prayer-content-inner {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-main);
    font-weight: 400;
}

.prayer-content-inner p {
    margin-bottom: 1.5rem;
}

/* Custom Scrollbar */
.prayer-content-box::-webkit-scrollbar {
    width: 6px;
}

.prayer-content-box::-webkit-scrollbar-track {
    background: var(--bg-main);
}

.prayer-content-box::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.modal-footer {
    padding: 20px 24px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.done-btn {
    width: 100%;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.done-btn:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .top-nav {
        padding: 1rem;
        gap: 1rem;
    }

    .nav-brand h2 {
        font-size: 1.2rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .text-modal {
        height: 95vh;
        margin: 10px;
        border-radius: 20px;
    }

    .modal-header h3 {
        font-size: 1.5rem;
    }

    .prayer-content-inner {
        font-size: 1.1rem;
        line-height: 1.7;
    }
}