/* ============================================================
   Meta Tag Analyzer — Cyan Dark Theme
   ============================================================ */
:root {
    --primary: #06B6D4;
    --primary-hover: #22D3EE;
    --primary-glow: rgba(6, 182, 212, 0.25);
    --secondary: #22D3EE;
    --accent: #A5F3FC;
    --danger: #EF4444;
    --warning: #F59E0B;
    --success: #10B981;

    --bg-base: #0C0C1D;
    --bg-surface: #12122A;
    --bg-elevated: #1A1A35;
    --bg-hover: #222244;
    --bg-active: #2A2A55;

    --text-primary: #F0F0FA;
    --text-secondary: #9CA3C0;
    --text-muted: #6B7299;

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-focus: var(--primary);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, .08), transparent), radial-gradient(ellipse 60% 40% at 80% 100%, rgba(34, 211, 238, .05), transparent);
    pointer-events: none;
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    padding: 24px 0 16px;
    gap: 14px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: .82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: .85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #3B82F6);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 16px var(--primary-glow);
}

.btn-ghost {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 5px 10px;
    font-size: .78rem;
}

.btn-icon-sm {
    padding: 4px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.btn-icon-sm:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

/* Input */
.input-section {
    margin-bottom: 24px;
}

.input-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: 10px;
    width: fit-content;
}

.tab {
    padding: 6px 16px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--primary);
    color: #fff;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 6px 8px 6px 16px;
    box-shadow: var(--shadow-md);
}

.search-bar:focus-within {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: .92rem;
    padding: 10px 8px;
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.html-textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: .82rem;
    resize: vertical;
    outline: none;
    line-height: 1.6;
}

.html-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: var(--text-muted);
}

.loading[hidden] {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* Score Card */
.score-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.score-ring-wrap {
    position: relative;
    flex-shrink: 0;
}

.score-ring {
    display: block;
}

.score-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.score-grade {
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .1em;
}

.score-details {
    flex: 1;
}

.score-details h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.score-summary {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.score-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.score-chip {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}

.score-chip.pass {
    background: rgba(16, 185, 129, .12);
    color: var(--success);
}

.score-chip.fail {
    background: rgba(239, 68, 68, .12);
    color: var(--danger);
}

.score-chip.warn {
    background: rgba(245, 158, 11, .12);
    color: var(--warning);
}

/* Section Title */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Previews */
.previews-section {
    margin-bottom: 24px;
}

.previews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.preview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.preview-label {
    padding: 10px 14px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
}

/* Google */
.google-preview {
    padding: 14px;
    font-family: Arial, sans-serif;
}

.gp-url {
    font-size: .75rem;
    color: #70757a;
    margin-bottom: 2px;
}

.gp-title {
    font-size: 1.1rem;
    color: #8ab4f8;
    margin-bottom: 2px;
    cursor: pointer;
}

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

.gp-desc {
    font-size: .82rem;
    color: #bdc1c6;
    line-height: 1.5;
}

/* OG */
.og-preview {
    display: flex;
    flex-direction: column;
}

.og-image {
    height: 140px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: .82rem;
    overflow: hidden;
}

.og-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.og-content {
    padding: 10px 14px;
}

.og-site {
    font-size: .7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 2px;
}

.og-title {
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.og-desc {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Twitter */
.twitter-preview {
    display: flex;
    flex-direction: column;
}

.tw-image {
    height: 140px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: .82rem;
    overflow: hidden;
}

.tw-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tw-content {
    padding: 10px 14px;
}

.tw-title {
    font-size: .92rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.tw-desc {
    font-size: .78rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.tw-domain {
    font-size: .7rem;
    color: var(--text-muted);
}

/* Tags Table */
.tags-section {
    margin-bottom: 24px;
}

.tags-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 2px;
    margin-bottom: 12px;
    width: fit-content;
    flex-wrap: wrap;
}

.ttab {
    padding: 5px 14px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ttab:hover {
    color: var(--text-primary);
}

.ttab.active {
    background: var(--primary);
    color: #fff;
}

.tags-table-wrap {
    overflow-x: auto;
}

.tags-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.tags-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.tags-table td {
    padding: 8px 14px;
    font-size: .82rem;
    border-bottom: 1px solid var(--border);
    max-width: 400px;
    word-break: break-all;
}

.tags-table tr:hover td {
    background: var(--bg-hover);
}

.tags-table td:first-child {
    font-family: var(--font-mono);
    font-size: .78rem;
    font-weight: 500;
    color: var(--primary);
    white-space: nowrap;
}

.tag-cat {
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tag-cat.standard {
    background: rgba(6, 182, 212, .12);
    color: var(--primary);
}

.tag-cat.og {
    background: rgba(59, 130, 246, .12);
    color: #3B82F6;
}

.tag-cat.twitter {
    background: rgba(29, 155, 240, .12);
    color: #1D9BF0;
}

.tag-cat.other {
    background: rgba(139, 92, 246, .12);
    color: #8B5CF6;
}

/* Warnings */
.warnings-section {
    margin-bottom: 24px;
}

.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.warning-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .85rem;
}

.warning-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-item.error .warning-icon {
    color: var(--danger);
}

.warning-item.warn .warning-icon {
    color: var(--warning);
}

.warning-item.info .warning-icon {
    color: var(--primary);
}

.warning-text strong {
    display: block;
    margin-bottom: 2px;
}

.warning-text span {
    font-size: .78rem;
    color: var(--text-secondary);
}

/* Actions */
.actions-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

/* History */
.history-section {
    margin-top: 8px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-item {
    padding: 6px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: .78rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: .85rem;
    animation: toastSlide 300ms ease;
    max-width: 360px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--primary);
}

.toast-exit {
    animation: toastExit 200ms ease forwards;
}

@keyframes toastSlide {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

@keyframes toastExit {
    from {
        opacity: 1
    }

    to {
        opacity: 0;
        transform: translateX(100%)
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-active);
    border-radius: 3px;
}

@media(max-width:768px) {
    .score-card {
        flex-direction: column;
        text-align: center;
    }

    .previews-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:480px) {
    .app-container {
        padding: 0 12px 40px;
    }

    .app-header h1 {
        font-size: 1.1rem;
    }

    .subtitle {
        display: none;
    }
}