/* =========================================
   Filename: css/tool.css
   Usage: For Password & Username Generator Pages
   ========================================= */

:root {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.4);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --nav-height: 70px;
    --radius-md: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    background-image: radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
}

/* --- Navigation --- */
nav {
    height: var(--nav-height);
    padding: 0 2rem;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
nav .brand { font-weight: 800; font-size: 1.4rem; color: var(--text-main); text-decoration: none; }
nav .brand span { color: var(--primary); }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; margin-left: 2rem; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

/* --- Split Layout --- */
.split-layout {
    display: grid;
    grid-template-columns: 1fr; /* Mobile Default */
    gap: 3rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .split-layout {
        grid-template-columns: 1fr 480px; /* Fluid Text | Fixed Tool */
        gap: 5rem;
    }
}

/* Content Side */
.hero-title { font-size: 3rem; line-height: 1.1; font-weight: 800; margin-bottom: 1.5rem; color: var(--text-main); }
.hero-desc { font-size: 1.2rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 3rem; }
.info-block { margin-bottom: 2.5rem; }
.info-block h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1.2rem; }
.info-block p { color: var(--text-muted); line-height: 1.6; }

.badge-ad-free {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(16, 185, 129, 0.1); color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
}

/* --- Tool Card --- */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
    z-index: 10;
}

/* --- Tabs --- */
.generator-tabs {
    display: flex; background: rgba(0,0,0,0.2);
    padding: 4px; border-radius: var(--radius-md); margin-bottom: 1.5rem;
}
.tab-btn {
    flex: 1; padding: 10px; background: transparent; border: none;
    color: var(--text-muted); font-weight: 600; cursor: pointer; border-radius: 8px;
    transition: 0.2s;
}
.tab-btn.active { background: var(--primary); color: #fff; }

/* --- Result Wrapper (FIXED) --- */
.result-wrapper {
    position: relative;
    margin-bottom: 1rem;
    width: 100%;
}

.result-box {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    padding-right: 3.5rem; /* Space for the copy button */
    font-family: monospace; 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: var(--text-main);
    text-align: center; 
    word-break: break-all;
    min-height: 80px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    transition: border-color 0.2s;
}
.result-box:hover { border-color: var(--primary); }

.copy-btn-absolute {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.copy-btn-absolute:hover {
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
}

/* --- Controls --- */
.control-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.label-text { font-weight: 500; color: var(--text-main); }

.manual-input {
    width: 70px; padding: 6px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    border-radius: 6px; color: var(--text-main); text-align: center; font-weight: 700;
}
.manual-input:focus { outline: 1px solid var(--primary); }

input[type=range] {
    width: 100%; margin-bottom: 1.5rem;
    -webkit-appearance: none; background: transparent; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 6px; background: var(--border); border-radius: 3px; }
input[type=range]::-webkit-slider-thumb {
    height: 20px; width: 20px; border-radius: 50%; background: var(--primary);
    margin-top: -7px; -webkit-appearance: none; box-shadow: 0 0 10px var(--primary-glow);
}

/* Toggle Switch */
.toggle-switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border); transition: .3s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Buttons */
.btn-primary {
    width: 100%; background: var(--primary); color: #0f172a;
    font-weight: 700; padding: 1rem; border: none; border-radius: var(--radius-md);
    font-size: 1rem; cursor: pointer; transition: 0.2s; margin-top: 1rem;
}
.btn-primary:hover { background: #0ea5e9; box-shadow: 0 0 15px var(--primary-glow); }

/* Strength Meter */
.strength-meter { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-bottom: 0.5rem; }
.strength-fill { height: 100%; transition: 0.3s; }
.strength-text { display: block; text-align: right; font-size: 0.8rem; font-weight: 600; margin-bottom: 2rem; }

/* Utilities */
.mode-section { display: none; }
.mode-section.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Toast */
.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--success); color: #fff; padding: 0.8rem 1.5rem; border-radius: 50px;
    font-weight: 600; opacity: 0; transition: 0.3s; display: flex; align-items: center; gap: 8px; z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 768px) {
    .tool-card { position: relative; top: 0; }
    .split-layout { padding: 0 1rem; }
    nav { padding: 0 1rem; }
}

.crack-time {
    display: block;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -1.5rem; /* Pull it closer to strength text */
    margin-bottom: 2rem;
    font-weight: 500;
}

.crack-time span {
    color: var(--primary);
    font-weight: 700;
}

/* --- Additions for IP Lookup Tool --- */

/* Map Container */
#map {
    height: 250px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    z-index: 1; /* Keep below nav */
}

/* IP Data Grid */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.data-item {
    background: rgba(0,0,0,0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.data-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.data-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    word-break: break-word;
}

/* Full width for certain items like ASN or User Agent */
.data-item.full-width {
    grid-column: span 2;
}

.loader {
    color: var(--primary);
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

/* --- End of Additions for IP Lookup Tool --- */

/* --- Global Professional Footer --- */
.site-footer {
    background: var(--bg-card); /* Matches your tool cards */
    border-top: 1px solid var(--border);
    padding: 4rem 1.5rem;
    text-align: center;
    margin-top: auto; /* Pushes footer to bottom even on short pages */
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 700px;
    margin: 0 auto;
}

.site-footer h4 {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.site-footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.site-footer .copyright {
    font-size: 0.85rem;
    margin-bottom: 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05); /* Subtle divider */
    color: var(--text-muted);
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.site-footer a:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* --- Subnet Calculator & Advanced Tool Styles --- */

/* Binary Output Text */
.binary-display {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--primary);
    letter-spacing: 1px;
    word-break: break-all;
}

/* Input Grouping (Side-by-side inputs) */
.input-group {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 1.5rem;
}

/* Class Selection Buttons */
.class-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.class-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.class-btn:hover,
.class-btn.active {
    background: var(--primary);
    color: #0f172a; /* Dark text for contrast against primary color */
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Custom Dropdown Arrow (SVG) */
select.manual-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2338bdf8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
    cursor: pointer;
}

/* IP Type Badges (Private/Public) */
.badge-ip-type {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    font-weight: 700;
    vertical-align: middle;
}

.badge-private {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-public {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

/* Feedback & Error Messages */
.feedback-msg {
    font-size: 0.9rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
    min-height: 1.4em;
    font-weight: 500;
    transition: color 0.2s;
}

.feedback-error {
    color: #ef4444;
}

.feedback-tip {
    color: #94a3b8;
    font-style: italic;
}

.feedback-tip strong {
    color: var(--primary);
    font-style: normal;
}

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}