:root {
    --primary: #6C63FF;
    --primary-hover: #5A52D5;
    --secondary: #00F0FF;
    --bg-color: #0F0A1A;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-muted: #A0A0B0;
    --error: #FF4D4D;
    --success: #00E676;
    --warning: #FFC107;

    --twitter-bg: #15202B;
    --twitter-border: #38444D;
    --fb-bg: #F0F2F5;
    --fb-border: #CED0D4;
    --fb-text: #1C1E21;
    --fb-text-muted: #65676B;
    --li-bg: #EEF3F8;
    --li-border: #DCE6F1;
    --li-text: #000000;
    --li-text-muted: rgba(0, 0, 0, 0.6);
    --slack-border: #DDDDDD;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(108, 99, 255, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.1), transparent 25%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.input-section {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input[type="url"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--surface-border);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

.hidden {
    display: none !important;
}

.layout-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem;
}

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

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

h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge.good {
    background: rgba(0, 230, 118, 0.2);
    color: var(--success);
}

.badge.warn {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning);
}

.badge.poor {
    background: rgba(255, 77, 77, 0.2);
    color: var(--error);
}

.warnings-list {
    list-style: none;
    font-size: 0.95rem;
}

.warnings-list li {
    padding: 0.75rem;
    background: rgba(255, 77, 77, 0.1);
    border-left: 3px solid var(--error);
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.warnings-list li.missing::before {
    content: "⚠️";
}

.tags-section {
    margin-top: 2rem;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
}

td:first-child {
    color: var(--secondary);
    font-family: monospace;
    white-space: nowrap;
}

td:last-child {
    word-break: break-work;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    color: white;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

/* Social Cards Base */
.card-mockup {
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0 auto;
    max-width: 500px;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background: #E1E8ED;
    overflow: hidden;
    position: relative;
}

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

.og-image[src=""] {
    display: none;
}

.card-image-wrapper::after {
    content: 'No Image';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #657786;
    font-size: 1.2rem;
    font-weight: 500;
    z-index: 0;
}

.og-image {
    position: relative;
    z-index: 1;
}

/* Twitter Card */
.twitter-card {
    background: var(--twitter-bg);
    border: 1px solid var(--twitter-border);
    color: #fff;
}

.twitter-card .card-content {
    padding: 0.75rem 1rem;
}

.twitter-card .og-domain {
    color: #8899A6;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
    text-transform: lowercase;
}

.twitter-card .og-title {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.twitter-card .og-description {
    color: #8899A6;
    font-size: 0.85rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Facebook Card */
.facebook-card {
    background: var(--fb-bg);
    border: 1px solid var(--fb-border);
    color: var(--fb-text);
}

.facebook-card .card-content {
    padding: 10px 12px;
}

.facebook-card .og-domain {
    color: var(--fb-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.facebook-card .og-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.facebook-card .og-description {
    color: var(--fb-text-muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* LinkedIn Card */
.linkedin-card {
    background: var(--li-bg);
    border: 1px solid var(--li-border);
    border-radius: 0;
    color: var(--li-text);
}

.linkedin-card .card-content {
    padding: 8px 16px;
    background: #F8FAFD;
}

.linkedin-card .og-title {
    font-size: 14px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 2px;
}

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

/* Slack Card */
.slack-card {
    border-left: 4px solid #DDDDDD;
    padding-left: 12px;
    font-family: 'Lato', -apple-system, sans-serif;
}

.slack-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.slack-header img {
    width: 16px;
    height: 16px;
}

.slack-header .og-site-name {
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    /* Adjusted for dark theme app container */
}

.slack-title {
    color: #1264A3;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.slack-description {
    font-size: 15px;
    color: #CCCCCC;
    margin-bottom: 10px;
}

.slack-card .card-image-wrapper {
    max-width: 360px;
    border-radius: 8px;
    aspect-ratio: auto;
}

.slack-card .og-image {
    max-height: 250px;
    object-fit: contain;
    object-position: left top;
}