:root {
    --primary-color: #183059;
    --primary-hover: #276fbf;
    --bg-color: #f6f4f3;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-focus: #276fbf;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(39, 111, 191, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(24, 48, 89, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-family: 'Georgia', 'Merriweather', serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

.output-panel {
    flex: 1;
    min-height: 400px;
}

.panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

textarea, .url-input {
    width: 100%;
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    color: var(--text-main);
    font-family: 'Inter', monospace;
    font-size: 0.875rem;
    resize: none;
    transition: var(--transition);
    outline: none;
}

textarea:focus, .url-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

textarea::placeholder, .url-input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

button {
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    outline: none;
}

button:active {
    transform: scale(0.97);
}

.primary-btn {
    flex: 1;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
    transform: translateY(-1px);
}

.secondary-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.875rem 1.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.3);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.output-header h2 {
    font-family: 'Georgia', 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 0.375rem;
    opacity: 0.7;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.output-content {
    flex: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-y: auto;
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    border: 1px solid transparent;
}

.output-content p {
    font-family: 'Georgia', 'Merriweather', serif;
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    line-height: 1.8;
}

.output-content p:last-child {
    margin-bottom: 0;
}

.placeholder-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.4);
    text-align: center;
}

.placeholder-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: var(--transition);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
