/* Project: Light Detective Renewal
    Description: Main Stylesheet
    Optimized for: Mobile, SEO, Performance
*/

/* -------------------------------------------------- */
/* 1. Base Styles & Fonts */
/* -------------------------------------------------- */
body { 
    font-family: 'Noto Sans KR', sans-serif; 
    background-color: #030712; 
    color: #D1D5DB; 
    overflow-x: hidden; 
}

/* Utility Colors */
.gold-text { color: #D4AF37; }
.gold-bg { background-color: #D4AF37; }
.border-gold { border-color: #D4AF37; }

.text-shadow-lg { text-shadow: 0 4px 10px rgba(0,0,0,0.8); }

/* -------------------------------------------------- */
/* 2. Security Curtain & Loading */
/* -------------------------------------------------- */
#security-curtain {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #030712;
    z-index: 999999;
    display: flex; justify-content: center; align-items: center; flex-direction: column;
    color: #6b7280; font-size: 0.8rem;
    transition: opacity 0.5s ease;
}
.security-spinner {
    width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #D4AF37; border-radius: 50%;
    animation: spin 1s linear infinite; margin-bottom: 15px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* -------------------------------------------------- */
/* 3. Hero Section */
/* -------------------------------------------------- */
.hero-section {
    position: relative; height: 100vh; min-height: 600px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background-color: #000;
    background-image: url('https://images.unsplash.com/photo-1496568816309-51d7c20e3b21?q=80&w=2531&auto=format&fit=crop');
    background-size: cover; background-position: center; background-attachment: fixed;
}
.hero-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(3,7,18,0.4) 0%, rgba(3,7,18,0.95) 100%); z-index: 1;
}
.hero-content { position: relative; z-index: 10; padding: 0 1rem; }

/* -------------------------------------------------- */
/* 4. Service Cards & Animations */
/* -------------------------------------------------- */
.service-card { transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15); border-color: rgba(212, 175, 55, 0.5);
}

@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.animate-scroll { display: flex; animation: scroll 40s linear infinite; width: max-content; }
.animate-scroll-container:hover .animate-scroll { animation-play-state: paused; }

/* -------------------------------------------------- */
/* 5. Security Warning Popup */
/* -------------------------------------------------- */
.security-warning-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9); z-index: 99990;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.security-warning-overlay.active { opacity: 1; pointer-events: auto; }
.security-box {
    background: #111827; border: 2px solid #ef4444; padding: 2rem; border-radius: 1rem; text-align: center;
    max-width: 90%; width: 400px; box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
    animation: warningPulse 2s infinite;
}
@keyframes warningPulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* -------------------------------------------------- */
/* 6. Chat & Mobile Interface */
/* -------------------------------------------------- */
.mobile-bottom-bar {
    position: fixed; bottom: 0; left: 0; right: 0; background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px); border-top: 1px solid #374151;
    padding-bottom: env(safe-area-inset-bottom); z-index: 50; display: flex;
}
.chat-container {
    position: fixed; bottom: 100px; right: 24px; width: 350px; height: 500px;
    background-color: #111827; border: 1px solid #374151; border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); display: flex; flex-direction: column;
    z-index: 60; transform: translateY(120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-container.open { transform: translateY(0); }

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.message {
    max-width: 80%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}
.message.user {
    background-color: #D4AF37;
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}
.message.consultant {
    background-color: #374151;
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 0;
}
.message.system {
    background-color: transparent;
    color: #9CA3AF;
    align-self: center;
    font-size: 0.75rem;
    text-align: center;
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 0.25rem 1rem;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: #1f2937; }
.chat-messages::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 3px; }

/* -------------------------------------------------- */
/* 7. Blog & Cards */
/* -------------------------------------------------- */
.blog-card {
    width: 200px;       
    height: 200px;      
    flex-shrink: 0;
    margin-right: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    user-select: none;
    overflow: hidden;
    background-color: #111827;
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(212, 175, 55, 0.2);
    border-color: #D4AF37;
}

/* -------------------------------------------------- */
/* 8. Floating UI */
/* -------------------------------------------------- */
.floating-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 50;
}

.floating-btn {
    width: 3.5rem; 
    height: 3.5rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    position: relative;
    font-size: 1.25rem; 
    background-color: #1f2937;
    overflow: hidden;
}
.floating-btn:hover { transform: scale(1.1); }

/* -------------------------------------------------- */
/* 9. FAQ & Popups */
/* -------------------------------------------------- */
.faq-question { cursor: pointer; transition: background-color 0.3s ease; }
.faq-question:hover { background-color: #1f2937; }
.faq-answer {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background-color: #111827; 
}
.faq-answer p { padding: 1.5rem; line-height: 1.8; color: #9CA3AF; }
.faq-answer.active { max-height: 500px; transition: max-height 0.4s ease-in; }

.popup-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.popup-overlay.show { opacity: 1; pointer-events: auto; }
.popup-content {
    background-color: #ffffff; color: #1a202c;
    width: 90%; max-width: 400px;
    border-radius: 1rem; padding: 2rem;
    position: relative; text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9); transition: transform 0.3s ease;
}
.popup-overlay.show .popup-content { transform: scale(1); }
.popup-close {
    position: absolute; top: 10px; right: 15px;
    font-size: 1.5rem; color: #a0aec0;
    cursor: pointer; transition: color 0.2s;
}
.popup-close:hover { color: #4a5568; }

/* -------------------------------------------------- */
/* 10. Responsive & Layout Adjustments */
/* -------------------------------------------------- */
#mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0; opacity: 0; overflow: hidden;
}
#mobile-menu.open { max-height: 500px; opacity: 1; }

.why-section {
    padding-top: 2rem; padding-bottom: 2.5rem;
    background-color: #1f2937;
}
@media (min-width: 768px) {
    .why-section { padding-top: 5rem; padding-bottom: 5rem; }
    .chat-container { width: 90%; right: 5%; bottom: 100px; height: 60vh; }
}