/* style.css - Jewels-Ai: Unified Master Version (v11.9 - Gold Header Icons) */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Montserrat:wght@400;600&display=swap');

/* --- 1. GLOBAL VARIABLES & RESET --- */
:root {
  --accent: #d4af37;           /* Premium Gold */
  --accent-glow: rgba(212, 176, 55, 0.4);
  --bg: #000;
  --text-main: #fff;
}

body { 
  margin: 0; 
  background: var(--bg); 
  font-family: 'Montserrat', sans-serif; 
  overflow: hidden; 
  color: var(--text-main); 
  user-select: none; 
  -webkit-tap-highlight-color: transparent;
}

/* --- 2. AI CONCIERGE "NILA" --- */
#ai-concierge-container {
    position: fixed; bottom: 100px; right: 20px;
    display: flex; flex-direction: column; align-items: flex-end;
    z-index: 5000; pointer-events: none;
}

#ai-avatar {
    width: 60px; height: 60px;
    background: linear-gradient(145deg, #1a1a1a, #000);
    border: 2px solid #d4af37; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; cursor: pointer; pointer-events: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative; transition: transform 0.2s;
}

#ai-avatar:active { transform: scale(0.9); }

.avatar-ring {
    position: absolute; inset: -5px; border-radius: 50%;
    border: 2px solid var(--accent); opacity: 0;
}

.talking .avatar-ring { animation: talkPulse 1.5s infinite; }

@keyframes talkPulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

#ai-bubble {
    background: rgba(255, 255, 255, 0.95);
    color: #000; padding: 10px 15px; border-radius: 15px 15px 0 15px;
    margin-bottom: 10px; font-size: 13px; font-weight: 600;
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    opacity: 0; transform: translateY(10px);
    transition: all 0.3s ease; max-width: 180px; text-align: right;
}

.bubble-visible { opacity: 1 !important; transform: translateY(0) !important; }

/* --- 3. CAMERA & FLASH LAYERS --- */
#flash-overlay {
    position: fixed; inset: 0; background: white; z-index: 9999;
    opacity: 0; pointer-events: none; display: none;
}

.flash-active {
    display: block !important;
    animation: flash-animation 0.25s ease-out forwards;
}

@keyframes flash-animation { 0% { opacity: 0.8; } 100% { opacity: 0; } }

#video-container { 
    position: fixed; inset: 0; z-index: 0; background: black; 
    display: flex; align-items: center; justify-content: center;
}

#webcam, #overlay, #remote-video { 
    position: absolute; width: 100%; height: 100%; 
    object-fit: contain; max-width: 100%; max-height: 100%;
}

#webcam { transform: scaleX(-1); }
#webcam.no-mirror { transform: none !important; }
#overlay { z-index: 1; pointer-events: none; }
#remote-video { z-index: 5; background: #000; display: none; transform: scaleX(1); }
body.hosting #webcam { opacity: 0; }

#loading-status {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85); color: var(--accent); padding: 20px 40px;
    border-radius: 12px; border: 1px solid var(--accent);
    font-family: 'Playfair Display'; font-size: 18px; z-index: 500; backdrop-filter: blur(5px);
}

/* --- 4. TOP CONTROLS (Updated Uniform Gold Icons) --- */
#controls-hero {
  position: fixed; top: 0; left: 0; right: 0; padding: 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
  z-index: 10; display: flex; flex-direction: column; align-items: center;
}

.brand-row { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 800px; }
.brand-logo { height: 40px; }
.action-row { display: flex; gap: 15px; align-items: center; }

/* UNIFORM CIRCLE STYLES FOR TOP ICONS */
#snapshot-btn, #coshop-btn, #stacking-btn, #daily-btn, #voice-btn {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0; 
  border-radius: 50%;
  cursor: pointer; 
  color: var(--accent);
  font-size: 22px; 
  transition: all 0.2s ease;
  width: 48px;
  height: 48px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

#snapshot-btn:hover, #coshop-btn:hover, #stacking-btn:hover, #daily-btn:hover, #voice-btn:hover {
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

#snapshot-btn:active, #coshop-btn:active, #stacking-btn:active, #daily-btn:active, #voice-btn:active { 
    transform: scale(0.95); 
    background: rgba(255,255,255,0.1); 
}

#stacking-btn.active {
    background: var(--accent); 
    color: #000;
    border-color: var(--accent);
}

.voice-off { 
    color: #ff5555 !important; 
    border-color: #ff5555 !important; 
    background: rgba(50, 0, 0, 0.6) !important;
}

/* --- 5. BOTTOM CONTROLS --- */
.controls-panel {
  position: fixed; bottom: 20px; width: 100%; 
  display: flex; flex-direction: column; align-items: center; z-index: 15;
}

#tryall-btn { margin-bottom: 12px; min-width: 120px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }

.pill-group { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; padding: 0 10px; }

.pill {
  padding: 10px 20px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.2); 
  background: rgba(0,0,0,0.6); color: white; font-size: 13px; font-weight: 600; 
  cursor: pointer; backdrop-filter: blur(5px); transition: all 0.2s ease;
}

.pill:hover { background: rgba(255,255,255,0.2); border-color: var(--accent); }
.pill.accent { background: var(--accent); color: #000; border: none; font-weight: 700; box-shadow: 0 0 10px var(--accent-glow); }

.carousel-cards {
  display: flex; gap: 10px; overflow-x: auto; padding: 10px; max-width: 100%;
  scrollbar-width: none; 
}
.carousel-cards::-webkit-scrollbar { display: none; }

.thumb-btn { 
  height: 60px; width: 60px; object-fit: contain; background: rgba(0,0,0,0.6);
  padding: 5px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2); 
  cursor: pointer; transition: transform 0.2s;
}
.thumb-btn:active { transform: scale(0.95); border-color: var(--accent); }

/* --- 6. VOTING UI --- */
.voting-panel {
    position: fixed; bottom: 160px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 20px; z-index: 20;
}
.vote-btn {
    background: rgba(0,0,0,0.8); border: 2px solid var(--accent);
    color: var(--accent); padding: 10px 20px; border-radius: 30px;
    font-weight: bold; cursor: pointer; transition: all 0.2s;
}
.vote-btn:active { transform: scale(0.9); background: var(--accent); color: black; }

#reaction-container { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.floating-reaction {
    position: absolute; bottom: 0; font-size: 50px;
    animation: floatUp 2s ease-in forwards; opacity: 0;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    20% { opacity: 1; transform: translateY(-100px) scale(1.2); }
    100% { transform: translateY(-600px) scale(1); opacity: 0; }
}

/* --- 7. MODALS --- */
#preview-modal, #gallery-modal, #lightbox-overlay, #whatsapp-modal, #coshop-modal, #daily-drop-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 2000;
    display: none; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(8px);
}

.modal-box {
    background: #1a1a1a; padding: 30px; border-radius: 15px; 
    border: 1px solid #d4af37; text-align: center; width: 350px; max-width: 85%;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.preview-container, .lightbox-main { width: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; padding: 20px; }
#preview-image, #lightbox-image { max-width: 100%; max-height: 70vh; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 30px rgba(0,0,0,0.5); }
.preview-actions { margin-top: 20px; display: flex; gap: 15px; }

.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); font-size: 50px; color: rgba(255,255,255,0.6); 
    cursor: pointer; padding: 20px; user-select: none; z-index: 2002; transition: all 0.3s ease;
}
.lightbox-nav:hover { color: var(--accent); transform: translateY(-50%) scale(1.2); }
.prev { left: 10px; } .next { right: 10px; }

.gallery-content {
    background: rgba(18, 18, 18, 0.95); width: 90%; max-width: 900px; height: 80vh; padding: 30px;
    border-radius: 20px; border: 1px solid rgba(212, 175, 55, 0.3); box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    display: flex; flex-direction: column; position: relative; overflow: hidden;
}

.gallery-content h2 {
    margin-top: 0; margin-bottom: 20px; font-size: 26px; text-transform: uppercase; letter-spacing: 2px;
    background: linear-gradient(to right, #d4af37, #fdf5e6); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;
}

#gallery-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px; overflow-y: auto; padding: 10px; flex-grow: 1;
}

.gallery-card {
    position: relative; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden;
    cursor: pointer; background: #000; border: 1px solid rgba(255,255,255,0.1); transition: transform 0.3s ease;
}
.gallery-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.gallery-img { width: 100%; height: 100%; object-fit: cover; }

.gallery-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    padding: 20px 10px 10px 10px; display: flex; justify-content: space-between; align-items: flex-end;
    opacity: 0; transform: translateY(10px); transition: all 0.3s ease;
}
.gallery-card:hover .gallery-overlay { opacity: 1; transform: translateY(0); }
.overlay-text { font-size: 14px; color: #fff; font-weight: 600; text-transform: uppercase; }

/* --- 8. ROBUST CLOSE BUTTONS --- */
.close-preview, .close-gallery, .close-lightbox { 
    position: absolute; 
    top: 20px; 
    right: 25px; 
    font-size: 40px; 
    font-weight: bold;
    color: #fff; 
    cursor: pointer; 
    z-index: 2147483647;
    background: rgba(0, 0, 0, 0.6); 
    width: 60px; 
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    line-height: 1;
    pointer-events: auto !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.close-preview:hover, .close-gallery:hover, .close-lightbox:hover { 
    color: var(--accent); 
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    border-color: var(--accent);
}

/* --- 9. SPINNER --- */
#process-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 4000;
    display: none; align-items: center; justify-content: center;
}
.spinner {
    width: 50px; height: 50px; margin: 0 auto 15px auto;
    border: 4px solid rgba(255,255,255,0.1); border-top: 4px solid var(--accent);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* --- 10. TOAST NOTIFICATION --- */
#toast-notification {
  visibility: hidden; min-width: 250px; background-color: #333; color: #d4af37;
  text-align: center; border-radius: 4px; padding: 16px; position: fixed;
  z-index: 9999; left: 50%; top: 100px; bottom: auto; transform: translateX(-50%);
  font-size: 17px; font-family: 'Montserrat', sans-serif; border: 1px solid #d4af37;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
#toast-notification.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {top: 0; opacity: 0;} to {top: 100px; opacity: 1;} }
@keyframes fadeout { from {top: 100px; opacity: 1;} to {top: 0; opacity: 0;} }

/* --- 11. WELCOME SCREEN FEATURE PILLS --- */
.wps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  animation: fdup .9s cubic-bezier(.16,1,.3,1) .4s both;
  max-width: 680px;
  padding: 0 10px;
}

.wp {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 18px;
  border: 1px solid rgba(201,168,76,0.18);
  background: rgba(15,10,2,0.55);
  backdrop-filter: blur(12px);
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 300px;
  transition: border-color .25s, background .25s;
}

.wp:hover {
  border-color: rgba(201,168,76,0.4);
  background: rgba(25,16,2,0.7);
}

/* Dark icon box */
.wp-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(8,6,1,0.85);
  border: 1px solid rgba(201,168,76,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wp-icon svg {
  width: 20px;
  height: 20px;
}

.wp-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.wp-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(244,237,224,0.95);
  line-height: 1.2;
}

.wp-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .03em;
  color: rgba(201,168,76,0.55);
  margin-top: 0;
  line-height: 1.3;
}

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