/* --- MATERIAL 3 DARK EXPRESSIVE TOKENS --- */
:root {
    --md-sys-color-primary: #a8c7fa;
    --md-sys-color-on-primary: #063069;
    --md-sys-color-primary-container: #274781;
    --md-sys-color-on-primary-container: #d7e2ff;

    --md-sys-color-surface: #111318;
    --md-sys-color-surface-container: #1e1f25;
    --md-sys-color-surface-variant: #44474f;
    --md-sys-color-on-surface: #e2e2e9;
    --md-sys-color-on-surface-variant: #c4c6d0;

    --md-sys-color-error: #ffb4ab;
    --m3-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    min-height: 100vh;
    padding-bottom: 4rem;
}

.app-header {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.app-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--md-sys-color-primary);
    font-size: 2rem;
    font-weight: 700;
}

.app-header p {
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 0.5rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- CONTROLS --- */
.m3-card {
    background-color: var(--md-sys-color-surface);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--md-sys-color-surface-variant);
}

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

.m3-input-container {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--md-sys-color-on-surface-variant);
}

.m3-input {
    width: 100%;
    padding: 1.25rem 1rem 1.25rem 3rem;
    border-radius: 16px;
    border: 2px solid var(--md-sys-color-surface-variant);
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    transition: all 0.3s var(--m3-spring);
}

.m3-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
}

.m3-btn {
    padding: 1.25rem 2rem;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s var(--m3-spring);
}

.m3-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.m3-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.m3-btn-filled {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.m3-btn-filled:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 199, 250, 0.2);
}

.m3-btn-tonal {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.m3-btn-tonal:hover:not(:disabled) {
    background-color: #3b5c99;
}

.error-text {
    color: var(--md-sys-color-error);
    margin-top: 1rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* --- PROMO CARD DESIGN (THE EXPORT TARGET) --- */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-wrapper {
    width: 100%;
    overflow-x: auto;
    /* Allows scrolling on small mobile screens */
    padding-bottom: 1rem;
}

.promo-card {
    /* Twitter/LinkedIn standard aspect ratio proportions */
    width: 800px;
    height: 420px;
    background: linear-gradient(135deg, #1e1f25 0%, #0d0f14 100%);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Decorative background mesh/glow */
.card-background-mesh {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(168, 199, 250, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.owner-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--md-sys-color-surface-variant);
    background-color: white;
}

.owner-name {
    font-size: 1.5rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.repo-name {
    font-size: 3.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    margin-top: -0.25rem;
    line-height: 1.1;
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-title-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.repo-description {
    font-size: 1.6rem;
    line-height: 1.4;
    color: var(--md-sys-color-on-surface-variant);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90%;
}

.card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.metrics {
    display: flex;
    gap: 2rem;
}

.metric-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.metric-badge span.material-symbols-outlined {
    color: var(--md-sys-color-primary);
    font-size: 2rem;
}

.language-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.lang-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--md-sys-color-primary);
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .m3-btn {
        width: 100%;
        justify-content: center;
    }
}