* {
    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, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.converter-section {
    margin-bottom: 40px;
}

.controls {
    margin-bottom: 20px;
}

.direction-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.toggle-btn {
    padding: 12px 24px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: #f0f0f0;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    position: relative;
}

.editor-panel label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea[readonly] {
    background: #f9f9f9;
}

.copy-btn {
    position: absolute;
    top: 35px;
    right: 10px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #5568d3;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.primary-btn, .secondary-btn {
    padding: 14px 32px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.secondary-btn:hover {
    background: #f0f0f0;
}

.error-message {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin-top: 15px;
}

.stats-message {
    padding: 15px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    color: #0066cc;
    margin-top: 15px;
}

.info-section {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

.info-section h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.info-section li {
    margin: 8px 0;
}

.info-section a {
    color: #667eea;
    text-decoration: none;
}

.info-section a:hover {
    text-decoration: underline;
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    color: #666;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Navigation */
nav {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background 0.3s;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

nav a.active {
    background: rgba(255, 255, 255, 0.3);
}

/* Signup Page Styles */
.signup-section {
    max-width: 600px;
    margin: 0 auto;
}

.info-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-box h2 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-box h3 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

.info-box ul, .info-box ol {
    margin: 10px 0;
    padding-left: 25px;
}

.info-box li {
    margin: 8px 0;
}

.info-box code {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.info-box pre {
    background: #2d2d2d;
    color: #f8f8f8;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 15px 0;
}

.info-box pre code {
    background: none;
    color: #f8f8f8;
    padding: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.primary-button {
    width: 100%;
    padding: 14px 32px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.success-box {
    background: #e7f9ef;
    border: 2px solid #4caf50;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success-box h2 {
    color: #4caf50;
    margin-bottom: 15px;
}

.api-key-display {
    margin: 25px 0;
}

.api-key-display label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
}

.api-key-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #4caf50;
}

.api-key-container code {
    flex: 1;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: #333;
    font-size: 0.95em;
}

.copy-button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.copy-button:hover {
    background: #5568d3;
}

.copy-button.success {
    background: #4caf50;
}

@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 1.8em;
    }

    .direction-toggle {
        flex-direction: column;
    }

    nav {
        flex-direction: column;
        align-items: center;
    }

    .api-key-container {
        flex-direction: column;
        align-items: stretch;
    }
}
