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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #000000;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0,0,0,0.02) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -2px;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: #000;
    border-radius: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

.input-container {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 600px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

input {
    flex: 1;
    padding: 18px 24px;
    font-size: 1rem;
    border: 2px solid #000;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #000;
    font-weight: 500;
}

input:focus {
    border-color: #000;
    box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

input::placeholder {
    color: #999;
    font-weight: 400;
}

button {
    padding: 18px 32px;
    font-size: 1rem;
    font-weight: 700;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

button:hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(-1px);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#output {
    width: 100%;
    margin-top: 40px;
    padding: 40px;
    border: 2px solid #000;
    border-radius: 20px;
    background: #ffffff;
    font-size: 1.05rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out 0.4s both;
    min-height: 200px;
    display: none;
}

#output.show {
    display: block;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    color: #666;
    font-size: 1.1rem;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #eee;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    color: #000;
    background: #f5f5f5;
    border: 2px solid #000;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

/* Bold text styling */
#output strong,
#output b {
    font-weight: 700;
    color: #000;
}

/* Italic text styling */
#output em,
#output i {
    font-style: italic;
    color: #333;
}

/* Headers in output */
#output h1, #output h2, #output h3, #output h4, #output h5, #output h6 {
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: #000;
}

/* Download button */
.download-btn {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 0.9rem;
    min-width: auto;
    display: none;
}

.download-btn:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
}

.download-btn.show {
    display: inline-block;
}

.success {
    animation: slideInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 40px 15px;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    #output {
        padding: 25px;
    }
}