/* --- 1. MAIN LAYOUT --- */
body { background-color: #0a0b10; color: #fff; font-family: 'Poppins', sans-serif; overflow-x: hidden; margin: 0; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* HEADER & SIDEBAR */
.tools-header { height: 70px; background: rgba(15, 15, 20, 0.95); border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; justify-content: space-between; align-items: center; padding: 0 30px; position: fixed; top: 0; left: 0; width: 100%; z-index: 100; }
.header-center { display: flex; align-items: center; gap: 10px; font-family: 'Cinzel', serif; color: #ffd700; font-weight: 700; font-size: 1.1rem; }
.header-center img { height: 35px; }
.back-link { color: #888; text-decoration: none; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.back-link:hover { color: #fff; }

.tools-container { display: flex; min-height: 100vh; padding-top: 70px; }
.tools-sidebar { width: 260px; background: #0f1015; border-right: 1px solid rgba(255,255,255,0.05); padding: 30px 20px; position: fixed; left: 0; bottom: 0; top: 70px; overflow-y: auto; z-index: 99; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar-title { color: #555; font-size: 0.75rem; font-weight: 700; letter-spacing: 1px; margin-bottom: 15px; padding-left: 10px; }
.tool-nav { width: 100%; background: transparent; border: none; display: flex; align-items: center; gap: 15px; padding: 14px 15px; color: #999; cursor: pointer; border-radius: 8px; transition: 0.2s; text-align: left; }
.tool-nav:hover { background: rgba(255,255,255,0.05); color: #fff; }
.tool-nav.active { background: linear-gradient(90deg, rgba(255,215,0,0.15), transparent); color: #ffd700; border-left: 3px solid #ffd700; }
.tool-nav i { width: 20px; text-align: center; }

/* CONTENT AREA */
.tools-content { flex: 1; margin-left: 260px; padding: 30px; background: radial-gradient(circle at 50% 0%, #1a1c24 0%, #0a0b10 60%); min-height: 100vh; }
.tool-panel { display: none; animation: fadeUp 0.4s ease; }
.tool-panel.active { display: block; }

/* HAMBURGER BUTTON (Hidden on Desktop) */
.hamburger-btn { display: none; background: transparent; border: none; font-size: 1.5rem; color: #ffd700; cursor: pointer; }

/* OVERLAY (Hidden by default) */
.mobile-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 98; opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(3px); }
.mobile-overlay.active { opacity: 1; visibility: visible; }

.panel-header { margin-bottom: 25px; text-align: center; }
.panel-header h2 { font-family: 'Cinzel', serif; color: #fff; font-size: 1.8rem; margin-bottom: 5px; }
.panel-header p { color: #888; font-size: 0.85rem; }

/* --- 2. CARD LAYOUT --- */
.calc-card {
    background: rgba(20, 21, 26, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    display: flex;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.full-width-card {
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 1100px;
    margin: 0 auto;
    display: block;
}

/* --- 3. INPUT & RESULT STYLES --- */
.calc-input-section { flex: 1; padding: 35px; border-right: 1px solid rgba(255,255,255,0.05); }
.calc-result-section { flex: 0.8; padding: 35px; background: rgba(0,0,0,0.2); display: flex; flex-direction: column; justify-content: center; gap: 20px; }

.row-group { display: flex; gap: 15px; margin-bottom: 20px; }
.col { flex: 1; }
label { display: block; color: #ccc; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }

.input-wrapper { position: relative; }
.input-wrapper input { width: 100%; background: #0a0b10; border: 1px solid #333; padding: 12px 45px 12px 15px; border-radius: 8px; color: #ffd700; font-size: 1.1rem; font-weight: 600; outline: none; }
.input-wrapper input:focus { border-color: #ffd700; }

.input-icon { 
    position: absolute; 
    right: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.modern-select { width: 100%; background: #0a0b10; border: 1px solid #333; padding: 12px; border-radius: 8px; color: #fff; outline: none; cursor: pointer; font-size: 0.95rem; }
.calc-note { margin-top: 10px; font-size: 0.8rem; color: #666; }

/* Result Item */
.result-item { background: rgba(255,255,255,0.03); padding: 15px 20px; border-radius: 10px; display: flex; align-items: center; gap: 15px; border: 1px solid rgba(255,255,255,0.05); }
.res-icon-box { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s ease; }
.res-icon-box img { width: 40px; height: 40px; object-fit: contain; }
.res-text span { display: block; color: #888; font-size: 0.8rem; text-transform: uppercase; }
.res-text h2 { color: #fff; font-size: 1.5rem; margin: 0; line-height: 1; }

/* --- 3.5 SPECIAL VIP LAYOUT --- */
.vip-layout { display: flex; flex-direction: column; padding: 30px; }
.vip-top-section { margin-bottom: 20px; }
.vip-divider { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 25px 0; }

.token-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.token-card {
    background: #202125;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 120px;
}

.token-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    border-color: #777;
}

.img-frame {
    width: 100%;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-frame img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.token-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ccc;
    letter-spacing: 0.5px;
    text-align: center;
    margin-bottom: 2px;
}

/* INPUT FIELD */
.token-input {
    width: 100%;
    background: #111;
    border: 1px solid #333;
    color: #fff;
    text-align: center;
    padding: 8px 5px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
    outline: none;
    height: 34px;
}

.token-input:focus {
    background: #000;
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.token-input::placeholder { color: #444; font-weight: normal; }

/* Result Bar & Borders */
.vip-result-bar { display: flex; gap: 12px; margin-top: 20px; }
.vip-res-box { flex: 1; background: #15161b; border: 1px solid #333; padding: 12px; border-radius: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.vip-res-box span { font-size: 0.75rem; color: #777; text-transform: uppercase; letter-spacing: 1px; }
.vip-res-box h3 { margin: 5px 0 0; font-size: 1.4rem; color: #fff; line-height: 1; }

.rarity-common { border-top: 3px solid #b0b0b0; }
.rarity-green { border-top: 3px solid #2ecc71; } .rarity-green .token-label { color: #2ecc71; }
.rarity-blue { border-top: 3px solid #3498db; } .rarity-blue .token-label { color: #3498db; }
.rarity-purple { border-top: 3px solid #9b59b6; } .rarity-purple .token-label { color: #9b59b6; }
.rarity-gold { border-top: 3px solid #f1c40f; } .rarity-gold .token-label { color: #f1c40f; }

.token-box { border-left: 3px solid #3498db; } .token-box h3 { color: #3498db; }
.final-box { border-left: 3px solid #e74c3c; background: rgba(231,76,60,0.05); } .final-box h3 { color: #e74c3c; }

/* --- 4. ACTION POINTS --- */
.ap-layout { display: block !important; background: rgba(20, 21, 26, 0.6); padding: 30px; border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); }
.ap-grid-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; width: 100%; margin-bottom: 25px; }
.ap-item-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 15px; transition: 0.3s; }
.ap-item-card:hover { border-color: #2ecc71; transform: translateY(-3px); }
.ap-img-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.ap-img-wrapper img { width: 60px; height: 60px; object-fit: contain; margin-bottom: 10px; }
.ap-label { font-weight: 700; color: #ccc; font-size: 1rem; display: block; }
.ap-input { width: 90%; background: #0a0b10; border: 1px solid #444; padding: 10px; border-radius: 6px; color: #fff; font-weight: bold; text-align: center; font-size: 1.1rem; }
.ap-input:focus { border-color: #2ecc71; }
.ap-result-bar { background: #0f1015; border: 1px solid #2ecc71; border-radius: 12px; padding: 20px 30px; display: flex; justify-content: space-between; align-items: center; width: 100%; }
.ap-res-content { display: flex; align-items: center; gap: 20px; }
.ap-res-content img { width: 45px; }
.ap-res-content h2 { color: #3498db; font-size: 2rem; margin: 0; font-family: 'Cinzel', serif; }
.ap-reset-btn { background: transparent; border: none; color: #e74c3c; font-size: 1.5rem; cursor: pointer; transition: 0.3s; }
.ap-reset-btn:hover { color: #ff6b6b; transform: rotate(90deg); }

/* --- 5. TIER LIST MAKER --- */
#tool-tierlist .panel-header { display: none !important; }
.tier-actions-top { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 15px; }
.action-btn { padding: 8px 16px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: all 0.3s ease; font-size: 0.85rem; font-family: 'Poppins', sans-serif; color: #aaa; }
.action-btn.download:hover { background: #3498db; border-color: #3498db; color: white; box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3); }
.action-btn.reset:hover { background: #e74c3c; border-color: #e74c3c; color: white; box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3); }
.tier-layout { display: flex; flex-direction: column; gap: 5px; } 
.tier-container { display: flex; flex-direction: column; gap: 4px; background: transparent; padding: 0; border: none; }
.tier-row { display: flex; min-height: 80px; background: #0e0e10; border: 1px solid #222; border-radius: 4px; overflow: hidden; }
.tier-label { width: 85px; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 2.5rem; font-weight: 900; font-family: 'Poppins', sans-serif; flex-shrink: 0; line-height: 1; background: #111; border-right: 1px solid #222; }
.tier-label::after { content: "TIER"; font-size: 0.6rem; font-weight: 500; margin-top: 2px; opacity: 0.5; letter-spacing: 1px; }
.label-z { border-left: 5px solid #ff0000; color: #ff0000; }
.label-s { border-left: 5px solid #d35400; color: #d35400; }
.label-a { border-left: 5px solid #f39c12; color: #f39c12; }
.label-b { border-left: 5px solid #f1c40f; color: #f1c40f; }
.label-c { border-left: 5px solid #2ecc71; color: #2ecc71; }
.label-d { border-left: 5px solid #3498db; color: #3498db; }
.tier-content { flex: 1; display: flex; flex-wrap: wrap; padding: 5px; gap: 5px; align-items: center; align-content: center; min-height: 80px; }
.watermark { text-align: right; color: #444; font-size: 0.7rem; margin-top: 5px; font-style: italic; display: none; }
.tier-bank-section { background: #0f1015; border: 1px solid #333; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; margin-top: 10px; }
.bank-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; background: rgba(255,255,255,0.03); border-bottom: 1px solid #222; gap: 10px; flex-wrap: wrap; }
.bank-title-group { display: flex; align-items: center; gap: 8px; }
.bank-header h3 { margin: 0; color: #aaa; font-size: 0.9rem; text-transform: uppercase; font-weight: 700; }
.bank-search-box { flex: 1; max-width: 250px; display: flex; align-items: center; background: #000; border: 1px solid #333; border-radius: 4px; padding: 6px 12px; }
.bank-search-box i { color: #555; font-size: 0.8rem; margin-right: 8px; }
.bank-search-box input { background: transparent; border: none; color: #fff; width: 100%; outline: none; font-size: 0.85rem; font-family: 'Poppins', sans-serif; }
.toggle-btn { background: transparent; border: 1px solid #333; color: #666; padding: 5px 12px; border-radius: 4px; cursor: pointer; transition: 0.2s; font-size: 0.8rem; }
.toggle-btn:hover { color: #fff; border-color: #666; }
.tier-bank-wrapper { padding: 10px; background: #111; overflow-y: auto; max-height: 250px; transition: max-height 0.4s ease-in-out; }
.tier-bank-wrapper.collapsed { max-height: 0; padding: 0; }
.tier-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; align-content: flex-start; }
.cmd-img { width: 55px; height: 55px; border-radius: 6px; cursor: grab; transition: transform 0.1s; border: 2px solid transparent; flex-shrink: 0; background: #222; }
.cmd-img:hover { transform: scale(1.15); border-color: #ffd700; z-index: 100; box-shadow: 0 0 10px rgba(0,0,0,0.8); }
.cmd-img.hidden { display: none !important; }

.rarity-selector-container { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.rarity-btn { padding: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.3); color: #888; border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; text-transform: uppercase; transition: 0.3s; font-size: 0.9rem; }
.rarity-btn img { width: 26px; filter: grayscale(100%); transition: 0.3s; }
.rarity-btn:hover { transform: translateY(-2px); color: #fff; }
.rarity-btn:hover img, .rarity-btn.active img { filter: grayscale(0%); }
.rarity-btn.legendary:hover, .rarity-btn.legendary.active { background: linear-gradient(45deg, #e67e22, #f1c40f) !important; border-color: #f1c40f !important; color:#fff !important; }
.rarity-btn.epic:hover, .rarity-btn.epic.active { background: linear-gradient(45deg, #8e44ad, #9b59b6) !important; border-color: #9b59b6 !important; color:#fff !important; }
.rarity-btn.elite:hover, .rarity-btn.elite.active { background: linear-gradient(45deg, #2980b9, #3498db) !important; border-color: #3498db !important; color:#fff !important; }
.rarity-btn.advanced:hover, .rarity-btn.advanced.active { background: linear-gradient(45deg, #27ae60, #2ecc71) !important; border-color: #2ecc71 !important; color:#fff !important; }
.skill-text-input { width: 100%; background: #0a0b10; border: 1px solid #333; padding: 15px; border-radius: 8px; color: #fff; font-size: 1.4rem; font-weight: 700; text-align: center; letter-spacing: 4px; outline: none; }
.skill-inputs-row { display: flex; align-items: center; gap: 15px; } .skill-input-group { flex: 1; } .skill-arrow { color: #555; font-size: 1.2rem; padding-top: 25px; }

.speedup-nav-container, .rss-nav-container { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.sp-nav-btn, .rss-nav-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #888; padding: 8px 20px; border-radius: 50px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.3s; font-size: 0.9rem; }
.sp-nav-btn.active, .rss-nav-btn.active { background: #ffd700; color: #000; border-color: #ffd700; }
.sp-nav-btn img, .rss-nav-btn img { width: 20px; }
.speedup-grid-area, .rss-grid-area { max-height: 500px; overflow-y: auto; }
.speedup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }
.sp-item label { font-size: 0.8rem; color: #888; display: block; text-align: center; margin-bottom: 5px; }
.sp-input { width: 100%; background: #0a0b10; border: 1px solid #333; padding: 8px; border-radius: 6px; color: #ffd700; text-align: center; font-size: 1rem; }
.total-time-display { text-align: center; background: rgba(255,255,255,0.03); padding: 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); }
.time-box h1 { font-size: 4rem; color: #ffd700; margin: 0; line-height: 1; }
.time-breakdown { display: flex; justify-content: center; gap: 20px; margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); }
.type-selector-container { display: flex; background: #0a0b10; padding: 4px; border-radius: 6px; gap: 5px; }
.type-btn { flex: 1; background: transparent; border: none; padding: 8px; color: #666; font-weight: 600; cursor: pointer; border-radius: 4px; font-size: 0.9rem; }
.type-btn.active { background: #ffd700; color: #000; }

.tools-footer { margin-top: 50px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; color: #888; font-size: 0.9rem; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 10px; }
.footer-links a { color: #aaa; text-decoration: none; transition: 0.3s; }
.footer-links a:hover { color: #ffd700; }

@keyframes fadeUp { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* --- TOGGLE & ANIMATION STYLES --- */
.vip-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.toggle-label {
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2ecc71;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2ecc71;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.token-section-hidden {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.4s ease-out;
}

.token-section-hidden.open {
    max-height: 800px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.4s ease-in;
}

.vip-divider {
    margin: 0;
    opacity: 0;
    transition: 0.3s;
}

.token-section-hidden.open .vip-divider {
    margin: 25px 0;
    opacity: 1;
}

/* --- MOBILE RESPONSIVE NAV (HAMBURGER SLIDE MENU) --- */
@media (max-width: 900px) {
    .hamburger-btn { display: block; font-size: 1.5rem; color: #ffd700; cursor: pointer; background: transparent; border: none; padding: 5px; }
    
    .tools-sidebar { 
        position: fixed;
        top: 70px;
        left: -100%; /* Hide by default */
        width: 280px; 
        height: calc(100vh - 70px);
        background: #0f1015;
        border-right: 1px solid rgba(255,255,255,0.1);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease-in-out; /* Smooth slide */
        overflow-y: auto;
    }

    .tools-sidebar.open {
        left: 0; /* Slide in */
    }

    .tool-nav {
        width: 100%;
        margin-bottom: 10px;
        padding: 15px;
        font-size: 0.9rem;
        flex-direction: row;
        justify-content: flex-start;
        border-radius: 8px;
    }

    .tool-nav.active {
        border-left: 3px solid #ffd700;
        border-bottom: none;
        background: linear-gradient(90deg, rgba(255,215,0,0.15), transparent);
    }

    .tools-content { margin-left: 0; padding: 20px; }
    
    .calc-card { flex-direction: column; }
    .calc-input-section { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); }
    
    .token-grid { grid-template-columns: repeat(2, 1fr); }
    .vip-result-bar { flex-direction: column; }

    .ap-grid-container { grid-template-columns: 1fr; }
}