/* CSS Variables for Theme */
:root {
    --primary-color: #ff9933;
    --secondary-color: #ffb366;
    --accent-color: #e6851a;
    --background: linear-gradient(135deg, #fff8f0 0%, #ffeedd 100%);
    --surface: rgba(255, 255, 255, 0.9);
    --text-primary: #2d1810;
    --text-secondary: #8b4513;
    --border: rgba(255, 153, 51, 0.2);
    --shadow: rgba(255, 153, 51, 0.25);
    --success: #4caf50;
    --warning: #ff9800;
    --error: #f44336;
    --danger: #dc3545;
    --nav-height: 80px;
    --devotional-gold: #ffd700;
    --devotional-saffron: #ff9933;
    --devotional-maroon: #800020;
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-color: #ff9933;
    --secondary-color: #ffb366;
    --accent-color: #e6851a;
    --background: linear-gradient(135deg, #1a0f0a 0%, #2d1810 100%);
    --surface: rgba(45, 24, 16, 0.9);
    --text-primary: #fff8f0;
    --text-secondary: #ffb366;
    --border: rgba(255, 153, 51, 0.3);
    --shadow: rgba(255, 153, 51, 0.4);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    transition: all 0.3s ease;
    overflow-x: hidden;
    min-height: 100vh;
}

.app {
    position: relative;
    min-height: 100vh;
    padding-bottom: var(--nav-height);
}

/* Background Image */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    transition: all 0.5s ease;
}

.background-image.default {
    background: linear-gradient(135deg, #fff8f0 0%, #ffeedd 100%);
    opacity: 1;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 153, 51, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        linear-gradient(45deg, transparent 40%, rgba(255, 153, 51, 0.05) 50%, transparent 60%);
    background-size: 100px 100px, 150px 150px, 200px 200px;
    background-position: 0 0, 50px 50px, 100px 100px;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - var(--nav-height));
}

/* Page System */
.page {
    display: none;
    padding: 20px;
    min-height: calc(100vh - var(--nav-height));
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 0;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Home Page Styles */
.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height) - 40px);
    text-align: center;
    padding: 20px;
}

.welcome-section {
    margin-bottom: 40px;
}

.app-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--devotional-gold), var(--devotional-saffron));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(10px);
    border: 2px solid var(--devotional-gold);
    position: relative;
}

.app-logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--devotional-gold), var(--devotional-saffron), var(--devotional-maroon));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.om-symbol {
    font-size: 2.5rem;
    color: white;
    font-weight: bold;
    font-family: 'Devanagari Sangam MN', 'Noto Sans Devanagari', serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    text-shadow: 0 2px 4px var(--shadow);
}

.app-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 300px;
    margin: 0 auto;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 400px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 240, 0.9));
    padding: 20px 16px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--devotional-gold);
    transition: transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--devotional-gold), var(--devotional-saffron));
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--shadow);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.quick-actions {
    width: 100%;
    max-width: 300px;
}

.quick-action-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--devotional-saffron), var(--devotional-gold));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(255, 153, 51, 0.4);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.quick-action-btn:hover::before {
    left: 100%;
}

.quick-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 153, 51, 0.5);
    background: linear-gradient(135deg, var(--devotional-gold), var(--devotional-saffron));
}

.quick-action-btn:active {
    transform: translateY(-1px);
}

.quick-action-btn i {
    font-size: 1.3rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn.primary {
    background: linear-gradient(135deg, var(--devotional-saffron), var(--devotional-gold));
    color: white;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn.primary:hover::before {
    left: 100%;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 153, 51, 0.4);
    background: linear-gradient(135deg, var(--devotional-gold), var(--devotional-saffron));
}

.btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn.secondary:hover {
    background: var(--border);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px var(--shadow);
}

.icon-btn:hover {
    background: var(--border);
    transform: translateY(-1px);
}

/* Counter Form */
.counter-form {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.counter-form h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--background);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.form-actions .btn {
    flex: 1;
}

/* Counter Card */
.counter-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.counter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.counter-card.tapped {
    transform: scale(0.98);
    background: var(--secondary-color);
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.counter-info h3 {
    font-size: 1.3rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.counter-info .deity {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.counter-actions {
    display: flex;
    gap: 8px;
}

.counter-count {
    text-align: center;
    margin: 20px 0;
}

.count-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.count-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.target-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Enhanced devotional styling */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-icon .om-symbol {
    font-size: 4rem;
    color: var(--devotional-saffron);
    font-weight: bold;
    font-family: 'Devanagari Sangam MN', 'Noto Sans Devanagari', serif;
    text-shadow: 0 2px 8px var(--shadow);
    animation: glow 2s ease-in-out infinite alternate;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 24px;
}

@keyframes glow {
    from { text-shadow: 0 2px 8px var(--shadow); }
    to { text-shadow: 0 4px 16px var(--devotional-gold), 0 2px 8px var(--shadow); }
}
.empty-icon .om-symbol {
    font-size: 4rem;
    color: var(--devotional-saffron);
    font-weight: bold;
    font-family: 'Devanagari Sangam MN', 'Noto Sans Devanagari', serif;
    text-shadow: 0 2px 8px var(--shadow);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 2px 8px var(--shadow); }
    to { text-shadow: 0 4px 16px var(--devotional-gold), 0 2px 8px var(--shadow); }
}

/* Settings section enhancements */
.settings-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 240, 0.95));
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--devotional-gold);
    position: relative;
}

.settings-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--devotional-gold), var(--devotional-saffron));
    border-radius: 16px 16px 0 0;
}

/* Bottom navigation enhancements */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 240, 0.95));
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--devotional-gold);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px var(--shadow);
}

/* Icon loading states */
.bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}

/* Ensure icons are visible */
[class^="bi-"], [class*=" bi-"] {
    font-family: 'bootstrap-icons', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pulse {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .app {
        padding: 0 12px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .counter-card {
        padding: 20px;
    }
    
    .count-display {
        font-size: 2.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .counter-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .icon-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    .header {
        padding-top: 40px; /* Account for status bar */
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.icon-btn:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.counter-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Settings Page Styles */
.settings-content {
    max-width: 600px;
    margin: 0 auto;
}

.settings-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px var(--shadow);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
}

.settings-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    cursor: pointer;
}

/* Ensure toggle switches have proper click area */
.setting-item .toggle-switch {
    flex-shrink: 0;
    margin-left: 16px;
}

.setting-item input[type="number"],
.setting-item input[type="file"],
.setting-item select {
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-left: 16px;
}

.setting-item input[type="range"] {
    max-width: 150px;
    flex-shrink: 0;
    margin-left: 16px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 24px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
    user-select: none;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider:hover {
    background-color: var(--primary-color);
    opacity: 0.8;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

/* Make the entire toggle switch clickable */
.toggle-switch {
    cursor: pointer;
}

.toggle-switch:hover .slider {
    background-color: var(--primary-color);
    opacity: 0.8;
}

.setting-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.setting-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--surface);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 20px var(--shadow);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    min-width: 60px;
}

.nav-item:hover {
    background: var(--border);
}

.nav-item.active {
    color: var(--devotional-saffron);
    background: rgba(255, 153, 51, 0.15);
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Background Themes */
.background-image.krishna {
    background-image: url('https://images.unsplash.com/photo-1578662996442-48f60103fc96?q=80&w=2070&auto=format&fit=crop');
}

.background-image.shiva {
    background-image: url('https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?q=80&w=2070&auto=format&fit=crop');
}

.background-image.hanuman {
    background-image: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2070&auto=format&fit=crop');
}

.background-image.ganesha {
    background-image: url('https://images.unsplash.com/photo-1545558014-8692077e9b5c?q=80&w=2070&auto=format&fit=crop');
}

.background-image.durga {
    background-image: url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?q=80&w=2070&auto=format&fit=crop');
}

.background-image.ram {
    background-image: url('https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?q=80&w=2070&auto=format&fit=crop');
}

.background-image.lakshmi {
    background-image: url('https://images.unsplash.com/photo-1518709268805-4e9042af2176?q=80&w=2070&auto=format&fit=crop');
}

.background-image.saraswati {
    background-image: url('https://images.unsplash.com/photo-1545558014-8692077e9b5c?q=80&w=2070&auto=format&fit=crop');
}

/* Counter Card Updates */
.counter-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 240, 0.95));
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px var(--shadow);
    backdrop-filter: blur(10px);
    border: 2px solid var(--devotional-gold);
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--devotional-gold), var(--devotional-saffron), var(--devotional-maroon));
}

.counter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow);
}

.counter-card.tapped {
    transform: scale(0.98);
    background: var(--secondary-color);
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.counter-info h3 {
    font-size: 1.4rem;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 600;
}

.counter-info .deity {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.counter-actions {
    display: flex;
    gap: 8px;
}

.counter-count {
    text-align: center;
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 153, 51, 0.1), rgba(255, 215, 0, 0.1));
    border-radius: 16px;
    border: 2px solid var(--devotional-gold);
    position: relative;
    overflow: hidden;
}

.counter-count::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.2) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.counter-count:hover::before {
    opacity: 1;
}

.count-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px var(--shadow);
}

.count-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--devotional-saffron), var(--devotional-gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.target-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Full Screen Counter */
.fullscreen-counter {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    z-index: 2000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.fullscreen-counter.active {
    display: flex;
}

.fullscreen-header {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2001;
}

.fullscreen-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.close-fullscreen {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.2s ease;
}

.close-fullscreen:hover {
    background: var(--border);
    transform: scale(1.05);
}

.fullscreen-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 400px;
    width: 100%;
}

.fullscreen-deity {
    font-size: 4rem;
    margin-bottom: 16px;
}

.fullscreen-name {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.fullscreen-god {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 40px;
}

.fullscreen-count-area {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 248, 240, 0.95));
    border: 4px solid var(--devotional-gold);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 32px var(--shadow);
    margin-bottom: 40px;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.fullscreen-count-area::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, var(--devotional-gold), var(--devotional-saffron), var(--devotional-maroon));
    border-radius: 50%;
    z-index: -1;
    animation: rotate 4s linear infinite;
}

.fullscreen-count-area:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px var(--shadow);
}

.fullscreen-count-area:active {
    transform: scale(0.98);
}

.fullscreen-count-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.fullscreen-count-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fullscreen-progress {
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
}

.fullscreen-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.fullscreen-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--devotional-saffron), var(--devotional-gold));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.fullscreen-progress-text {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.fullscreen-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.fullscreen-action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px var(--shadow);
}

.fullscreen-action-btn.reset {
    background: var(--warning);
    color: white;
}

.fullscreen-action-btn.reset:hover {
    background: #e68900;
    transform: translateY(-1px);
}

/* Enhanced Buttons */
.btn.danger {
    background: var(--danger);
    color: white;
}

.btn.danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page {
        padding: 16px;
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px 12px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .counter-card {
        padding: 20px;
    }
    
    .count-display {
        font-size: 2.8rem;
    }
    
    .setting-actions {
        flex-direction: column;
    }
    
    .setting-actions .btn {
        width: 100%;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 1.8rem;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 12px;
    }
    
    .home-content {
        padding: 16px;
    }
    
    .app-logo {
        width: 60px;
        height: 60px;
    }
    
    .app-logo i {
        font-size: 2rem;
    }
    
    .app-logo .om-symbol {
        font-size: 2rem;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
    
    .quick-stats {
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px 8px;
    }
    
    .counter-card {
        padding: 16px;
    }
    
    .count-display {
        font-size: 2.5rem;
    }
    
    .settings-section {
        padding: 20px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .setting-item input,
    .setting-item select {
        max-width: 100%;
        width: 100%;
    }
    
    /* Fullscreen counter mobile adjustments */
    .fullscreen-count-area {
        width: 250px;
        height: 250px;
    }
    
    .fullscreen-count-number {
        font-size: 3rem;
    }
    
    .fullscreen-deity {
        font-size: 3rem;
    }
    
    .fullscreen-name {
        font-size: 1.5rem;
    }
    
    .fullscreen-actions {
        flex-direction: column;
        width: 100%;
        max-width: 250px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.3s ease;
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    .page {
        padding-top: 40px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.icon-btn:focus,
.nav-item:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.counter-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}