/* Beranda - Fun Mobile Game Theme */

/* Disable text selection for mobile app */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Header with Islamic Pattern - Cool Vibrant Blue Theme */
.dashboard-header-home {
    background: linear-gradient(135deg, #0077b6 0%, #0096c7 40%, #00b4d8 100%);
    backdrop-filter: blur(10px);
    padding: 20px 15px 25px 15px;
    padding-top: max(20px, env(safe-area-inset-top) + 20px);
    position: relative;
    overflow: visible;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 30px rgba(0, 119, 182, 0.5), 0 4px 15px rgba(0, 180, 216, 0.3);
    border-bottom: 4px solid #48cae4;
}

/* Removed decorative top stripe pattern */

/* Game-style bottom notch */
.dashboard-header-home::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 10px;
    background: linear-gradient(135deg, #0096c7 0%, #00b4d8 100%);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 15px rgba(0, 150, 199, 0.5);
    border-left: 3px solid #48cae4;
    border-right: 3px solid #48cae4;
    border-bottom: 3px solid #48cae4;
}

.islamic-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(212, 197, 169, 0.15) 2px, transparent 2px),
        radial-gradient(circle at 85% 30%, rgba(212, 197, 169, 0.15) 2px, transparent 2px),
        radial-gradient(circle at 25% 80%, rgba(212, 197, 169, 0.1) 1.5px, transparent 1.5px),
        radial-gradient(circle at 75% 85%, rgba(212, 197, 169, 0.1) 1.5px, transparent 1.5px);
    background-size: 200px 200px, 200px 200px, 150px 150px, 150px 150px;
    opacity: 0.5;
    pointer-events: none;
}

.header-content-home {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.greeting-section {
    flex: 1;
}

.greeting-text {
    color: white;
}

.arabic-greeting {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.9;
    font-family: 'Traditional Arabic', Arial, sans-serif;
}

.greeting-text h1 {
    font-size: 1.5em;
    margin: 0 0 4px 0;
    font-weight: 700;
    color: white;
}

.tagline {
    font-size: 0.85em;
    opacity: 0.85;
    margin: 0;
}

.user-avatar-wrapper-home {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    padding: 3px;
    background: linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.9));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.user-avatar-wrapper-home:hover {
    transform: scale(1.1) rotate(5deg);
}

.user-avatar-img-home {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-icon-home {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.user-avatar-icon-home svg {
    width: 100%;
    height: 100%;
}

/* bounce-in animation removed for instant load */

.user-avatar-home.placeholder {
    background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.15));
}

/* Main Content */
.dashboard-main-home {
    padding: 20px 15px 100px;
    background: transparent;
}

/* Profile Summary Card - Blue with purple touch */
.profile-summary-card {
    background: linear-gradient(135deg, #0077b6 0%, #0088cc 40%, #6366f1 100%);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 119, 182, 0.5);
}

/* slide-up animation removed for instant load */

.profile-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
}

.level-badge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    border: 3px solid #065f46;
    position: relative;
}

/* levelPulse animation removed */

/* spin-in and pulse-glow animations removed for instant load */

.level-badge::before {
    content: 'LV';
    position: absolute;
    top: -8px;
    font-size: 0.6em;
    color: #0f172a;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.level-number {
    font-size: 1.5em;
    font-weight: 700;
    color: white;
}

.progress-info {
    flex: 1;
}

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

.progress-label {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.progress-text {
    font-size: 0.9em;
    color: #ffffff;
    font-weight: 700;
}

.progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #047857 0%, #10b981 50%, #34d399 100%);
    border-radius: 20px;
    transition: width 0.5s ease;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

/* shimmer animation removed */

.currency-display {
    display: flex;
    gap: 12px;
}

.currency-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.currency-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.currency-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #ffffff;
}

/* Daily Ayah Card */
.daily-ayah-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: 20px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15);
    border: 3px solid rgba(251, 191, 36, 0.5);
    overflow: hidden;
}

.daily-ayah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-bottom: none;
}

.daily-ayah-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95em;
}

.daily-ayah-title svg {
    fill: #ffffff;
}

.shuffle-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shuffle-btn svg {
    fill: #ffffff;
}

.shuffle-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(180deg);
}

.shuffle-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.daily-ayah-content {
    padding: 20px 18px;
    text-align: center;
}

.daily-ayah-content .arabic-text {
    font-family: 'Amiri Quran', 'KFGQPC Uthmanic Script HAFS', 'Traditional Arabic', 'Scheherazade New', serif;
    font-size: 1.8em;
    line-height: 2.2;
    color: #78350f;
    direction: rtl;
    margin-bottom: 16px;
    text-align: center;
}

.daily-ayah-content .translation-text {
    font-size: 0.95em;
    color: #92400e;
    line-height: 1.6;
    font-style: italic;
}

.ayah-loading {
    color: #d97706;
    padding: 20px;
}

.daily-ayah-footer {
    padding: 12px 18px;
    background: rgba(251, 191, 36, 0.15);
    border-top: 2px solid rgba(251, 191, 36, 0.3);
}

.ayah-reference {
    font-size: 0.85em;
    color: #b45309;
    font-weight: 600;
}

/* Play Modes - Large Game Cards */
.play-modes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.play-mode-card {
    background: linear-gradient(135deg, #0077b6 0%, #0088cc 40%, #6366f1 100%);
    border-radius: 20px;
    padding: 0;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.7);
    position: relative;
    cursor: pointer;
}

.play-mode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.play-mode-card:active {
    transform: translateY(0);
}

.mode-icon-wrapper {
    padding: 20px 20px 0 20px;
    display: flex;
    justify-content: center;
}

.mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #047857 0%, #10b981 50%, #34d399 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* iconShine animation removed */

.play-mode-card:hover .mode-icon {
    transform: scale(1.05);
}

.mode-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.mode-content {
    padding: 16px 20px 20px;
    text-align: center;
}

.mode-content h3 {
    font-size: 1.3em;
    color: #ffffff;
    margin: 0 0 6px 0;
    font-weight: 700;
}

.mode-content p {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 12px 0;
}

.mode-preview {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    font-family: 'Amiri Quran', 'Traditional Arabic', 'Arabic Typesetting', serif;
    font-size: 1.3em;
    color: #ffffff;
    direction: rtl;
    line-height: 1.8;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Game Card - Creative Layout - Blue with purple touch */
.mode-game {
    background: linear-gradient(135deg, #0077b6 0%, #0088cc 40%, #6366f1 100%);
    border: 3px solid rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.mode-game::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.game-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #047857, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.game-icon-badge svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.game-title-text h3 {
    margin: 0;
    font-size: 1.1em;
    color: #ffffff;
    font-weight: 700;
}

.game-title-text p {
    margin: 2px 0 0 0;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.85);
}

.level-badge-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #047857, #10b981);
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
    min-width: 50px;
}

.level-badge-preview .level-text {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 700;
    letter-spacing: 1px;
}

.level-badge-preview .level-value {
    font-size: 1.4em;
    color: white;
    font-weight: 700;
    line-height: 1;
}

.game-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px 18px;
}

.game-stat-box {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.game-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.points-box {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

.progress-box {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

.stat-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.stat-info-box {
    flex: 1;
    min-width: 0;
}

.stat-value-large {
    font-size: 1.3em;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.stat-label-small {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    margin-top: 2px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.play-now-btn {
    margin: 0 18px 16px 18px;
    background: linear-gradient(135deg, #ffffff, #e0f2fe);
    color: #0077b6;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow:
        0 4px 15px rgba(0, 119, 182, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
    position: relative;
    z-index: 5;
}

.play-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 119, 182, 0.4);
}

.play-now-btn svg {
    /* pulse-play animation removed for instant load */
}

/* Affiliate Card Styles */
.mode-affiliate {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    position: relative;
    overflow: hidden;
    border: 3px solid rgba(16, 185, 129, 0.3) !important;
}

.mode-affiliate::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.affiliate-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 2px solid rgba(16, 185, 129, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.affiliate-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.affiliate-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #047857, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.affiliate-icon-badge svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.affiliate-title-text h3 {
    margin: 0;
    font-size: 1.1em;
    color: #e2e8f0;
    font-weight: 700;
}

.affiliate-title-text p {
    margin: 2px 0 0 0;
    font-size: 0.75em;
    color: #94a3b8;
}

.affiliate-reward-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    padding: 8px 14px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(255, 165, 0, 0.4);
    min-width: 55px;
}

.affiliate-reward-badge .reward-percent {
    font-size: 1.3em;
    color: white;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.affiliate-reward-badge .reward-text {
    font-size: 0.6em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.affiliate-benefits {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
}

.benefit-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 12px;
    border-radius: 10px;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.benefit-item svg {
    width: 20px;
    height: 20px;
    fill: #FFD700;
    flex-shrink: 0;
}

.benefit-item span {
    font-size: 0.8em;
    color: #e2e8f0;
    font-weight: 600;
}

.affiliate-cta-btn {
    margin: 0 18px 16px 18px;
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95em;
    box-shadow:
        0 4px 15px rgba(16, 185, 129, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.affiliate-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .dashboard-header-home {
        padding: 16px 12px;
    }

    .arabic-greeting {
        font-size: 1em;
    }

    .greeting-text h1 {
        font-size: 1.3em;
    }

    .tagline {
        font-size: 0.8em;
    }

    .user-avatar-home {
        width: 55px;
        height: 55px;
        font-size: 1.3em;
    }

    .profile-summary-card {
        padding: 14px;
    }

    .level-badge {
        width: 55px;
        height: 55px;
    }

    .level-number {
        font-size: 1.3em;
    }

    .currency-item {
        padding: 10px;
    }

    .currency-icon {
        width: 28px;
        height: 28px;
    }

    .currency-value {
        font-size: 1.1em;
    }

    .mode-icon {
        width: 70px;
        height: 70px;
    }

    .mode-icon svg {
        width: 36px;
        height: 36px;
    }

    .mode-content h3 {
        font-size: 1.2em;
    }

    .mode-preview {
        font-size: 1.2em;
        padding: 14px;
    }

    .game-card-header {
        padding: 14px 16px;
    }

    .game-icon-badge {
        width: 40px;
        height: 40px;
    }

    .game-icon-badge svg {
        width: 22px;
        height: 22px;
    }

    .game-title-text h3 {
        font-size: 1.05em;
    }

    .level-badge-preview {
        padding: 6px 10px;
        min-width: 45px;
    }

    .level-badge-preview .level-value {
        font-size: 1.3em;
    }

    .game-stats-grid {
        gap: 8px;
        padding: 14px 16px;
    }

    .game-stat-box {
        padding: 10px;
    }

    .stat-icon-circle {
        width: 36px;
        height: 36px;
    }

    .stat-value-large {
        font-size: 1.2em;
    }

    .stat-label-small {
        font-size: 0.65em;
    }

    .play-now-btn {
        margin: 0 16px 14px 16px;
        padding: 10px 18px;
        font-size: 0.9em;
    }

    /* Affiliate card mobile */
    .affiliate-card-header {
        padding: 14px 16px;
    }

    .affiliate-icon-badge {
        width: 40px;
        height: 40px;
    }

    .affiliate-icon-badge svg {
        width: 22px;
        height: 22px;
    }

    .affiliate-title-text h3 {
        font-size: 1.05em;
    }

    .affiliate-reward-badge {
        padding: 6px 10px;
        min-width: 50px;
    }

    .affiliate-reward-badge .reward-percent {
        font-size: 1.2em;
    }

    .affiliate-benefits {
        gap: 8px;
        padding: 12px 16px;
    }

    .benefit-item {
        padding: 8px 10px;
    }

    .benefit-item svg {
        width: 18px;
        height: 18px;
    }

    .benefit-item span {
        font-size: 0.75em;
    }

    .affiliate-cta-btn {
        margin: 0 16px 14px 16px;
        padding: 10px 18px;
        font-size: 0.9em;
    }
}
