:root {
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --bg-sidebar: #f8fafc;
    --bg-main: #ffffff;
    --border-color: #e2e8f0;

    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-link: #2563eb;

    --accent-color: #3b82f6;
    --warn-color: #f59e0b;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 400px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.char-count.warn {
    color: var(--warn-color);
    font-weight: 600;
}

.char-count.danger {
    color: var(--danger-color);
    font-weight: 600;
}

input[type="url"],
input[type="text"],
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.warning-text {
    font-size: 0.75rem;
    color: var(--warn-color);
    display: none;
}

.warning-text.show {
    display: block;
}

.missing-tags-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.missing-tags-alert.hidden {
    display: none;
}

.btn-primary {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1rem;
}

.btn-primary:hover {
    background: #1e293b;
}

.btn-secondary {
    background: var(--bg-sidebar);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Main Content */
.preview-area {
    flex: 1;
    background-color: var(--bg-main);
    padding: 3rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    align-items: center;
}

.preview-block {
    width: 100%;
    max-width: 600px;
}

.preview-block h2 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card {
    font-family: var(--font-ui);
    line-height: 1.4;
    overflow: hidden;
}

/* Google Search Mockup */
.google-card {
    background: #fff;
    padding: 0;
}

.google-url {
    font-size: 14px;
    color: #202124;
    margin-bottom: 4px;
}

.google-path {
    color: #4d5156;
}

.google-title {
    color: #1a0dab;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 4px;
    cursor: pointer;
}

.google-title:hover {
    text-decoration: underline;
}

.google-desc {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.58;
    word-wrap: break-word;
}

/* Twitter Mockup */
.twitter-card {
    background: #fff;
    border: 1px solid #cfd9de;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s;
}

.twitter-card:hover {
    background: #f7f9f9;
}

.twitter-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-color: #e1e8ed;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #cfd9de;
}

.twitter-content {
    padding: 12px;
}

.twitter-domain {
    color: #536471;
    font-size: 13px;
    margin-bottom: 2px;
}

.twitter-title {
    color: #0f1419;
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.twitter-desc {
    color: #536471;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Facebook Mockup */
.fb-card {
    background: #f0f2f5;
    border: 1px solid #ced0d4;
    border-radius: 0;
    /* modern fb actually often uses slight radius or no radius on feed */
    cursor: pointer;
}

.fb-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #ced0d4;
}

.fb-content {
    padding: 10px 12px;
    background: #f0f2f5;
}

.fb-domain {
    color: #65676b;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.fb-title {
    color: #050505;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 3px;
}

.fb-desc {
    color: #65676b;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* limits to 1 line */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* LinkedIn Mockup */
.ln-card {
    background: #eef3f8;
    /* LinkedIn light grayish bg */
    border-radius: 8px;
    /* Slightly rounded */
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.ln-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
}

.ln-content {
    padding: 12px 16px;
    background: #eef3f8;
}

.ln-title {
    color: rgba(0, 0, 0, 0.9);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.ln-domain {
    color: rgba(0, 0, 0, 0.6);
    font-size: 12px;
}

/* Slack Mockup */
.slack-card {
    display: flex;
    background: #fff;
}

.slack-line {
    width: 4px;
    background-color: #dddddd;
    border-radius: 4px;
    margin-right: 12px;
}

.slack-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slack-provider {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1d1c1d;
}

.slack-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.slack-title {
    color: #1164A3;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.slack-title:hover {
    text-decoration: underline;
}

.slack-desc {
    color: #1d1c1d;
    font-size: 15px;
    line-height: 1.46668;
}

.slack-image {
    margin-top: 8px;
    max-width: 360px;
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.modal-header h2 {
    font-size: 1.25rem;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--text-main);
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.modal-content code {
    font-family: var(--font-mono);
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.code-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.code-block textarea {
    width: 100%;
    height: 250px;
    background: #1e293b;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 1.5rem;
    border-radius: 8px;
    border: none;
    resize: none;
}

/* Responsiveness */
@media (max-width: 950px) {
    .app-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .preview-area {
        padding: 2rem 1.5rem;
    }
}