/* ogp-simulator style */
.ogp-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ogp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.ogp-form-area {
    flex: 1 1 350px;
    background: #fdfdfd;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.ogp-preview-area {
    flex: 1 1 450px;
}

.ogp-input-group {
    margin-bottom: 16px;
}

.ogp-input-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #333;
}

.ogp-input-group label span.required {
    color: #d32f2f;
    font-size: 12px;
    margin-left: 4px;
}

.ogp-input,
.ogp-textarea,
.ogp-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.ogp-input:focus,
.ogp-textarea:focus,
.ogp-select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.ogp-fetch-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.ogp-fetch-btn:hover {
    background: #0056b3;
}

.ogp-fetch-btn:disabled {
    background: #80bdff;
    cursor: not-allowed;
    box-shadow: none;
}

.ogp-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Preview Switcher */
.preview-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.preview-tab-btn {
    padding: 6px 16px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    transition: all 0.2s;
}

.preview-tab-btn:hover {
    background: #eee;
}

.preview-tab-btn.active {
    background: #1da1f2;
    /* Twitter blue */
    color: white;
    border-color: #1da1f2;
}

.preview-tab-btn[data-target="facebook"].active {
    background: #1877f2;
    /* FB blue */
    border-color: #1877f2;
}

/* Card Mocks */
.card-preview-container {
    display: none;
    background: #fff;
}

.card-preview-container.active {
    display: block;
}

/* Twitter Card Shared */
.tw-card {
    border: 1px solid #cfd9de;
    border-radius: 16px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #0f1419;
    cursor: pointer;
    background: #fff;
    transition: background-color 0.2s;
    margin: 0 auto;
    text-decoration: none;
    display: block;
}

.tw-card:hover {
    background-color: #f7f9f9;
}

.tw-image-area {
    background-color: #e1e8ed;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.tw-text-area {
    padding: 12px;
}

.tw-domain {
    color: #536471;
    font-size: 15px;
    line-height: 20px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tw-title {
    font-size: 15px;
    line-height: 20px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.tw-desc {
    color: #536471;
    font-size: 15px;
    line-height: 20px;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Summary with Large Image */
.tw-large {
    max-width: 504px;
    /* Typical twitter desktop feed width */
}

.tw-large .tw-image-area {
    padding-bottom: 52.356%;
    /* 1.91:1 Aspect Ratio */
    border-bottom: 1px solid #cfd9de;
}

/* Summary Card */
.tw-small {
    max-width: 504px;
    display: flex;
    align-items: center;
}

.tw-small .tw-image-area {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    border-right: 1px solid #cfd9de;
}

.tw-small .tw-text-area {
    flex: 1;
    min-width: 0;
    /* needed for ellipsis in flex child */
}

/* Facebook Card */
.fb-card {
    border: 1px solid #dadde1;
    background-color: #f2f3f5;
    overflow: hidden;
    font-family: Helvetica, Arial, sans-serif;
    max-width: 500px;
    margin: 0 auto;
}

.fb-image-area {
    width: 100%;
    padding-bottom: 52.356%;
    /* 1.91:1 */
    background-color: #e9ebee;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #dadde1;
}

.fb-text-area {
    padding: 10px 12px;
}

.fb-domain {
    font-size: 12px;
    color: #606770;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    line-height: 20px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-desc {
    font-size: 14px;
    color: #606770;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Default Placeholder styles */
.img-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #8899a6;
    font-size: 24px;
}

.fb-image-area .img-placeholder {
    color: #bec3c9;
}

/* Code Output Area */
.ogp-code-area {
    margin-top: 40px;
    position: relative;
}

.ogp-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #333;
    padding: 10px 15px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    color: white;
}

.ogp-code-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

.ogp-copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.ogp-copy-btn:hover {
    background: #0056b3;
}

.ogp-code-content {
    background: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    margin: 0;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.ogp-tag-name {
    color: #e06c75;
}

.ogp-attr-name {
    color: #d19a66;
}

.ogp-attr-val {
    color: #98c379;
}

@media (max-width: 768px) {
    .ogp-grid {
        flex-direction: column;
    }
}