/* ==========================================================================
   Daily Spiritual Tracker - Modern Islamic Emerald & Gold Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Inter:wght@300;400;500;600;700&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --bg-dark: #071913;
    --bg-card: rgba(15, 41, 32, 0.75);
    --bg-card-hover: rgba(22, 56, 44, 0.85);
    --border-color: rgba(212, 175, 55, 0.25);
    --border-light: rgba(255, 255, 255, 0.08);

    --gold-primary: #dfb15b;
    --gold-glow: #f5d78a;
    --emerald-bright: #10b981;
    --emerald-dark: #059669;

    --color-success: #10b981;
    --color-info: #3b82f6;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-urdu: 'Tajawal', 'Amiri', serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at top center, #0f3527 0%, #071913 60%, #030d0a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    padding-bottom: 70px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* Background Ornament Subtle Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(223, 177, 91, 0.05) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 16px;
    position: relative;
    z-index: 1;
}

/* Header & Date Banner */
.app-header {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
}

.app-header::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.header-bismillah {
    font-family: var(--font-urdu);
    font-size: 1.5rem;
    color: var(--gold-glow);
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.date-badge-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.date-pill {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-separator {
    color: var(--text-muted);
}

.lock-pill {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Tab Navigation */
.nav-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 24px;
    gap: 6px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--emerald-dark), #0f4031);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Sections & Cards */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

.section-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-glass);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Grid Layouts */
.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.prayer-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.prayer-card:hover {
    border-color: rgba(212, 175, 55, 0.4);
    background: var(--bg-card-hover);
}

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

.prayer-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(223, 177, 91, 0.1);
    border: 1px solid rgba(223, 177, 91, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary);
    font-size: 1.2rem;
}

.prayer-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.prayer-urdu {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-urdu);
}

/* Custom Toggle Pills (Yes / No) */
.toggle-group {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    gap: 4px;
}

.toggle-option {
    display: none;
}

.toggle-label {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    user-select: none;
}

.toggle-option:checked + .toggle-label.yes-label {
    background: var(--emerald-bright);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.toggle-option:checked + .toggle-label.no-label {
    background: rgba(239, 68, 68, 0.8);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Darood Pak Special Section */
.darood-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.darood-count-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    display: none;
    animation: fadeIn 0.3s ease;
}

.darood-count-box.show {
    display: block;
}

.input-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gold-glow);
    margin-bottom: 8px;
    display: block;
}

.count-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.number-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    outline: none;
    transition: var(--transition);
}

.number-input:focus {
    border-color: var(--emerald-bright);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-btn {
    background: rgba(223, 177, 91, 0.15);
    border: 1px solid rgba(223, 177, 91, 0.3);
    color: var(--gold-primary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chip-btn:hover {
    background: var(--gold-primary);
    color: #000;
}

/* Sin (Gunah) Alert Card */
.sin-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(0, 0, 0, 0.3));
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

/* Submit Button */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--gold-primary), #b38830);
    color: #071913;
    border: none;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(223, 177, 91, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(223, 177, 91, 0.45);
    background: linear-gradient(135deg, var(--gold-glow), var(--gold-primary));
}

.btn-primary:active {
    transform: translateY(0);
}

/* Rating Badges & Summary Banner */
.rating-banner {
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.rating-excellent {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(6, 78, 59, 0.8));
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.rating-good {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(30, 58, 138, 0.8));
    border: 1px solid rgba(59, 130, 246, 0.5);
}

.rating-improve {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(120, 53, 15, 0.8));
    border: 1px solid rgba(245, 158, 11, 0.5);
}

.rating-bad {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(127, 29, 29, 0.8));
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.rating-badge {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rating-excellent .rating-badge { background: #059669; }
.rating-good .rating-badge { background: #2563eb; }
.rating-improve .rating-badge { background: #d97706; }
.rating-bad .rating-badge { background: #dc2626; }

.rating-info {
    flex: 1;
}

.rating-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
}

.rating-desc {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Stats Overview Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    margin-top: 10px;
}

.progress-bar-bg {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emerald-bright), var(--gold-primary));
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}

/* History Calendar List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-date {
    font-weight: 700;
    color: #ffffff;
    font-size: 1rem;
}

.history-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mini-pill {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.mini-pill.active {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.mini-pill.sin {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Notification Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--emerald-bright);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    animation: slideUp 0.3s ease;
}

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

/* Responsive adjustments */
@media (max-width: 600px) {
    .app-header { padding: 18px 14px; }
    .app-title { font-size: 1.4rem; }
    .prayer-grid { grid-template-columns: 1fr; }
    .nav-tabs { flex-direction: row; }
    .tab-btn { font-size: 0.85rem; padding: 10px 8px; }
}
