<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Base Converter - Programming Tool</title>
    <link rel="stylesheet" href="static/css/styles.css">
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
</head>
<body>
    <div class="container">
        <header>
            <h1>Base Converter</h1>
            <p>A handy tool for programmers to convert between number systems</p>
        </header>

        <main class="converter">
            <div class="input-section">
                <div class="input-group">
                    <label for="input-value">Enter Number:</label>
                    <input type="text" id="input-value" placeholder="Enter a number...">
                </div>

                <div class="base-selector">
                    <label for="from-base">From Base:</label>
                    <select id="from-base">
                        <option value="2">Binary (Base 2)</option>
                        <option value="8">Octal (Base 8)</option>
                        <option value="10" selected>Decimal (Base 10)</option>
                        <option value="16">Hexadecimal (Base 16)</option>
                    </select>
                </div>

                <button id="convert-btn">Convert</button>
            </div>

            <div class="results">
                <div class="result-card">
                    <h3>Binary</h3>
                    <div class="result-value" id="binary-result">-</div>
                    <button class="copy-btn" data-target="binary-result">Copy</button>
                </div>

                <div class="result-card">
                    <h3>Octal</h3>
                    <div class="result-value" id="octal-result">-</div>
                    <button class="copy-btn" data-target="octal-result">Copy</button>
                </div>

                <div class="result-card">
                    <h3>Decimal</h3>
                    <div class="result-value" id="decimal-result">-</div>
                    <button class="copy-btn" data-target="decimal-result">Copy</button>
                </div>

                <div class="result-card">
                    <h3>Hexadecimal</h3>
                    <div class="result-value" id="hex-result">-</div>
                    <button class="copy-btn" data-target="hex-result">Copy</button>
                </div>
            </div>
        </main>

        <div class="info-section">
            <h2>How to Use</h2>
            <ul>
                <li>Enter a number in the input field</li>
                <li>Select the base of your input number</li>
                <li>Click "Convert" to see all representations</li>
                <li>Use the copy buttons to copy results to clipboard</li>
            </ul>

            <div class="examples">
                <h3>Examples:</h3>
                <div class="example-grid">
                    <div class="example">
                        <strong>Binary:</strong> 1010 → Decimal: 10
                    </div>
                    <div class="example">
                        <strong>Hex:</strong> FF → Decimal: 255
                    </div>
                    <div class="example">
                        <strong>Octal:</strong> 77 → Decimal: 63
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="static/js/script.js"></script>
</body>
root@vm1130058:/opt/vless/www/html_wss# vi static/css/styles.css
root@vm1130058:/opt/vless/www/html_wss# cat static/css/styles.css
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

header h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.converter {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.input-section {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 250px;
}

.base-selector {
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

input, select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

#convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

#convert-btn:active {
    transform: translateY(0);
}

.results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.result-card h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-value {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
    word-break: break-all;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.copy-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.copy-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.copy-btn.copied {
    background: #28a745;
}

.info-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.info-section h2 {
    color: #495057;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.info-section ul {
    list-style: none;
    margin-bottom: 2rem;
}

.info-section li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.info-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.examples h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.example {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .converter {
        padding: 1.5rem;
    }

    .input-section {
        flex-direction: column;
        align-items: stretch;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .example-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    header p {
        font-size: 1rem;
    }

    .converter {
        padding: 1rem;
    }

    .info-section {
        padding: 1.5rem;
    }
}
