/* ==========================================================================
   Title Tag & Meta Description Previewer — ttmdp-style.css
   Prefix: ttmdp-
   ========================================================================== */

.ttmdp-wrap *,
.ttmdp-wrap *::before,
.ttmdp-wrap *::after {
    box-sizing: border-box;
}

.ttmdp-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.ttmdp-main-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.ttmdp-main-subtitle {
    font-size: 0.92rem;
    color: #6b7280;
    margin: 0 0 26px;
}

/* --------------------------------------------------------------------------
   Two-column layout
   -------------------------------------------------------------------------- */
.ttmdp-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .ttmdp-layout {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.ttmdp-card {
    background: #ffffff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 24px 26px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.ttmdp-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5;
}

/* --------------------------------------------------------------------------
   Input fields
   -------------------------------------------------------------------------- */
.ttmdp-field {
    margin-bottom: 20px;
}

.ttmdp-field:last-of-type {
    margin-bottom: 0;
}

.ttmdp-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.ttmdp-required { color: #e53935; }
.ttmdp-muted    { color: #9ca3af; font-weight: 400; text-transform: none; letter-spacing: 0; }

.ttmdp-field input[type="text"],
.ttmdp-field input[type="url"],
.ttmdp-field textarea {
    width: 100%;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    padding: 10px 13px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #1f2937;
    background: #fafafa;
    transition: border-color 0.2s;
    resize: vertical;
}

.ttmdp-field input:focus,
.ttmdp-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.ttmdp-field input::placeholder,
.ttmdp-field textarea::placeholder { color: #c0c8d2; }

.ttmdp-hint {
    font-size: 0.78rem;
    color: #9ca3af;
    margin: 5px 0 0;
}

/* --------------------------------------------------------------------------
   Meta row: char count + px + status
   -------------------------------------------------------------------------- */
.ttmdp-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.ttmdp-count-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #4b5563;
}

.ttmdp-px-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
}

.ttmdp-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ttmdp-status-good    { background: #16a34a; }
.ttmdp-status-warning { background: #d97706; }
.ttmdp-status-danger  { background: #dc2626; }
.ttmdp-status-empty   { background: #9ca3af; }

/* --------------------------------------------------------------------------
   Progress bar
   -------------------------------------------------------------------------- */
.ttmdp-bar-wrap {
    position: relative;
    height: 6px;
    background: #f3f4f6;
    border-radius: 4px;
    margin-top: 8px;
    overflow: visible;
}

.ttmdp-bar {
    height: 100%;
    border-radius: 4px;
    width: 0%;
    max-width: 100%;
    transition: width 0.2s, background 0.2s;
    background: #9ca3af;
}

.ttmdp-bar.ttmdp-bar-good    { background: #16a34a; }
.ttmdp-bar.ttmdp-bar-warning { background: #d97706; }
.ttmdp-bar.ttmdp-bar-danger  { background: #dc2626; }

/* Marker lines */
.ttmdp-bar-limit {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 10px;
    border-radius: 2px;
    pointer-events: none;
}

.ttmdp-bar-limit-warn { background: #d97706; }
.ttmdp-bar-limit-good { background: #16a34a; }

/* --------------------------------------------------------------------------
   Copy / reset buttons
   -------------------------------------------------------------------------- */
.ttmdp-copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.ttmdp-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 7px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ttmdp-btn-outline {
    background: transparent;
    color: #2563eb;
    border-color: #2563eb;
}

.ttmdp-btn-outline:hover { background: #eff6ff; }

.ttmdp-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: #e5e7eb;
}

.ttmdp-btn-ghost:hover { background: #f9fafb; }

/* --------------------------------------------------------------------------
   Recommendations
   -------------------------------------------------------------------------- */
.ttmdp-rec-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ttmdp-rec-list li {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.ttmdp-rec-good    { background: #f0fdf4; color: #15803d; border-left: 3px solid #16a34a; }
.ttmdp-rec-warning { background: #fffbeb; color: #92400e; border-left: 3px solid #d97706; }
.ttmdp-rec-danger  { background: #fef2f2; color: #991b1b; border-left: 3px solid #dc2626; }
.ttmdp-rec-neutral { background: #f8fafc; color: #6b7280; border-left: 3px solid #d1d5db; }

/* --------------------------------------------------------------------------
   Tab navigation
   -------------------------------------------------------------------------- */
.ttmdp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ttmdp-tab {
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.ttmdp-tab:hover { color: #2563eb; }

.ttmdp-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* --------------------------------------------------------------------------
   Tab panels
   -------------------------------------------------------------------------- */
.ttmdp-tab-panel   { display: none; }
.ttmdp-panel-active{ display: block; }

/* --------------------------------------------------------------------------
   SERP frame wrapper
   -------------------------------------------------------------------------- */
.ttmdp-serp-frame,
.ttmdp-social-frame {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ttmdp-serp-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 16px;
}

/* --------------------------------------------------------------------------
   Desktop SERP result
   -------------------------------------------------------------------------- */
.ttmdp-serp-result {
    max-width: 600px;
}

.ttmdp-serp-source {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.ttmdp-serp-favicon {
    width: 18px;
    height: 18px;
    border-radius: 2px;
    object-fit: contain;
    background: #f3f4f6;
    flex-shrink: 0;
}

.ttmdp-serp-url-block {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.ttmdp-serp-domain {
    font-size: 0.83rem;
    color: #202124;
    font-weight: 500;
}

.ttmdp-serp-breadcrumb {
    font-size: 0.78rem;
    color: #5f6368;
}

.ttmdp-serp-title {
    font-size: 1.25rem;
    color: #1a0dab;
    line-height: 1.3;
    margin-bottom: 3px;
    cursor: pointer;
    font-family: arial, sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ttmdp-serp-title:hover { text-decoration: underline; }

.ttmdp-serp-desc {
    font-size: 0.88rem;
    color: #4d5156;
    font-family: arial, sans-serif;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* --------------------------------------------------------------------------
   Mobile SERP
   -------------------------------------------------------------------------- */
.ttmdp-serp-mobile-frame {
    max-width: 380px;
    margin: 0 auto;
}

.ttmdp-mobile-shell {
    border: 1.5px solid #d1d5db;
    border-radius: 18px;
    overflow: hidden;
    background: #f8f9fa;
}

.ttmdp-mobile-bar {
    background: #fff;
    padding: 10px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ttmdp-mobile-search-bar {
    font-size: 0.8rem;
    color: #5f6368;
    background: #f1f3f4;
    border-radius: 20px;
    padding: 5px 14px;
    flex: 1;
}

.ttmdp-serp-result-mobile {
    padding: 14px;
    background: #fff;
}

.ttmdp-serp-favicon-sm  { width: 14px; height: 14px; }
.ttmdp-serp-domain-sm   { font-size: 0.75rem; }
.ttmdp-serp-breadcrumb-sm { font-size: 0.7rem; }
.ttmdp-serp-title-sm    { font-size: 1.05rem; }
.ttmdp-serp-desc-sm     { font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   Facebook OG card
   -------------------------------------------------------------------------- */
.ttmdp-fb-card {
    border: 1px solid #dddfe2;
    border-radius: 4px;
    overflow: hidden;
    max-width: 520px;
    background: #fff;
}

.ttmdp-fb-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 52.5%;          /* 1200:630 ratio */
    background: #e4e6eb;
    overflow: hidden;
}

.ttmdp-fb-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttmdp-placeholder-img { display: none; }

.ttmdp-fb-image-placeholder,
.ttmdp-tw-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: #90949c;
    background: #e4e6eb;
}

.ttmdp-fb-body {
    padding: 12px 14px;
    background: #f2f3f5;
    border-top: 1px solid #dddfe2;
}

.ttmdp-fb-domain {
    font-size: 0.72rem;
    color: #90949c;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px;
    font-family: Helvetica, Arial, sans-serif;
}

.ttmdp-fb-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1c1e21;
    line-height: 1.3;
    margin-bottom: 5px;
    font-family: Helvetica, Arial, sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ttmdp-fb-desc {
    font-size: 0.85rem;
    color: #606770;
    font-family: Helvetica, Arial, sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* --------------------------------------------------------------------------
   Twitter/X card
   -------------------------------------------------------------------------- */
.ttmdp-tw-card {
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    overflow: hidden;
    max-width: 520px;
    background: #fff;
}

.ttmdp-tw-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 52.5%;
    background: #e7e7e7;
    overflow: hidden;
}

.ttmdp-tw-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttmdp-tw-body {
    padding: 12px 14px;
}

.ttmdp-tw-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f1419;
    line-height: 1.3;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ttmdp-tw-desc {
    font-size: 0.85rem;
    color: #536471;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
}

.ttmdp-tw-domain {
    font-size: 0.82rem;
    color: #536471;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .ttmdp-card { padding: 18px 16px; }
    .ttmdp-tab  { padding: 8px 12px; font-size: 0.82rem; }
    .ttmdp-serp-title { font-size: 1.1rem; }
    .ttmdp-copy-row { flex-direction: column; }
    .ttmdp-btn { width: 100%; justify-content: center; }
}
