:root {
    --primary: #D63031;
    --secondary: #FF7675;
    --accent: #DFE6E9;
    --bg-color: #1A0A0A;
    --panel-bg: rgba(30, 15, 15, 0.6);
    --panel-border: rgba(214, 48, 49, 0.2);
    --text-main: #FDFBFB;
    --text-muted: #B2BEC3;
    --radius: 12px;
    --transition: all 0.25s ease;

    --tw-border: #333639;
    --li-bg: #1d2226;
    --li-border: rgba(255, 255, 255, 0.15);
    --dc-bg: #2b2d31;
    --sl-bg: #1A1D21;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(214, 48, 49, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 118, 117, 0.08) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
}

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

header {
    text-align: center;
    flex-shrink: 0;
}

header h1 {
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

main {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.editor-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

.editor-section::-webkit-scrollbar {
    width: 6px;
}

.editor-section::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 3px;
}

.editor-section h2 {
    font-size: 1.2rem;
    color: var(--accent);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.char-count.warn {
    color: #f39c12;
}

.char-count.danger {
    color: #e74c3c;
}

input[type="text"],
input[type="url"],
textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: 6px;
    font-family: inherit;
    transition: var(--transition);
    width: 100%;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(214, 48, 49, 0.2);
}

.code-generator {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--panel-border);
}

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

.code-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

#meta-code {
    background: rgba(0, 0, 0, 0.5);
    font-family: monospace;
    font-size: 0.85rem;
    color: #a4e5e6;
    white-space: pre;
}

/* Secondary Button */
.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Toggle */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.5rem;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 40px;
    height: 22px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    transition: var(--transition);
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider::before {
    transform: translateX(18px);
}

.label-text {
    font-size: 0.9rem;
}

/* Previews */
.preview-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
    align-content: start;
}

.preview-section::-webkit-scrollbar {
    width: 6px;
}

.preview-section::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 3px;
}

.platform-preview {
    padding: 1.25rem;
}

.platform-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
}

.platform-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
}

.platform-header h2 {
    font-size: 1.1rem;
    color: var(--accent);
}

/* Common Preview Card Styles */
.card {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: left;
}

.card:not(.dark) {
    background: #fff !important;
    color: #000 !important;
    border-color: #e1e8ed !important;
}

/* Twitter */
.twitter-card {
    border: 1px solid var(--tw-border);
    background: transparent;
    color: #fff;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
}

.t-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--tw-border);
}

.t-content {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.t-domain {
    color: #71767b;
    font-size: 13px;
}

.t-title {
    font-size: 15px;
    color: #e7e9ea;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.twitter-card:not(.dark) .t-domain,
.twitter-card:not(.dark) .t-desc {
    color: #536471;
}

.twitter-card:not(.dark) .t-title {
    color: #0f1419;
}

.twitter-card:not(.dark) .t-image {
    border-bottom-color: #cfd9de;
}

.twitter-card:not(.dark) {
    border-color: #cfd9de;
}

/* LinkedIn */
.linkedin-card {
    border: 1px solid var(--li-border);
    background: var(--li-bg);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

.l-image {
    width: 100%;
    aspect-ratio: 1.91 / 1;
    background-size: cover;
    background-position: center;
}

.l-content {
    padding: 8px 16px 16px;
    background: var(--li-bg);
}

.l-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.l-domain {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.linkedin-card:not(.dark) {
    background: #eef3f8;
    border-color: transparent;
}

.linkedin-card:not(.dark) .l-content {
    background: #eef3f8;
}

.linkedin-card:not(.dark) .l-title {
    color: rgba(0, 0, 0, 0.9);
}

.linkedin-card:not(.dark) .l-domain {
    color: rgba(0, 0, 0, 0.6);
}

/* Discord */
.discord-card {
    background: var(--dc-bg);
    border-radius: 4px;
    display: flex;
    padding: 8px 16px 16px 12px;
    position: relative;
    border-left: 4px solid #1e1f22;
}

.d-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 4px;
    width: 100%;
}

.d-site-name {
    font-size: 12px;
    color: #b5bac1;
    margin-top: 4px;
}

.d-title {
    font-size: 16px;
    font-weight: 600;
    color: #00A8FC;
    cursor: pointer;
}

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

.d-desc {
    font-size: 14px;
    color: #dbdee1;
    margin-bottom: 8px;
}

.d-image-container {
    max-width: 400px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}

.d-image-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1.91/1;
}

.discord-card:not(.dark) {
    background: #f2f3f5;
    border-left-color: #e3e5e8;
}

.discord-card:not(.dark) .d-site-name {
    color: #4e5058;
}

.discord-card:not(.dark) .d-title {
    color: #006ce7;
}

.discord-card:not(.dark) .d-desc {
    color: #313338;
}

/* Slack */
.slack-card {
    display: flex;
    background: transparent;
    color: #d1d2d3;
}

.s-sidebar {
    width: 4px;
    background: #e3e4e6;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.s-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.s-site {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #d1d2d3;
}

.s-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.s-title {
    font-size: 15px;
    font-weight: 700;
    color: #1D9BD1;
    margin-top: 2px;
}

.s-desc {
    font-size: 15px;
    color: #d1d2d3;
    margin-top: 2px;
    margin-bottom: 8px;
}

.s-image-container img {
    max-width: 360px;
    max-height: 250px;
    border-radius: 4px;
    object-fit: cover;
}

.slack-card:not(.dark) {
    color: #1d1c1d;
}

.slack-card:not(.dark) .s-site {
    color: #1d1c1d;
}

.slack-card:not(.dark) .s-title {
    color: #1264a3;
}

.slack-card:not(.dark) .s-desc {
    color: #1d1c1d;
}

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

    .app-container {
        height: auto;
    }
}