/* css/brick-wall.css */

/* --- BRICK WALL & HADITH STYLES --- */

/* Hadith Styling */
.hadith-box {
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border-left: 4px solid #01705C;
    text-align: center;
}

.hadith-box em {
    font-family: 'Georgia', serif;
    font-style: italic;
}

/* Brick Appeal Section */
.brick-section {
    padding: 60px 0;
    background: #FFFFFF;
    position: relative;
    z-index: 1;
}

.brick-wall-container {
    background: #252839; 
    padding: 40px 20px 20px; 
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 20px auto 40px;
    overflow: hidden;
    position: relative;
    max-width: 1100px;
    display: flex;        
    flex-direction: column;
}

/* Scroll Indicator */
.scroll-indicator {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

.brick-wall {
    display: flex;
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 4px;
    width: 100%;
    
    /* SCROLLABLE LOGIC */
    max-height: 400px;      
    overflow-y: auto;       
    padding: 15px;            
    margin-bottom: 20px;
    
    /* Custom Scrollbar for Dark Mode */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Webkit Scrollbar Styling */
.brick-wall::-webkit-scrollbar { width: 6px; }
.brick-wall::-webkit-scrollbar-track { background: transparent; }
.brick-wall::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.3); border-radius: 10px; }

/* --- BASE BRICK STYLING (Vertical Stack Fix) --- */
.brick {
    flex: 0 0 calc(6.66% - 4px); 
    aspect-ratio: 2.5/1;
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.3); 
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 0px; 
    color: #FFFFFF; /* Base color for available bricks */
    text-shadow: none;        
    transition: all 0.2s ease-out;
    cursor: pointer;
    position: relative;
    overflow: hidden; 
    text-align: center;
    padding: 2px;
    box-sizing: border-box;
    font-weight: 800;        
    font-size: clamp(9px, 1vw, 12px);         
    line-height: 1.1; 
}

/* Explicit scaling AND COLOR for filled bricks */
.brick.filled span:first-child {
    font-size: clamp(9px, 1vw, 12px);
    font-weight: 900;
    line-height: 1.1;
    display: block;
    color: #252839 !important; /* Force dark initials */
}

.brick.filled span:last-child {
    font-size: clamp(6.5px, 0.7vw, 8px);
    opacity: 0.85;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.2px;
    display: block;
    color: #252839 !important; /* Force dark price */
}

/* Base State (Available) */
.brick.available {
    background-color: rgba(255, 255, 255, 0.08); 
    box-shadow: inset 0 0 5px rgba(255,255,255,0.1);
}

/* Filled State Behaviours */
.brick.filled {
    cursor: default;
    opacity: 1 !important; 
    transform: none !important; 
    background-color: #FFD249 !important;
    /* color override moved to spans above for higher specificity */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.1);
}

/* Hover State (Light Emerald Override) */
.brick.available:hover {
    transform: translateY(-2px) scale(1.05); 
    background-color: rgba(1, 112, 92, 0.8) !important; 
    color: #fff !important; 
    z-index: 10;
    box-shadow: 0 4px 15px rgba(1, 112, 92, 0.5);
    border-color: #fff !important;
}

/* Stats Section */
.brick-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 20px;
    margin-top: auto; 
    flex-wrap: wrap;
    background: #252839; 
    z-index: 5;
}

.brick-stat-item { text-align: center; color: white; }
.brick-stat-item span { display: block; font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.brick-stat-item strong { display: block; font-size: 28px; color: var(--tertiary-color, #FFD249); font-family: "Epilogue", sans-serif; font-weight: 700; }

.brick-cta { text-align: center; margin-top: 20px; }

/* --- Live Brick Purchase Animation --- */
@keyframes brickPop {
    0% { transform: scale(1); }
    50% { 
        transform: scale(1.3); 
        filter: brightness(1.2); 
        background-color: #ffe082 !important; 
        box-shadow: 0 0 20px #FFD249; 
        z-index: 20;
    }
    100% { transform: scale(1); } 
}

.brick-pop { 
    animation: brickPop 0.8s ease-out forwards !important; 
    position: relative;
    z-index: 10; 
}

/* --- Celebration Overlay --- */
.wall-complete-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(46, 52, 51, 0.9);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 3s ease-in-out, visibility 3s ease-in-out;
    z-index: 100;
}
.brick-wall-container.is-complete .wall-complete-overlay { opacity: 1; visibility: visible; }
.brick-wall-container.is-complete .brick-wall { filter: blur(3px); transition: filter 3s ease-in-out; }
.celebration-text { text-align: center; padding: 20px; }
.celebration-text h3 { color: #FFD249; font-size: 48px; margin-bottom: 15px; font-family: "Epilogue", sans-serif; letter-spacing: 2px; text-transform: uppercase; }
.celebration-text p { color: white; font-size: 22px; font-style: italic; font-family: "Poppins", sans-serif; }

/* --- CUSTOM BRICK FEE MODAL --- */
.custom-brick-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    z-index: 99999;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    backdrop-filter: blur(3px);
}
.custom-brick-overlay.show-modal {
    display: flex;
    opacity: 1;
}
.custom-brick-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.2s ease-in-out;
}
.custom-brick-overlay.show-modal .custom-brick-modal {
    transform: translateY(0);
}
.custom-brick-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}
.custom-brick-close:hover { color: #0f172a; }
.btn-outline-custom {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
    border-radius: 50px;
    padding: 12px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: block;
}
.btn-outline-custom:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}