:root {
    --bg: #0f1724;
    /* dark navy */
    --card: #0b1220;
    --muted: #94a3b8;
    --accent: #7c3aed;
    /* violet */
    --accent-2: #06b6d4;
    /* teal */
    --surface: #0b1220;
    --text: #e6eef8;
    --white: #ffffff;
    --bg-dark: #071020;

    /* Clouds */
    --clouds-01: #475569;
    --clouds-02: #64748b;
    --clouds-03: #94a3b8;
    --clouds-04: #cbd5e1;
    --clouds-05: #f1f5f9;

    /* Accent Glassmorphism */
    --glass-accent-01: rgba(124, 58, 237, 0.1);
    --glass-accent-02: rgba(124, 58, 237, 0.2);
    --glass-accent-02: rgba(124, 58, 237, 0.2);
    --glass-accent-03: rgba(124, 58, 237, 0.3);

    --glass-accent-04: rgba(124, 58, 237, 0.4);
    --glass-accent-05: rgba(124, 58, 237, 0.5);
    --glass-accent-08: rgba(124, 58, 237, 0.8);

    /* Cyan Glassmorphism */
    --glass-cyan-01: rgba(6, 182, 212, 0.1);
    --glass-cyan-02: rgba(6, 182, 212, 0.2);
    --glass-cyan-03: rgba(6, 182, 212, 0.3);
    --glass-cyan-04: rgba(6, 182, 212, 0.4);
    --glass-cyan-05: rgba(6, 182, 212, 0.5);
    --glass-cyan-08: rgba(6, 182, 212, 0.8);

    /* Glassmorphism */
    --glass-01: rgba(255, 255, 255, 0.01);
    --glass-02: rgba(255, 255, 255, 0.02);
    --glass-03: rgba(255, 255, 255, 0.03);
    --glass-04: rgba(255, 255, 255, 0.04);
    --glass-05: rgba(255, 255, 255, 0.05);
    --glass-08: rgba(255, 255, 255, 0.08);
    --glass-20: rgba(255, 255, 255, 0.1);
    /*Shines*/
    --shine-01: rgba(124, 58, 237, 0.1);
    --shine-02: rgba(124, 58, 237, 0.2);
    --shine-03: rgba(124, 58, 237, 0.3);
    --shine-04: rgba(124, 58, 237, 0.4);
    --shine-05: rgba(124, 58, 237, 0.5);
    --shine-06: rgba(124, 58, 237, 0.6);
    /* Shadows */
    --shadow-60: rgba(12, 18, 54, 0.6);
    --shadow-30: rgba(0, 0, 0, 0.3);
    --teal-600: #0891b2;
    --amber-500: #f59e0b;
    --amber-600: #d97706;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-light: #ffb4b4;
    --muted-600: #6b7280;
    --amber-08: rgba(245, 158, 11, 0.08);
    --amber-12: rgba(245, 158, 11, 0.12);
    --yellow-400: #fbbf24;
    --cyan-08: rgba(6, 182, 212, 0.08);
    --cyan-12: rgba(6, 182, 212, 0.12);
    --cyan-300: #67e8f9;
    --accent-16: rgba(124, 58, 237, 0.16);
    --accent2-06: rgba(6, 182, 212, 0.06);
    --accent-20: rgba(124, 58, 237, 0.2);
    --glass-12: rgba(255, 255, 255, 0.12);
    --glass-15: rgba(255, 255, 255, 0.15);

    /* Grass */
    --grass-accent-03: rgba(25, 255, 89, 0.5);
    --grass-accent-04: rgba(25, 255, 89, 0.4);
    --grass-accent-05: rgba(25, 255, 89, 0.5);
    --grass-accent-07: rgba(25, 255, 89, 0.7);
    --grass-accent-08: rgba(25, 255, 89, 0.8);
    --grass-accent-09: rgba(25, 255, 89, 0.9);
    --grass-accent-10: rgba(25, 255, 89, 1);

    --midnight-blue: rgb(7, 6, 75);
    --black: rgb(0, 0, 0);
    --blue: rgb(0, 0, 255);


}

/* --- Aggregator Index (Blazor) tweaks to match legacy Razor layout --- */
.aggregator-index .clickable-card {
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
}

.aggregator-index .profile-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aggregator-index .at-name {
    margin: 0;
}

@font-face {
    font-family: 'FiraCode', sans-serif;
    src: url('/fonts/FiraCode-Regular.ttf') url('/fonts/FiraCode-Bold.ttf') url('/fonts/FiraCode-Medium.ttf') url('/fonts/FiraCode-Light.ttf') url('/fonts/FiraCode-Retina.ttf');
}

@font-face {
    font-family: "MesloLGS NF";
    src: url('/fonts/MesloLGLNerdFont-Regular.ttf') url('/fonts/MesloLGLNerdFont-Bold.ttf') url('/fonts/MesloLGLNerdFont-Italic.ttf') url('/fonts/MesloLGLNerdFont-BoldItalic.ttf');
}

* {
    box-sizing: border-box;
    font-family: 'FiraCode', sans-serif;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: linear-gradient(180deg, var(--bg), var(--bg-dark) 120%);
    text-decoration: none;
    /* remove underline on anchor buttons */
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

main {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

header {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    width: 100%;
    background: linear-gradient(90deg, var(--glass-02), var(--glass-01));
    border-bottom: 2px solid var(--glass-03);
    backdrop-filter: blur(6px);
    height: 5vh
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert {
    position: fixed;
    left: 40px;
    max-width: 300px;
    text-overflow: wrap;
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    gap: 6px;
    z-index: 10000;
}

.alert-success {
    background-color: var(--grass-accent-07);
    border: 1px solid var(--accent);
    color: var(--white);
    bottom: 10px;
    display: none;
}

.alert-error {
    background-color: var(--danger-600);
    border: 1px solid var(--danger-500);
    color: var(--white);
    bottom: 60px;
    display: none;
}

.alert-danger {
    background-color: var(--amber-500);
    border: 1px solid var(--amber-600);
    color: var(--white);
    top: 60px;
    display: none;
}

.site-footer {
    background: linear-gradient(90deg, var(--glass-02), var(--glass-01));
    border-top: 2px solid var(--glass-03);
    backdrop-filter: blur(6px);
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 0cap;
    padding-bottom: 10px;
    padding-top: 10px;
    position: relative;
    bottom: 0;
    width: 100%;
    height: 5vh;
    margin-top: 2vh;
}

.site-footer:hover {
    background: linear-gradient(90deg, var(--glass-04), var(--glass-02));
    transform: translateY(-2px);
}

.site-footer .logo {
    font-size: 1.2rem;
}

.footer-text {
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 600;
}

.slogan1 {
    font-weight: 800;
    color: var(--accent);
}

.slogan2 {
    color: var(--accent-2);
}

.icon {
    font-family: "Fira Code", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    text-decoration: none;
}

.site-footer:hover {
    background: linear-gradient(90deg, var(--glass-04), var(--glass-02));
    transform: translateY(-2px);
}

.topnav-left {
    display: flex;
    flex-shrink: row;
    gap: 12px;
    align-items: center;
    padding: 14px 20px;
}

.topnav-right {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px 20px;
    margin-left: auto;
}

.topnav-link {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-left: 8px;
    margin-right: 8px;
}

.topnav-link:hover {
    background-color: var(--glass-05);
    color: var(--white);
    transition: background-color 0.2s, color 0.2s;
    transform: translateY(-1px);
}

.topnav .active,
.topnav-link.active {
    background-color: var(--accent-16);
    color: var(---white);
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-accent-03);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--accent);
    transition: .4s;
    border-radius: 50%;
}

.switch input:checked+.slider {
    background: var(--accent-2);
}

.switch input:checked+.slider:before {
    transform: translateX(16px);
    background: var(--accent);
}

form {
    width: 100%;
    /*margin: 40px auto;
    display: flex;
    flex-direction: column;*/
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    padding-top: 2vh;
    border: 1px solid var(--glass-05);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-16);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--glass-05);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-label {
    display: block;
    margin-top: 6px;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--muted);
    font-size: 14px;
}

.form-text {
    margin-top: 4px;
    font-size: 8;
    color: var(--amber-600);
}

#url-preview {
    letter-spacing: 0.05em;
    text-transform: lowercase;
    cursor: not-allowed;
}

.submit-button {
    width: 50%;
    height: 40px;
    margin-top: 1vh;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background-color: var(--accent);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    align-self: center !important;
}

.submit-button:hover {
    background-color: var(--accent-2);
    transform: translateY(-1px);
    transition: background-color 0.2s, transform 0.2s;
}

.submit-button:disabled {
    background-color: var(--clouds-01);
    cursor: not-allowed;
    transform: none;
    transition: background-color 0.2s, transform 0.2s;
}

.card {
    background-color: var(--card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-30);
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.card-text {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.mb-3 {
    margin-bottom: 16px;
}

.profile-picture {
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    width: 120px;
    height: 120px;
    object-fit: cover;
    object-position: center;
}

.profile-picture-fallback {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'FiraCode', monospace;
}

.profile-picture-holder {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: auto;
    width: 100%;
    margin-bottom: 2.5vh;
}

.at-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-top: 2vh;
}

.aggregator-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin-bottom: -2vh;
    margin-top: -1.5vh;
}

.add-link-container {
    transition: transform 220ms ease, box-shadow 220ms ease;
    will-change: transform;
}

.add-link-container.animating {
    z-index: 10;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.reorder-up,
.reorder-down {
    cursor: pointer;
    background: none;
    box-shadow: 0 4px 12px var(--shadow-30);
    border: none;
    color: var(--white);
    font-size: 2rem;
}

.reorder-up:hover {
    transform: translateY(-4px);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.reorder-down:hover {
    transition: border-color 0.2s, box-shadow 0.2s;
    transform: translateY(4px);
}

.rendered-aggregator-card {
    background-color: var(--card);
    margin: 40px auto;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.card-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 20px;
    color: var(--muted);
    position: fixed;
    bottom: 10vh;
    padding: 2vh 2vw;
    cursor: pointer;
    background: linear-gradient(180deg, var(--bg), var(--bg-dark) 120%);
}

.update-pp-button {
    font-size: 2.5rem;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    margin-top: -128px;
    margin-left: 128px;
}

/* Profile picture crop modal */
.pp-crop-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-crop-backdrop {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.pp-crop-dialog {
    position: relative;
    z-index: 20001;
    background: var(--card);
    border-radius: 8px;
    padding: 12px;
    width: fit-content;
    height: fit-content;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pp-crop-body {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-direction: column;
    width: fit-content;
    height: fit-content;
}

.pp-crop-viewport {
    width: 256px;
    height: 256px;
    overflow: hidden;
    background: #222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Cropper.js circular overrides (make the visible crop box circular) */
.pp-crop-dialog .cropper-view-box,
.pp-crop-dialog .cropper-face {
    border-radius: 50% !important;
    overflow: hidden !important;
}

.pp-crop-dialog .cropper-line,
.pp-crop-dialog .cropper-point,
.pp-crop-dialog .cropper-center {
    display: none !important;
}

.pp-crop-dialog .cropper-view-box {
    box-shadow: none !important;
}

.pp-crop-viewport img {
    user-select: none;
    pointer-events: none;
    max-width: none;
}

.pp-crop-controls {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: fit-content;
    max-width: 90%;
    font-size: 1.5rem;
    padding-bottom: 1vh;
    background: none;
    color: var(--white);
}

.zoom-minus {
    grid-column: 3;
    grid-row: 1;
}

.zoom-plus {
    grid-column: 1;
    grid-row: 1;
}

#pp-zoom {
    grid-column-start: 1;
    grid-column-end: 4;
    grid-row: 2;
}

#pp-crop-cancel {
    grid-column: 3;
    grid-row: 3;
    color: var(--white);
    padding-top: 20px;
    font-size: 2rem;
    cursor: pointer;
}

#pp-crop-apply {
    grid-column: 1;
    grid-row: 3;
    color: var(--white);
    padding-top: 20px;
    font-size: 2rem;
    cursor: pointer;
}

.cropper-crop-box {
    width: fit-content;
    height: fit-content;
}

.clickable-card {
    text-decoration: none !important;
    color: inherit !important;
    border-radius: 14px;
    box-shadow: 0 4px 12px var(--shine-03);
    padding: 8px 12px;
    margin-bottom: 40px;
    background: none;
    display: flex;
    width: 100%;
    height: fit-content;
}

.clickable-card:hover {
    box-shadow: 0 6px 24px var(--shine-01);
    transform: translateY(-2px);
    transition: box-shadow 0.2s, transform 0.2s;
}

.is-active {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}

.link-holder {
    position: relative;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: auto;
}

.add-link-button-holder:hover {
    box-shadow: var(--shine-03);
    background-color: var(--glass-cyan-08);
    transform: translateY(-1px);
    transition: box-shadow 0.2s, transform 0.2s, background-color 0.2s;
    cursor: pointer;
}

.add-link-button {
    color: var(--white);
    font-size: 2.5rem;
}

.card-preview {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 100%;
    max-width: 20%;
    height: 100%;
    max-height: 600px;
    overflow-y: auto;
    z-index: 1000;
    background-color: var(--card);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px 4px var(--shine-03);
}

.logo {
    display: inline-flex;
    align-items: center;
    font-family: 'FiraCode', monospace;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    user-select: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-part-primary {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-part-secondary {
    color: var(--accent-2);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-part-domain {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9em;
    margin-left: 1px;
}

.full-page-aggregator-view {
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    height: 100%;
    margin: 0;
}

.add-link-container {
    display: grid;
    grid-template-columns: 3% auto auto auto auto auto 65% auto;
    gap: 5px;
    background-color: var(--glass-accent-01);
    color: var(--surface);
    padding: 5px;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 10px;
    place-items: center;
    box-shadow: 0 4px 12px var(--shadow-30);
}

.add-link-drag {
    grid-column-start: 0;
    grid-column-end: 1;
    grid-row-start: 1;
    grid-row-end: 4;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 20px;
}

.add-link-title {
    display: flex;
    flex-direction: row;
    grid-column-start: 1;
    grid-column-end: 8;
}

.add-link-publish {
    grid-column-start: 8;
    grid-column-end: 8;
}

.add-link-url {
    display: flex;
    flex-direction: row;
    grid-column-start: 1;
    grid-column-end: 8;
}

.add-link-input {
    position: relative;
}

.edit-toggle {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    margin-left: 8px;
    padding: 6px;
    border-radius: 6px;
}

.edit-toggle.editing {
    color: var(--accent);
}

.add-link-input .editable[readonly] {
    background-color: transparent;
    color: var(--muted);
    caret-color: transparent;
    cursor: pointer;
}

.add-link-input .editable:not([readonly]) {
    background-color: var(--card);
    color: var(--text);
}

.add-link-layout {
    grid-column-start: 1;
    grid-column-end: 1;
}

.add-link-thumb {
    grid-column-start: 2;
    grid-column-end: 2;
}

.add-link-schedule {
    grid-column-start: 3;
    grid-column-end: 3;
}

.add-link-utilities {
    width: 95%;
    grid-column-start: 1;
    grid-column-end: 9;
    grid-row: 3;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-rows: 1fr;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.add-link-search {
    grid-column-start: 1;
    grid-column-end: 1;
    grid-row: 1;
}

.add-link-remove {
    grid-column: 4;
    grid-row: 1;
}

.add-link-undelete {
    grid-column: 3;
    grid-row: 1;
}

.icon-btn {
    font-size: 1.5rem;
    color: var(--white);
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.add-link-icon {
    font-size: 1.5rem;
    color: var(--white);
    padding-right: 10px;
    padding-left: 5px;
    background: none;
    border: none;
    cursor: pointer;
    align-self: center;
}


.add-link-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--glass-accent-04);
    background-color: var(--card);
    box-shadow: 0 2px 4px var(--shadow-30);
    border-radius: 8px;
    color: var(--muted);
}

.grab {
    box-sizing: border-box;
    min-width: 100%;
    min-height: 100%;
    cursor: grab;
}

.rendered-link-holder {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: auto;
    flex-direction: column;
    height: fit-content;
    min-width: 95%;
}

.rendered-link-container {
    background-color: var(--glass-accent-01);
    color: var(--surface);
    background: var(--black);
    padding: 8px 12px;
    margin-top: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-30);
    align-items: center;
    justify-content: center;
    height: fit-content;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    /*box-shadow: 0 8px 24px var(--accent-2);*/
}

.rendered-link-container a {
    text-decoration: none;
    color: inherit;
}

.rendered-link-container:hover {
    translate: transformY(-4px);
    background-color: var(--midnight-blue);
    border-style: double;
    border-color: var(--blue);
    cursor: pointer;
}

/* When there is no thumbnail, adjust grid so text spans full width */
.rendered-link-container.no-thumb {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
}

.rendered-link-container.no-thumb .rendered-link-title,
.rendered-link-container.no-thumb .rendered-link-url {
    grid-column: 1;
}

/* Placeholder styling for unsaved/empty fields */
.rendered-link-title.placeholder,
.rendered-link-url.placeholder {
    opacity: 0.55;
    font-style: italic;
}

.fallback-link-thumbnail {
    /* Use brand color and occupy the full space of the thumbnail slot */
    color: var(--accent-2);
    width: 100%;
    height: 100%;
}

/* Ensure the SVG fills the container so it uses the maximum available width/height */
.fallback-link-thumbnail svg {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 42px;
    min-height: 42px;
}

.rendered-link-thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    margin-right: 12px;
    vertical-align: middle;
    grid-column: 1;
    grid-row-start: 1;
    grid-row-end: 3;
}

.rendered-link-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    grid-column: 2;
    grid-row: 1;
}

.rendered-link-url {
    font-size: 1.1rem;
    color: var(--muted);
    word-break: break-all;
    grid-column: 2;
    grid-row: 2;
}

.rendered-aggregator-card {
    background-color: var(--card);
    margin: 40px auto;
    display: flex;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    min-height: 1000px;
    height: fit-content;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px var(--shadow-30);
}

.manage-section {
    width: 100%;
    margin-top: 24px;
    padding-top: 8px;
    border-top: 1px solid var(--glass-03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.manage-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 8px;
}

.danger {
    background-color: var(--danger-500);
}

.danger:hover {
    background-color: var(--danger-700) !important;
}

.form-input:read-only {
    background-color: var(--card);
    color: var(--muted);
    caret-color: transparent;
    cursor: not-allowed;
}

.section-title {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
    margin-top: 2vh;
    margin-bottom: 2vh;
}

.item-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-main .meta {
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.5px;
}

.subscription-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
    flex-wrap: wrap;
}

.danger-zone {
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-30);
    border-top: 2px solid var(--danger-500);
}

.badge {
    background: var(--glass-accent-02);
    color: var(--white);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-select.slim {
    min-width: 140px;
}

.stack {
    display: flex;
    flex-direction: column;
}

.gap-sm {
    gap: 12px;
}

.list-group.compact .list-group-item {
    padding: 8px 12px;
}

.profile-picture-mini {
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    width: 60px;
    height: 60px;
    object-fit: cover;
    object-position: center;
    margin-right: 2vw;
}

.profile-picture-fallback-mini {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    font-family: 'FiraCode', monospace;
}

.profile-picture-holder-mini {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    height: auto;
    width: 50%;
    min-width: fit-content;
}

.aggregator-manage-list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    gap: 5%;
    width: 100%;
    align-self: center;
    margin-top: 2vh;
}

.manager-grid-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    min-width: fit-content;
    max-width: max-content;
    gap: 12px;
    margin-bottom: 1vh;
}

.manager-grid-pp {
    grid-column: 1;
    grid-row: 1;
}

.manager-grid-label {
    grid-column: 3;
    grid-row: 1;
}

.add-aggregator-button {
    margin-top: 4vh;
}

.delete-aggregator-button {
    margin-left: auto;
    width: fit-content;
}

@media (max-width: 1200px) {
    .card {
        flex-direction: column;
        max-width: 700px;
    }

    .card-preview {
        position: static;
        max-width: 100%;
        height: auto;
        margin-top: 5vh;
    }

    .submit-button {
        margin-left: auto;
        margin-right: auto;
        width: 50%;
    }

    .manager-grid-item {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .manager-grid-label {
        grid-column: 1;
        grid-row: 2;
        margin-top: 1vh;
    }

    .manager-grid-pp {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 1vh;
        margin-top: 2vw;
    }
}

@media (max-width: 900px) {
    .submit-button {
        width: 70%;
    }

    .card {
        max-width: 600px;
    }

    .pp-crop-body {
        min-width: fit-content;
        min-height: fit-content;
    }

    .pp-crop-dialog {
        max-width: 90vw;
    }

    .profile-picture-holder-mini {
        flex-direction: column;
        height: auto;
        width: 50%;
        min-width: fit-content;
    }

    .aggregator-manage-list {
        flex-direction: column;
        align-items: center;
    }

    .add-aggregator-button {
        margin-top: 3vh;
    }

    .delete-aggregator-button {
        margin-left: auto;
    }
}

@media (max-width: 600px) {
    .submit-button {
        width: 90%;
    }

    .card {
        max-width: 400px;
    }
}

/* --- Home Page Enhancements --- */
.hero {
    position: relative;
    padding: clamp(3rem, 8vh, 6rem) 2rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.75rem;
    width: 100%;
    min-width: 50%;
}

.hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(124, 58, 237, 0.35), transparent 60%), radial-gradient(circle at 70% 70%, rgba(6, 182, 212, 0.25), transparent 65%);
    filter: blur(60px);
    opacity: .55;
    pointer-events: none;
}

.hero-inner {
    max-width: 1100px;
    width: 100%;
    min-width: 280px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.08;
    margin: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    letter-spacing: -1px;
    width: 100%;
}

.hero,
.features-carousel,
.value-props,
.cta-final {
    overflow: visible;
}

.carousel-track {
    will-change: transform;
}

.features-carousel {
    overflow: hidden;
}

.hero-sub {
    margin: 0 auto;
    max-width: 720px;
    width: 100%;
    min-width: 280px;
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    color: var(--clouds-03);
    line-height: 1.5;
}

.hero-cta-group {
    display: flex;
    gap: .9rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: .5rem;
    width: 100%;
}

/* Ensure hero CTAs never show underline (higher specificity) */
.hero-cta-group .btn,
.hero-cta-group .btn:focus,
.hero-cta-group .btn:hover {
    text-decoration: none !important;
}

/* text-decoration reset merged into primary button block */

.btn {
    cursor: pointer;
    border: 0;
    font-weight: 600;
    border-radius: 14px;
    padding: .95rem 1.35rem;
    font-size: .95rem;
    letter-spacing: .3px;
    align-items: center;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 6px 28px -8px rgba(124, 58, 237, .55), 0 2px 6px -2px rgba(6, 182, 212, .5);
}

.btn-primary:hover {
    filter: brightness(1.1);
    text-decoration: none;
}

.btn-ghost {
    background: var(--accent-16);
    color: var(--clouds-04);
    border: 1px solid var(--glass-08);
}

.btn-ghost:hover {
    background: var(--glass-08);
    color: var(--white);
    text-decoration: none;
}

.btn:focus,
.btn-primary:focus,
.btn-ghost:focus {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    text-decoration: none;
}

.btn-lg {
    padding: 1.05rem 1.8rem;
    font-size: 1rem;
    text-decoration: none;
}

.btn-xl {
    padding: 1.25rem 2.4rem;
    font-size: 1.05rem;
    text-decoration: none;
}

.pill {
    background: rgba(255, 255, 255, 0.06);
    padding: .55rem .9rem;
    border-radius: 999px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--clouds-04);
    border: 1px solid var(--glass-08);
}

.hero-trust {
    display: flex;
    gap: .65rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2vh;
}

/* Carousel */
.features-carousel {
    margin: 1rem auto 3.5rem;
    padding: 0 1rem 1rem;
    max-width: 1240px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.carousel-track {
    display: flex;
    align-items: center;
    transition: transform .7s cubic-bezier(.65, .05, .36, 1);
    width: 100%;
    box-sizing: border-box;
}

.feature-card {
    flex: 0 0 100%;
    padding: 1.6rem clamp(1rem, 2.2vw, 2rem);
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: clamp(1rem, 1.8vw, 2.4rem);
    align-items: center;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .35s ease, visibility .35s ease;
    min-height: 120px;
}

.feature-card.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.feature-card img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .45), 0 4px 12px -4px rgba(0, 0, 0, .35);
    display: block;
}

.feature-card h3 {
    margin: 0 0 .65rem;
    font-size: clamp(1.55rem, 2vw, 2rem);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.feature-card p {
    margin: 0;
    line-height: 1.55;
    color: var(--clouds-03);
    font-size: clamp(.95rem, 1.1vw, 1.05rem);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.carousel-btn {
    pointer-events: auto;
    background: var(--glass-08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--white);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .25s, transform .25s;
}

.carousel-btn:hover {
    background: rgba(124, 58, 237, 0.45);
    transform: scale(1.08);
}

.carousel-dots {
    display: flex;
    gap: .55rem;
    justify-content: center;
    margin-top: .65rem;
}

.carousel-dots .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: background .35s, transform .35s;
}

.carousel-dots .dot.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    transform: scale(1.25);
}

/* Value props */
.value-props {
    padding: 1rem 1rem 3rem;
    max-width: 1100px;
    width: 100%;
    min-width: fit-content;
    margin: 0 auto;
    box-sizing: border-box;
}

.vp-grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.vp-item {
    background: rgba(255, 255, 255, 0.04);
    padding: 1.4rem 1.35rem 1.55rem;
    border: 1px solid var(--glass-08);
    border-radius: 18px;
    position: relative;
}

.vp-item:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(124, 58, 237, 0.25), transparent 70%);
    opacity: .4;
    pointer-events: none;
}

.vp-item h4 {
    margin: 0 0 .55rem;
    font-size: 1.05rem;
    letter-spacing: .5px;
    color: var(--clouds-05);
}

.vp-item p {
    margin: 0;
    font-size: .9rem;
    color: var(--clouds-03);
    line-height: 1.4;
}

.vp-item:hover {
    border-color: rgba(124, 58, 237, 0.45);
}

/* CTA final */
.cta-final {
    padding: 0 2rem 4.5rem;
}

.cta-box {
    max-width: min(960px, 92%);
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: clamp(1.6rem, 3.5vw, 3rem) clamp(1rem, 3vw, 2.5rem);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(6, 182, 212, 0.12));
    border: 1px solid var(--glass-08);
    border-radius: 20px;
    position: relative;
    box-sizing: border-box;
}

.cta-box:before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(124, 58, 237, 0.25), transparent 70%);
    mix-blend-mode: screen;
    opacity: .6;
}

.cta-box h2 {
    margin: 0 0 .85rem;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.cta-box p {
    margin: 0 0 1.4rem;
    font-size: 1.05rem;
    color: var(--clouds-03);
}

/* Responsive adjustments */
@media (max-width: 920px) {
    .cta-box {
        padding: 1vw 0;
    }

    .btn,
    .btn-lg,
    .btn-primary,
    .btn-ghost {
        width: 90%;
        padding: 1rem 0;
        margin: 0.5vh 0;
    }

    .feature-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .feature-card img {
        margin: 0 auto;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .vp-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .value-props {
        width: 100%;
        padding: 1vh 0;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 2.2rem 1rem 2rem;
    }

    .hero-trust {
        margin-top: 1vh;
        gap: .45rem;
    }

    .btn,
    .btn-primary,
    .btn-ghost,
    .btn-lg {
        width: 100%;
        padding: .9rem 1rem;
        margin: .4rem 0 0 0;
        box-sizing: border-box;
    }

    .hero-cta-group {
        flex-direction: column;
    }

    .features-carousel {
        padding: .5rem .5rem 1.2rem;
    }

    .carousel-track {
        width: 100%;
    }

    .feature-card {
        padding: 1rem .75rem 1.2rem;
        grid-template-columns: 1fr;
    }

    .feature-card img {
        max-width: 180px;
        width: 70%;
        margin: 0 auto 1rem;
    }

    .feature-card h3 {
        font-size: 1.25rem;
    }

    .feature-card p {
        font-size: .85rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .hero-title {
        font-size: 1.9rem !important;
        word-break: break-word;
    }

    .hero-sub {
        font-size: .92rem !important;
        padding: 0 .25rem;
    }

    .vp-item {
        padding: 1rem .85rem 1.05rem;
    }

    .vp-item h4 {
        font-size: .95rem;
    }

    .vp-item p {
        font-size: .78rem;
        line-height: 1.3;
    }

    .cta-box {
        max-width: 100%;
        width: 100%;
        padding: 1.6rem 1rem 2rem;
    }

    .cta-box h2 {
        font-size: 1.45rem !important;
    }

    .cta-box p {
        font-size: .85rem;
    }

    .pill {
        font-size: .55rem;
        padding: .4rem .55rem;
    }

    .hero-inner {
        width: 100%;
        max-width: 100%;
    }

    .value-props {
        padding: .5rem .5rem 2rem;
    }

    body,
    main,
    .value-props,
    .features-carousel,
    .cta-final {
        max-width: 100%;
    }

    .vp-grid {
        gap: 1.1rem;
    }

    .cta-box {
        border-radius: 24px;
    }

    .carousel-nav {
        display: none;
    }

    /* Global safeguards */
    img,
    svg,
    video,
    canvas {
        max-width: 100%;
    }

    .hero-title,
    .hero-sub,
    .cta-box,
    .feature-card,
    .vp-grid,
    .vp-item {
        overflow-wrap: anywhere;
    }

    /* rely on dots */
}

/* --- Unsaved new link highlighting --- */
.add-link-container.unsaved-link {
    position: relative;
    background: var(--accent2-06);
    border: 1px dashed var(--accent);
    box-shadow: 0 0 0 2px var(--accent-16), 0 0 10px 2px var(--cyan-12);
    animation: unsavedPulse 2.4s ease-in-out infinite;
}

@keyframes unsavedPulse {
    0% {
        box-shadow: 0 0 0 2px var(--accent-16), 0 0 6px 2px var(--cyan-08);
    }

    50% {
        box-shadow: 0 0 0 2px var(--accent-20), 0 0 16px 4px var(--cyan-12);
    }

    100% {
        box-shadow: 0 0 0 2px var(--accent-16), 0 0 6px 2px var(--cyan-08);
    }
}

.add-link-container.unsaved-link input.add-link-input.editable {
    background: var(--glass-03);
    border-color: var(--accent);
    color: var(--text);
}

/* --- Soft-deleted link appearance & recovery --- */
.deleted-link {
    /* use visual desaturation without lowering parent opacity so child controls remain readable */
    opacity: 1;
    filter: grayscale(0.65) saturate(0.45) contrast(0.9);
    transition: filter 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    background: transparent;
    border: 1px dashed rgba(220, 60, 60, 0.18);
    border-left: 6px solid var(--danger-600, #dc2626);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.01);
    backdrop-filter: blur(3px) saturate(0.8);
    z-index: 2;
}

.deleted-link:hover {
    /* slightly reduce desaturation on hover to show affordance */
    filter: grayscale(0.35) saturate(0.8) contrast(0.98);
    transform: translateY(-2px);
}

/* ensure undelete button is clearly visible and clickable */
.deleted-link,
.undelete-link-button {
    top: 8px;
    right: 8px;
    z-index: 30;
    pointer-events: auto;
    /* keep the undelete interactive */
}

.undelete-link-button {
    display: flex;
    cursor: pointer;
    color: var(--cyan-300);
    padding: 6px 10px;
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: none;
    align-items: center;
    background: var(--success-500, --accent-2);
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.16);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.undelete-link-button:hover {
    background: var(--success-600, #059669);
    transform: translateY(-2px);
}

/* Hide undelete button unless container is soft-deleted */
.add-link-container:not(.deleted-link) .undelete-link-button {
    display: none !important;
}

/* Ensure visibility when deleted */
.add-link-container.deleted-link .undelete-link-button {
    display: flex !important;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.add-link-container.deleted-link .reorder-up,
.add-link-container.deleted-link .reorder-down,
.add-link-container.deleted-link .publish-toggle,
.add-link-container.deleted-link .fetch-metadata-btn,
.add-link-container.deleted-link input.editable,
.add-link-container.deleted-link .delete-link-button {
    pointer-events: none;
    opacity: 0.45;
}

.add-link-container.deleted-link .delete-link-button {
    /* visually deemphasize trash when deleted */
    opacity: 0.35;
}

.link-order-indicator {
    display: none;
}

/* Hamburger styles moved from runtime injection into CSS */
@media (max-width: 720px) {
    .hamburger {
        display: inline-block;
        background: transparent;
        border: none;
        padding: 8px;
        margin-left: 8px;
    }

    .hamburger-box {
        width: 26px;
        height: 18px;
        display: inline-block;
        position: relative;
    }

    .hamburger-inner,
    .hamburger-inner:before,
    .hamburger-inner:after {
        background: var(--text);
        height: 2px;
        width: 100%;
        display: block;
        position: absolute;
        left: 0;
        border-radius: 2px;
    }

    .hamburger-inner {
        top: 8px;
    }

    .hamburger-inner:before {
        content: '';
        top: -6px;
    }

    .hamburger-inner:after {
        content: '';
        top: 6px;
    }
}

/* Default: hide hamburger on larger screens; media query above will show it */
.hamburger {
    display: none;
}

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

.register-link {
    color: var(--accent);
}

.login-links {
    color: var(--accent);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.login-links a {
    text-decoration: none;
    font-size: 0.9rem;
}

/* Mobile dropdown overrides (deduplicated) */
@media (max-width: 720px) {
    header {
        position: relative;
    }

    /* Hamburger visual + stacking */
    .hamburger {
        display: inline-flex !important;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        background: transparent;
        border: none;
        padding: 8px;
        margin-left: 8px;
    }

    /* Hide nav groups by default on mobile */
    header .topnav-left,
    header .topnav-right {
        display: none !important;
    }

    /* Open state: header expands and nav groups show in-flow as vertical lists */
    header.nav-open {
        height: auto !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    header.nav-open .topnav-left,
    header.nav-open .topnav-right {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        position: static !important;
        background: var(--card) !important;
        border-bottom: 1px solid var(--glass-03) !important;
        padding: 8px 12px !important;
        z-index: 1000;
        margin: 0;
    }

    header.nav-open .topnav-right {
        margin-left: 0 !important;
    }

    /* Make each link a solid, full-width touch target */
    header.nav-open a.topnav-link,
    header.nav-open a.icon-btn {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 6px 0 !important;
        padding: 12px 10px !important;
        background: var(--surface) !important;
        border: 1px solid var(--glass-05) !important;
        border-radius: 8px !important;
        color: var(--text) !important;
        text-decoration: none !important;
    }

    header.nav-open a.topnav-link:hover,
    header.nav-open a.icon-btn:hover {
        background: var(--glass-05) !important;
    }
}