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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
    position: relative;
}

.header {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.header p {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 400;
    color: #cbd5e1;
}

.auth-section {
    position: absolute;
    top: 24px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

.auth-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.auth-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    border-color: rgba(255,255,255,0.3);
}

.content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.input-section {
    padding: 40px;
    background: #fafafa;
    border-right: 1px solid #e5e7eb;
}

.output-section {
    padding: 40px;
    background: white;
}

.form-group {
    margin-bottom: 28px;
    position: relative;
}

label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    font-size: 0.95rem;
    position: relative;
    letter-spacing: -0.01em;
}

.help-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #0077b5;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    line-height: 18px;
    margin-left: 8px;
    cursor: help;
    position: relative;
    font-weight: 600;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: -8px;
    left: 30px;
    background: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.2s, visibility 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.tooltip::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #1f2937;
}

.help-icon:hover {
    background: #005885;
}

.help-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.style-options {
    display: block;
    line-height: 1.5;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    resize: vertical;
    background: white;
}

textarea:focus, input[type="text"]:focus {
    outline: none;
    border-color: #0077b5;
    box-shadow: 0 0 0 3px rgba(0, 119, 181, 0.1);
}

#article_content {
    min-height: 200px;
}

.btn {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 119, 181, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.output-content {
    background: #fafafa;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    min-height: 400px;
    white-space: pre-wrap;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    color: #374151;
    width: 100%;
    resize: vertical;
}

.loading {
    display: none;
    text-align: center;
    padding: 60px 40px;
    color: #6b7280;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #0077b5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.error {
    background: #fef2f2;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
    font-size: 0.9rem;
}

.success {
    background: #f0fdf4;
    color: #16a34a;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #bbf7d0;
    font-size: 0.9rem;
}

.warning {
    background: #fff3cd;
    color: #856404;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 5px;
    border: 1px solid #ffeaa7;
    font-size: 0.9rem;
    display: none;
}

.char-counter {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

.char-counter.over-limit {
    color: #dc3545;
    font-weight: bold;
}

.footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.footer a {
    color: #0077b5;
    text-decoration: none;
    font-weight: 600;
}

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

.copy-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

/* Commented out sections */
.commented-section {
    display: none;
}

/* Style suggestions dropdown for autocomplete */
.style-suggestions {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.95rem;
    color: #374151;
}

.suggestion-item:hover {
    background: #f3f4f6;
}

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

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .header h1 {
        font-size: 1.875rem;
    }

    .auth-section {
        position: static;
        justify-content: center;
        margin-bottom: 20px;
    }
}