/* --- ১. ফন্ট এবং গ্লোবাল রিসেট --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* --- ২. বডি এবং ব্যাকগ্রাউন্ড --- */
body {
    background-color: #0f172a; 
    /* মডার্ন রেডিয়াল ব্যাকগ্রাউন্ড গ্লো */
    background-image: radial-gradient(at 50% 0%, rgba(59, 130, 246, 0.1) 0, transparent 50%), 
                      radial-gradient(at 50% 100%, rgba(99, 102, 241, 0.1) 0, transparent 50%);
    background-attachment: fixed;
    color: #f1f5f9;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- ৩. এনিমেশন কি-ফ্রেম (Animation Keyframes) --- */

/* কার্ড এবং লোগো পপ-ইন */
@keyframes popIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* উপর থেকে আসা (Navbar) */
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* নিচ থেকে আসা (Inputs/Buttons) */
@keyframes slideInUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ব্যাকগ্রাউন্ড কালার ফ্লো */
@keyframes gradientFlowNormal {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* লোগো টেক্সট এনিমেশন (JS এর জন্য ক্লাস) */
@keyframes comeFromTop { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes comeFromBottom { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes comeFromRight { 0% { opacity: 0; transform: translateX(20px); } 100% { opacity: 1; transform: translateX(0); } }

/* --- ৪. ন্যাভবার (Navbar) - FIX APPLIED --- */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    padding: 15px 5%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 70px;
    position: sticky; top: 0; z-index: 1000;
    animation: slideDown 0.8s ease-out forwards;
}

/* লোগো কন্টেইনার ফিক্স (যাতে ইমেজ এবং টেক্সট সোজা থাকে) */
.navbar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    height: 100%;
}

/* লোগো ইমেজ বক্স */
.icon-box {
    width: 40px; 
    height: 40px;
    border-radius: 10px;
    overflow: hidden; /* ইমেজ বাইরে যাবে না */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ইমেজ যাতে বক্সে পারফেক্টলি ফিট হয় */
.icon-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* লোগো টেক্সট স্টাইল এবং অ্যালাইনমেন্ট */
.logo-text {
    font-size: 1.5rem; 
    font-weight: 700;
    color: #3b82f6;
    display: flex; /* স্প্যানগুলো পাশাপাশি রাখার জন্য */
    align-items: center;
    white-space: pre; 
}

/* JS দিয়ে জেনারেট করা স্প্যানগুলোর স্টাইল */
.logo-letter {
    display: inline-block;
    opacity: 0; 
    animation-duration: 0.5s;
    animation-fill-mode: forwards;
}

/* --- ৫. মেইন কন্টেইনার --- */
.main-container {
    max-width: 900px; width: 95%;
    margin: 40px auto;
    flex: 1; 
}

/* --- ৬. টুল কার্ড (Tool Container) --- */
.tool-container {
    padding: 40px 30px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 25%, #312e81 50%, #1e1b4b 75%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientFlowNormal 15s ease infinite, popIn 0.8s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* --- ৭. টুল হেডার --- */
.tool-header {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 20px; 
    margin-bottom: 40px; 
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* টুল লোগো ইমেজ বক্স */
.tool-logo {
    width: 64px; 
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px; 
    padding: 8px; /* ইমেজের চারপাশে প্যাডিং */
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.tool-logo img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; /* আইকন পুরোটা দেখাবে */
}

.tool-title {
    font-size: 2rem; color: white;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    margin: 0;
}

/* --- ৮. কনভার্টার বক্স (Inputs) --- */
.converter-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    animation: slideInUp 0.8s ease-out 0.3s forwards;
}

/* ইনপুট ব্লক */
.input-block {
    flex: 1;
    background: rgba(15, 23, 42, 0.6);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: 0.3s;
    min-width: 250px;
}
.input-block:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.input-block label {
    display: block; color: #94a3b8; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500;
}

/* ইনপুট ফিল্ড */
.input-block input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 600;
    padding-bottom: 5px;
    margin-bottom: 15px;
    outline: none;
    transition: 0.3s;
}
.input-block input:focus {
    border-color: #3b82f6;
}

/* ড্রপডাউন এরিয়া */
.split-select {
    display: flex; align-items: center; gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

select {
    background: transparent; border: none; color: #cbd5e1;
    font-size: 0.9rem; cursor: pointer; outline: none; flex: 1;
}
select option { background: #1e293b; color: #fff; }

.divider { color: #64748b; font-weight: bold; font-size: 1.2rem; }

/* সোয়াপ বাটন (Exchange Icon) */
.exchange-icon {
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    border-radius: 50%;
    color: white; font-size: 1.2rem; cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: 0.4s;
    flex-shrink: 0; /* বাটন যাতে চ্যাপ্টা না হয় */
}
.exchange-icon:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

/* --- ৯. ফর্মুলা বক্স --- */
.formula-box {
    margin-top: 30px;
    text-align: center; color: #94a3b8; font-size: 0.95rem;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,0.1);
    opacity: 0;
    animation: slideInUp 0.8s ease-out 0.6s forwards;
}
.formula-box b { color: #fff; }
.formula-box i { margin-right: 5px; color: #3b82f6; }

/* --- ১০. ফুটার --- */
footer {
    text-align: center; padding: 25px;
    color: #64748b; font-size: 0.9rem;
    background: #0b0f19;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

/* --- ১১. রেসপন্সিভ (Mobile) --- */
@media (max-width: 768px) {
    .tool-header { flex-direction: column; text-align: center; gap: 10px; }
    
    .converter-box { flex-direction: column; gap: 15px; }
    
    .input-block { width: 100%; }
    
    .exchange-icon { 
        transform: rotate(90deg); /* মোবাইলে আইকন লম্বালম্বি */
        margin: 5px 0;
    }
    .exchange-icon:hover { transform: rotate(270deg) scale(1.1); }
    
    .tool-title { font-size: 1.6rem; }
}