@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@800&display=swap');

:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --primary: #334155;
    /* Dark slate for neutral feel */
    --primary-hover: #0f172a;
    --border: #e2e8f0;

    /* Toast Colors (Pastel) */
    --toast-success-bg: #dcfce7;
    --toast-success-text: #166534;
    --toast-error-bg: #fee2e2;
    --toast-error-text: #991b1b;
}

/* ... (rest of file) ... */

.stat-number {
    grid-column: 2;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    /* Bubbly font */
    font-size: 1.25rem;
    /* Larger */
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 0;
    /* Let it breathe */
    text-shadow: 2px 2px 0 #fff;
    /* Softer shadow */
}

.stat-label {
    grid-column: 1;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    /* Bubbly font */
    font-size: 1.25rem;
    /* Larger */
    font-weight: 800;
    color: var(--text-muted);
    /* Keep muted for contrast */
    text-transform: uppercase;
    letter-spacing: 0;
    text-shadow: 2px 2px 0 #fff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Validation States */
.form-group input.input-valid {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.form-group input.input-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-back {
    position: absolute;
    left: 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-back:hover {
    color: var(--primary);
    text-decoration: none;
}

.auth-title {
    text-align: center;
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

/* Dashboard */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.05em;
}

.user-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-weight: 500;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    width: auto;
    color: var(--text-muted);
}

.btn-logout:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.create-link-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.link-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.link-form input[name="url"] {
    flex: 3;
}

.link-form input[name="title"] {
    flex: 1;
}

.link-form button {
    flex: 0 0 auto;
    /* Don't grow or shrink */
    width: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.link-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
}

.link-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.link-info h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.link-info h3 a:hover {
    color: var(--primary);
}

.link-title {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.link-url-small {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Landing Page */
.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8rem 0 4rem;
    /* Increased top padding */
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #1e293b, #3b82f6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
}

.cta-button {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.3);
    color: white;
    text-decoration: none;
}

/* CSS-only Browser Window */
.hero-browser {
    margin-top: 4rem;
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    overflow: hidden;
    transform: perspective(1000px) rotateX(2deg);
    transition: transform 0.5s;
}

.hero-browser:hover {
    transform: perspective(1000px) rotateX(0deg);
}

.browser-header {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background: #ef4444;
}

.dot.yellow {
    background: #eab308;
}

.dot.green {
    background: #22c55e;
}

.browser-content {
    padding: 2rem;
    background: #f8fafc;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mock-input {
    width: 80%;
    height: 48px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    color: #94a3b8;
}

.mock-btn {
    width: 120px;
    height: 40px;
    background: #3b82f6;
    border-radius: 6px;
}

.features {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 6rem;
    padding-bottom: 4rem;
}

.feature-card {
    flex: 1;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSS Icons */
.icon-bolt::before {
    content: '';
    width: 24px;
    height: 36px;
    background: #eab308;
    clip-path: polygon(55% 0, 55% 45%, 100% 45%, 45% 100%, 45% 55%, 0 55%);
}

.icon-lock {
    border: 2px solid #3b82f6;
    border-radius: 6px;
    width: 32px;
    height: 24px;
    margin-top: 10px;
    background: white;
}

.icon-lock::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 12px;
    border: 2px solid #3b82f6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.icon-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    width: 32px;
    height: 32px;
}

.icon-chart::before,
.icon-chart::after,
.icon-chart span {
    content: '';
    width: 8px;
    background: #22c55e;
    border-radius: 2px 2px 0 0;
}

.icon-chart::before {
    height: 40%;
}

.icon-chart::after {
    height: 100%;
    order: 3;
}

/* Middle bar using box-shadow or a span if I could, but let's use a pseudo-element trick or just simple gradients */
/* Actually, simpler approach for chart: */
.icon-chart {
    background:
        linear-gradient(to top, #22c55e 40%, transparent 40%) no-repeat 0 100% / 8px 100%,
        linear-gradient(to top, #22c55e 70%, transparent 70%) no-repeat 12px 100% / 8px 100%,
        linear-gradient(to top, #22c55e 100%, transparent 100%) no-repeat 24px 100% / 8px 100%;
}

.icon-chart::before,
.icon-chart::after {
    content: none;
}

.feature-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.link-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-copy,
.btn-delete {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-copy {
    background: #e2e8f0;
    color: var(--text-color);
}

.btn-copy:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}

.btn-delete {
    background: #fee2e2;
    color: #ef4444;
}

.btn-delete:hover {
    background: #fecaca;
    color: #b91c1c;
    transform: translateY(-1px);
}

/* CSS Icons */
.icon-copy {
    position: relative;
    width: 14px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 2px;
    margin-left: -4px;
    margin-top: 4px;
}

.icon-copy::before {
    content: '';
    position: absolute;
    top: -6px;
    right: -6px;
    width: 14px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: inherit;
    /* Masks the underlying line if needed, or transparent */
}

/* Better Copy Icon (Clipboard style) */
.icon-copy {
    box-sizing: border-box;
    position: relative;
    width: 14px;
    height: 16px;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 2px;
    margin: 0;
}

.icon-copy::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.icon-trash {
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 14px;
    height: 16px;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 2px 2px;
    margin-top: 4px;
}

.icon-trash::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -2px;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.icon-trash::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 3px;
    width: 4px;
    height: 2px;
    background: currentColor;
    border-radius: 1px 1px 0 0;
}

.clicks {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: var(--bg-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    margin-left: 0.5rem;
    min-width: 100px;
    text-align: center;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: none;
}

.toast.show {
    transform: translateY(0);
}

.toast.error {
    background-color: var(--toast-error-bg);
    color: var(--toast-error-text);
}

.toast.success {
    background-color: var(--toast-success-bg);
    color: var(--toast-success-text);
}

/* Responsive */
@media (max-width: 640px) {
    .link-form {
        flex-direction: column;
    }

    .link-form input[name="url"],
    .link-form input[name="title"],
    .link-form button {
        flex: auto;
        width: 100%;
    }

    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .link-stats {
        width: 100%;
        justify-content: space-between;
    }

    .features {
        flex-direction: column;
    }
}

/* Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.dropdown-btn:hover {
    background: #f1f5f9;
}

.profile-pic-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    z-index: 1;
    overflow: hidden;
    border: 1px solid var(--border);
}

.dropdown-content a,
.dropdown-content button {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.dropdown-content a:hover,
.dropdown-content button:hover {
    background-color: #f1f5f9;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* Footer */
/* Footer */
.site-footer {
    margin-top: 8rem;
    padding-top: 4rem;
    padding-bottom: 4rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.footer-brand {
    text-align: left;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 300px;
}

.copyright {
    color: #94a3b8;
    font-size: 0.8rem;
}

/* Footer Stats */
.footer-stats {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 0.5rem 2rem;
    margin: 3rem auto 0;
    /* Push down */
    width: fit-content;
    padding-top: 0;
    grid-auto-flow: dense;
    /* Allows labels to backfill column 1 */
}

.stat-item {
    display: contents;
    /* Flattens the hierarchy for Grid */
}

.stat-number {
    grid-column: 2;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    /* Bubbly font */
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    /* Neutral Dark Slate */
    letter-spacing: 0;
    text-shadow: 2px 2px 0 #fff;
}

.stat-label {
    grid-column: 1;
    text-align: left;
    font-family: 'Nunito', sans-serif;
    /* Bubbly font */
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-muted);
    /* Lighter muted color for text */
    text-transform: uppercase;
    letter-spacing: 0;
    text-shadow: 2px 2px 0 #fff;
}

/* Footer Products (Right Aligned) */
.footer-section {
    text-align: right;
}

.footer-section h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.75rem;
}

.footer-section ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-brand,
    .footer-section,
    .footer-stats {
        text-align: center;
        justify-content: center;
    }

    .footer-desc {
        margin: 0 auto 2rem;
    }

    .footer-stats {
        flex-direction: column;
        gap: 2rem;
    }
}

/* About Page */
.about-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6rem 0;
    gap: 4rem;
}

.about-content {
    flex: 1;
    max-width: 500px;
}

.network-viz {
    flex: 1;
    height: 400px;
    position: relative;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.node {
    position: absolute;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    z-index: 2;
}

.node.center {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #3b82f6, #1e293b);
    animation: pulse-center 3s infinite ease-in-out;
}

.node.sat-1 {
    width: 30px;
    height: 30px;
    top: 20%;
    left: 20%;
    animation: float 4s infinite ease-in-out;
}

.node.sat-2 {
    width: 40px;
    height: 40px;
    top: 30%;
    right: 15%;
    animation: float 5s infinite ease-in-out 1s;
}

.node.sat-3 {
    width: 25px;
    height: 25px;
    bottom: 20%;
    left: 40%;
    animation: float 3.5s infinite ease-in-out 0.5s;
}

.connection {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    height: 2px;
    transform-origin: left center;
    opacity: 0.3;
    z-index: 1;
}

.connection.c1 {
    width: 180px;
    top: 35%;
    left: 25%;
    transform: rotate(-45deg);
    animation: flow 3s infinite linear;
}

.connection.c2 {
    width: 200px;
    top: 45%;
    left: 50%;
    transform: rotate(-20deg);
    animation: flow 4s infinite linear 1s;
}

.connection.c3 {
    width: 150px;
    top: 60%;
    left: 45%;
    transform: rotate(80deg);
    animation: flow 3.5s infinite linear 0.5s;
}

@keyframes pulse-center {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 40px rgba(59, 130, 246, 0.6);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes flow {
    0% {
        opacity: 0.1;
        background-position: -100% 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0.1;
        background-position: 200% 0;
    }
}

@media (max-width: 768px) {
    .about-hero {
        flex-direction: column;
        text-align: center;
        padding: 4rem 0;
    }

    .about-content {
        margin: 0 auto;
    }

    .network-viz {
        width: 100%;
        height: 300px;
    }
}