/* ===== Original RapidTables Style ===== */
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
html, body { margin: 0px; padding: 0px; color: #222; font-size: 16px; font-family: Arial, Verdana, Helvetica, sans-serif; border-style: none; min-height: 100%; scroll-behavior: smooth; }
body { line-height: unset !important; background: #fff; }

/* ===== HEADER ===== */
#header { background: #f0f0d0; width: 100%; z-index: 100; position: sticky; top: 0; }
#header p, #header a { line-height: 1; font-size: x-large; font-weight: bold; text-decoration: none; color: #444; }
#header a:hover { color: #dd6600; }
#header>div { width: 1000px; margin: 0 auto; padding: 0px; }
#header { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; }
#header>div { display: flex; align-items: center; }

/* ===== LOGO ===== */
#logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px;
}
#logo img {
    height: auto;
    width: 180px;
    display: block;
}
#logo a {
    font-size: 24px;
    font-weight: bold;
    color: #444;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
#logo a:hover { color: #dd6600; }
#logo a:hover img { opacity: 0.8; }

/* ===== Desktop Menu ===== */
#tooldiv {
    display: flex;
    margin-left: auto;
    margin-right: 20px;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
#tooldiv>a {
    line-height: 61px;
    color: #444;
    font-size: 1rem;
    padding-left: 14px;
    padding-right: 14px;
    text-decoration: none;
    cursor: pointer;
}
#tooldiv>a:hover {
    color: #fff;
    background: #444;
    text-decoration: none;
}

/* ===== LANGUAGE DROPDOWN (Desktop) ===== */
.lang-selector {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 5px;
}
.lang-selector .current-lang {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
    border: 1px solid #d0d0c0;
    font-size: 0.85rem;
    transition: background 0.2s;
    user-select: none;
}
.lang-selector .current-lang:hover {
    background: rgba(255,255,255,0.8);
}
.lang-selector .current-lang .flag {
    font-size: 0.9rem;
}
.lang-selector .current-lang .lang-name {
    font-weight: 500;
    font-size: 0.85rem;
}
.lang-selector .current-lang .arrow {
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.2s;
}
.lang-selector .current-lang .arrow.open {
    transform: rotate(180deg);
}
.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #d0d0c0;
    border-radius: 4px;
    min-width: 170px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    margin-top: 4px;
    padding: 4px 0;
}
.lang-dropdown.open {
    display: block;
}
.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    color: #444;
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5ed;
    transition: background 0.15s;
}
.lang-dropdown a:hover {
    background: #f0f0d0;
    text-decoration: none;
    color: #444;
}
.lang-dropdown a:last-child {
    border-bottom: none;
}
.lang-dropdown a .flag {
    font-size: 1rem;
}
.lang-dropdown a .lang-name {
    flex: 1;
    font-size: 0.85rem;
}
.lang-dropdown a .check {
    color: #28a745;
    font-size: 0.75rem;
}
.lang-dropdown a.active-lang {
    background: #f0f0d0;
    font-weight: 600;
}

/* ===== HAMBURGER MENU ===== */
.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #444;
    cursor: pointer;
    padding: 8px 10px;
    line-height: 1;
    margin-left: auto;
    z-index: 301;
}
.hamburger-btn:hover { 
    color: #dd6600; 
}
.hamburger-btn:focus {
    outline: none;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #f0f0d0;
    border-top: 1px solid #d0d0c0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 300;
    padding: 8px 0;
    flex-direction: column;
}
.mobile-menu.open { 
    display: flex !important; 
}
.mobile-menu a {
    display: block;
    padding: 10px 20px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background 0.15s;
}
.mobile-menu a:hover { 
    background: rgba(0,0,0,0.05); 
    color: #dd6600; 
}
.mobile-menu a:last-child { 
    border-bottom: none; 
}
.mobile-menu a i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 14px;
}
.mobile-menu a .flag {
    margin-right: 5px;
}
.mobile-lang-divider {
    margin: 5px 15px;
    border-color: #d0d0c0;
    border-style: solid;
    border-width: 1px 0 0 0;
}

/* ===== RTL Support ===== */
[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}
[dir="rtl"] .input-wrap .unit-badge {
    border-radius: 4px 0 0 4px;
    border-left: none;
    border-right: 1px solid #ccc;
}
[dir="rtl"] .input-wrap {
    padding: 0 15px 0 0;
}
[dir="rtl"] .quick-convert span {
    margin-right: 0;
    margin-left: 5px;
}
[dir="rtl"] .result-box .badge-conversion {
    margin-right: 10px;
}
[dir="rtl"] .mobile-menu a i {
    margin-right: 0;
    margin-left: 8px;
}

/* ===== WRAPPER ===== */
#wrapper { max-width: 1000px; margin: 0 auto; border-width: 0; padding: 0 5px 20px 5px; }
#nav { color: #000; clear: left; line-height: 2; padding: 6px 0; border-bottom: 1px #ddd solid; margin-bottom: 15px; }
#nav a { line-height: 2; padding: 11px 4px; color: #000; text-decoration: none; cursor: pointer; }
#nav a:first-child { margin-left: -5px; padding-left: 5px; padding-right: 7px; }
#nav a:hover { background: #f0f0d0; }
#lcol { display: inline-block; vertical-align: top; width: 650px; padding-right: 10px; }
#doc { padding: 0px; padding-right: 20px; margin-left: 0px; }
#rcol { padding: 20px 0px 10px 0px; display: inline-block; vertical-align: top; width: 300px; }

/* ===== FOOTER ===== */
#footer { padding: 30px; clear: both; text-align: center; line-height: 200%; border-top: 1px solid #ddd; background: #eee; font-size: large; }
#footer a { padding: 8px 5px 8px 5px; text-decoration: none; color: #333; cursor: pointer; }
#footer a:hover { color: #fff; background: #666; }

/* ===== TYPOGRAPHY ===== */
#wrapper p, body h1, body h2, body h3, body h4, body h5 { line-height: 1.8; }
#wrapper a { line-height: 2; }
#wrapper P { margin-top: 2px; margin-bottom: 2px; }
#wrapper TABLE { margin-bottom: 5px; }
#wrapper TH { background: #E0E0E0; font-style: normal; }
#wrapper TD { padding-right: 5px; padding-left: 5px; }
#wrapper UL, UL UL { font-size: 1em; list-style-position: outside; }
#wrapper LI { margin-top: 2px; }
#rcol li { margin-left: -11px; }
#wrapper H1, H2, H3 { font-weight: normal; }
H1 { margin-bottom: 4px; padding-bottom: 0px; color: #333333; font-size: 1.8em; margin-top: 0; }
H2 { font-size: 1.4em; letter-spacing: 0px; margin-top: 10px; margin-bottom: 3px; }
H3 { font-size: 1.4em; letter-spacing: 0px; margin-top: 10px; margin-bottom: 3px; }
H4 { font-size: 1.1em; margin-top: 5px; margin-bottom: 2px; font-weight: bold; }
#rcol H5 { font-size: 0.9em; font-weight: bold; margin-top: 5px; margin-bottom: 2px; background: #e0e0e0; padding: 5px 5px 5px 10px; }

/* ===== LINKS ===== */
a:link { text-decoration: none; color: #083d8d; }
a:visited { text-decoration: none; color: #083d8d; }
a:active { text-decoration: underline; color: #000000; }
a:hover { text-decoration: underline; color: #000; }

/* ===== CONVERTER ===== */
.converter-card { background: #fafaf5; border-radius: 7px; padding: 20px; border: 1px solid #d0d0c0; margin-top: 10px; }
.input-wrap { display: flex; align-items: center; background: #fff; border-radius: 4px; padding: 0 0 0 15px; border: 1px solid #ccc; }
.input-wrap input { border: none; background: transparent; padding: 0.6rem 0; font-size: 1.2rem; width: 100%; outline: none; font-family: Arial, sans-serif; }
.input-wrap .unit-badge { background: #f0f0d0; padding: 0.3rem 1.2rem; border-radius: 0 4px 4px 0; font-weight: 600; color: #444; font-size: 0.8rem; border-left: 1px solid #ccc; }
.result-box { background: #f8f8f0; border-radius: 7px; padding: 0.8rem 1.8rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 1.8rem; border: 1px solid #d0d0c0; }
.result-value { font-size: 2.2rem; font-weight: 700; color: #083d8d; }
.badge-conversion { background: #e8f0e8; color: #2d6a2d; padding: 0.2rem 1.2rem; border-radius: 40px; font-size: 0.8rem; border: 1px solid #b8d9b8; }
.btn-success { background-color: #28a745; border-color: #28a745; }
.btn-success:hover { background-color: #218838; }
.btn-secondary { background-color: #6c757d; border-color: #6c757d; }
.btn-secondary:hover { background-color: #5a6268; }
.btn { border-radius: 4px; }
.quick-convert { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick-convert .btn-sm { padding: 4px 12px; font-size: 0.8rem; background: #f0f0d0; border: 1px solid #ccc; color: #444; border-radius: 4px; cursor: pointer; transition: 0.15s; font-family: Arial, sans-serif; }
.quick-convert .btn-sm:hover { background: #e0e0c0; }

/* ===== TABLE ===== */
.edu-table tr { animation: fadeSlide 0.4s ease forwards; opacity: 0; }
.edu-table tr:nth-child(1) { animation-delay: 0.05s; }
.edu-table tr:nth-child(2) { animation-delay: 0.10s; }
.edu-table tr:nth-child(3) { animation-delay: 0.15s; }
.edu-table tr:nth-child(4) { animation-delay: 0.20s; }
.edu-table tr:nth-child(5) { animation-delay: 0.25s; }
.edu-table tr:nth-child(6) { animation-delay: 0.30s; }
.edu-table tr:nth-child(7) { animation-delay: 0.35s; }
.edu-table tr:nth-child(8) { animation-delay: 0.40s; }
.edu-table tr:nth-child(9) { animation-delay: 0.45s; }
.edu-table tr:nth-child(10) { animation-delay: 0.50s; }
@keyframes fadeSlide { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }
.edu-table tr:hover td { background: #f0f0d0 !important; }

/* ===== FAQ ===== */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.faq-item { background: #f8f8f0; padding: 15px 20px; border-radius: 7px; border: 1px solid #d0d0c0; }
.faq-item h4 { font-size: 1rem; font-weight: bold; margin-bottom: 5px; }
.faq-item h4 i { color: #083d8d; margin-right: 8px; }
.faq-item p { font-size: 0.9rem; color: #444; margin: 0; }

/* ===== PAGE SECTIONS ===== */
.page-section { display: none; }
.page-section.active { display: block; }
#home-section { display: block; }
.section-anchor { scroll-margin-top: 80px; }

/* ===== LIVE INDICATOR ===== */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 12px 2px 8px;
    border-radius: 30px;
    border: 1px solid rgba(40, 167, 69, 0.2);
    animation: livePulse 2s ease-in-out infinite;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.live-indicator .live-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    animation: dotBlink 1.2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}
.live-indicator .live-text {
    font-size: 0.7rem;
    font-weight: 700;
    color: #28a745;
    letter-spacing: 0.5px;
}
@keyframes livePulse {
    0%, 100% { transform: scale(1); background: rgba(40, 167, 69, 0.08); border-color: rgba(40, 167, 69, 0.15); }
    50% { transform: scale(1.02); background: rgba(40, 167, 69, 0.18); border-color: rgba(40, 167, 69, 0.35); }
}
@keyframes dotBlink {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(40, 167, 69, 0.4); }
    50% { opacity: 0.3; transform: scale(0.7); box-shadow: 0 0 2px rgba(40, 167, 69, 0.1); }
}

/* ===== INFO CONTENT ===== */
.info-content {
    background: #f8f8f0;
    border: 1px solid #d0d0c0;
    border-radius: 7px;
    padding: 20px 25px;
    margin-top: 25px;
}
.info-content p { margin-bottom: 10px; line-height: 1.8; }
.info-content .formula-box {
    background: #f0f0d0;
    border: 1px solid #d0d0c0;
    border-radius: 7px;
    padding: 12px 18px;
    margin: 12px 0;
    text-align: center;
}
.info-content .formula-box img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.info-content .highlight { background: #f0f0d0; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.info-content ul { padding-left: 25px; margin-top: 8px; }
.info-content ul li { margin-bottom: 5px; line-height: 1.8; }

/* ===== TOOL CARDS ===== */
.tool-card {
    background: #f8f8f0;
    border: 1px solid #d0d0c0;
    border-radius: 7px;
    padding: 20px;
    text-align: center;
    transition: 0.15s;
}
.tool-card:hover { background: #f0f0d0; transform: translateY(-3px); }
.tool-card i { font-size: 2.4rem; margin-bottom: 8px; }
.tool-card h4 { font-size: 1.1rem; font-weight: bold; margin: 5px 0; }
.tool-card p { color: #666; font-size: 0.9rem; margin: 0; }

/* ===== RESPONSIVE ===== */
@media only screen and (max-width: 799px) {
    #header>div { max-width: 100%; width: auto; padding: 0 10px; position: relative; }
    #logo { margin-left: 0; padding: 2px; }
    #logo img { width: 120px; }
    #logo a { font-size: 15px; gap: 6px; }
    
    #tooldiv { display: none; }
    .hamburger-btn { display: block; }
    .mobile-menu { position: absolute; top: 100%; left: 0; right: 0; }
    
    #lcol { width: 100%; padding-right: 0; }
    #doc { padding-right: 0; }
    #rcol { margin-left: 0px; width: 100%; padding: 20px 0; }
    .faq-grid { grid-template-columns: 1fr; }
    #nav { font-size: small; }
    H1 { font-size: 1.3em !important; line-height: 1.4; }
    H1 i { font-size: 1.1rem; }
    .info-content { padding: 15px; }
    .info-content .formula-box { padding: 10px 12px; }
    .info-content .formula-box img { width: 100%; max-width: 100%; }
    .live-indicator { font-size: 0.65rem; padding: 1px 8px 1px 5px; }
    .live-indicator .live-dot { width: 7px; height: 7px; }
    .live-indicator .live-text { font-size: 0.6rem; }
    .result-box {
        display: flex;
        flex-direction: column;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 6px;
        padding: 15px 12px;
    }
    .result-box > span {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }
    .result-box .result-value { font-size: 1.8rem; }
    .result-box .badge-conversion { margin-top: 4px; font-size: 0.7rem; }
    .converter-card { padding: 15px; }
    .input-wrap input { font-size: 1rem; padding: 0.5rem 0; }
    .input-wrap .unit-badge { font-size: 0.7rem; padding: 0.2rem 0.8rem; }
    .btn { font-size: 0.85rem; padding: 0.5rem 1.2rem; }
    .quick-convert .btn-sm { font-size: 0.7rem; padding: 3px 8px; }
    .edu-table { font-size: 0.65rem !important; }
    .edu-table th, .edu-table td { padding: 4px 6px !important; font-size: 0.6rem !important; white-space: nowrap !important; }
    .edu-table th { font-size: 0.65rem !important; }
    .edu-table td:last-child { font-size: 0.55rem !important; max-width: 60px; overflow: hidden; text-overflow: ellipsis; }
    
    /* Mobile Language Selector */
    .lang-selector .current-lang {
        padding: 3px 8px;
        font-size: 0.75rem;
    }
    .lang-selector .current-lang .lang-name {
        font-size: 0.7rem;
    }
    .lang-selector .current-lang .flag {
        font-size: 0.8rem;
    }
    .lang-dropdown {
        min-width: 140px;
        right: -5px;
    }
    .lang-dropdown a {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    .lang-dropdown a .flag {
        font-size: 0.9rem;
    }
    .lang-dropdown a .lang-name {
        font-size: 0.75rem;
    }
    .lang-dropdown a .check {
        font-size: 0.7rem;
    }
    .mobile-menu a {
        font-size: 12px !important;
        padding: 8px 20px !important;
    }
    .mobile-menu a i {
        font-size: 12px !important;
    }
    .mobile-menu a .flag {
        font-size: 14px !important;
    }
}

@media only screen and (max-width: 480px) {
    .lang-selector .current-lang .lang-name {
        display: none;
    }
    .lang-selector .current-lang {
        padding: 3px 6px;
    }
}

@media only screen and (min-width: 800px) { 
    #rcol { padding-left: 20px; }
    .hamburger-btn { display: none; }
    .mobile-menu { display: none !important; }
}

.form-control[readonly] { background-color: #fff; }