* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #2a2a3e;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 700px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3a3a4e;
}

.subtitle {
    color: #b0b0b0;
    font-size: 14px;
}

main {
    margin: 30px 0;
}

.section {
    margin-bottom: 40px;
}

.input-section {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #d0d0d0;
    font-size: 14px;
    font-weight: 500;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 12px;
    background: #1e1e2e;
    border: 2px solid #3a3a4e;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #5a9;
}

button {
    width: 100%;
    padding: 12px 24px;
    background: #5a9;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.3s, transform 0.1s;
}

button:hover {
    background: #4a8;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background: #4a4a6a;
    cursor: not-allowed;
    opacity: 0.6;
}

#copy-btn {
    background: #4a7;
    margin-top: 16px;
}

#copy-btn:hover {
    background: #3a6;
}

.output-section {
    margin-top: 20px;
    padding: 20px;
    background: #1e1e2e;
    border-radius: 8px;
    border: 2px solid #3a3a4e;
}

.code-display {
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    color: #5a9;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    margin: 20px 0;
    padding: 20px;
    background: #0f0f1a;
    border-radius: 8px;
}

.timer {
    text-align: center;
    color: #b0b0b0;
    font-size: 14px;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #3a3a4e;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: #5a9;
    width: 100%;
    transition: width 1s linear;
}

.error-message {
    padding: 12px;
    background: #4a1e1e;
    border: 2px solid #6a2e2e;
    border-radius: 8px;
    color: #ff6b6b;
    margin-top: 16px;
    text-align: center;
}

.result-message {
    padding: 12px;
    background: #1e4a1e;
    border: 2px solid #2e6a2e;
    border-radius: 8px;
    color: #6bff6b;
    margin-top: 16px;
    text-align: center;
    word-break: break-all;
    white-space: pre-line;
}

.result-message.error {
    background: #4a1e1e;
    border-color: #6a2e2e;
    color: #ff6b6b;
}

footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #3a3a4e;
    color: #909090;
    font-size: 12px;
}

@media (max-width: 600px) {
    .container {
        padding: 24px;
    }

    h1 {
        font-size: 24px;
    }

    .code-display {
        font-size: 36px;
        letter-spacing: 6px;
    }
}
