:root {
    --primary: #10B981;
    --primary-hover: #059669;
    --secondary: #34D399;
    --accent: #6EE7B7;
    --bg: #0F172A;
    --surface: #1E293B;
    --surface-hover: #334155;
    --border: #334155;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --radius: 12px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.15), transparent 50%);
}

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

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

p.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s var(--transition);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
}

/* Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Input Section */
.input-section {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.6s var(--transition);
}

.url-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

input[type="url"],
input[type="text"],
textarea,
select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 1rem 1rem 1rem 3rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:not([type="url"]),
textarea,
select {
    padding-left: 1rem;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Form Grid */
.generator-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Results section */
.results-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    animation: fadeIn 0.5s var(--transition);
}

@media (min-width: 900px) {
    .results-section {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: start;
    }
}

.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.hidden {
    display: none !important;
}

.mt-xl {
    margin-top: 2rem;
}

/* Simulator */
.device-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    background: #000;
    padding: 0.25rem;
    border-radius: 8px;
    width: fit-content;
}

.device-toggle button {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.device-toggle button.active {
    background: var(--surface);
    color: white;
}

.card-simulator-wrapper {
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.card-simulator-wrapper.mobile {
    max-width: 375px;
    margin: 0 auto;
}

.card-simulator-wrapper.desktop {
    max-width: 100%;
}

.tweet-skeleton {
    width: 100%;
    max-width: 508px;
    background: #000;
    color: #E7E9EA;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
}

.tweet-header {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #333;
}

.names {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.name-line {
    width: 120px;
    height: 16px;
    background: #333;
    border-radius: 4px;
}

.handle-line {
    width: 80px;
    height: 14px;
    background: #222;
    border-radius: 4px;
}

.tweet-text {
    width: 90%;
    height: 16px;
    background: #333;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.tweet-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 0.75rem;
    color: #71767B;
    max-width: 400px;
}

/* The actual Card */
.twitter-card {
    border: 1px solid #2f3336;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.2s ease;
}

.twitter-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tc-summary_large_image .tc-img-wrapper {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background: #2f3336;
    border-bottom: 1px solid #2f3336;
    overflow: hidden;
}

.tc-summary_large_image .tc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tc-summary_large_image .tc-content {
    padding: 0.75rem;
}

/* Summary Card (small image) */
.tc-summary {
    display: flex;
    flex-direction: row;
}

.tc-summary .tc-img-wrapper {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    background: #2f3336;
    border-right: 1px solid #2f3336;
}

.tc-summary .tc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tc-summary .tc-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-width: 0;
}

.tc-domain {
    font-size: 13px;
    color: #71767B;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-title {
    color: #E7E9EA;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tc-desc {
    font-size: 13px;
    color: #71767B;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Validation Status */
.validation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.val-success {
    background: var(--success-bg);
    border-left: 3px solid var(--success);
}

.val-success svg {
    color: var(--success);
}

.val-warning {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning);
}

.val-warning svg {
    color: var(--warning);
}

.val-error {
    background: var(--error-bg);
    border-left: 3px solid var(--error);
}

.val-error svg {
    color: var(--error);
}

.val-content h4 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.val-content p {
    color: var(--text-secondary);
}

/* Code Block */
.code-block-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

pre {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.tag-name {
    color: #f472b6;
}

.attr-name {
    color: #6EE7B7;
}

.attr-value {
    color: #93c5fd;
}

/* Image Specs */
.dimension-stats {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.ok {
    color: var(--success);
}

.stat-value.warn {
    color: var(--warning);
}

.stat-value.err {
    color: var(--error);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px 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);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}