:root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-end: #1e293b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #8b5cf6;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
}

body.light-mode {
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(203, 213, 225, 0.6);
    --primary: #2563eb;
}

/* Light mode specific adjustments */
body.light-mode .card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    background: rgba(255, 255, 255, 0.8);
}

body.light-mode input {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
    border-color: #cbd5e1;
}

body.light-mode .link-item,
body.light-mode .btn-secondary {
    background: white;
    color: #1e293b;
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-mode .btn-secondary:hover,
body.light-mode .link-item:hover {
    background: #f1f5f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 480px;
    /* Mobile constraints */
    padding: 20px;
    margin: 0 auto;
}

/* Typography */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.brand-logo {
    font-family: 'Righteous', cursive;
    font-size: 2.8rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
    letter-spacing: 1px;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Components */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
}

.input-group {
    margin-bottom: 1rem;
}

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

input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.2s;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-link {
    background: transparent;
    color: var(--primary);
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Link List Items (Admin & Public) */
.link-item {
    display: block;
    background: var(--glass-bg);
    /* Almost transparent */
    border: 1px solid var(--glass-border);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 50px;
    /* Pill shape */
    text-align: center;
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
    color: white;
    font-weight: 600;
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

/* Utilities */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Admin specifics */
.admin-link-item {
    border-radius: 12px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-link-info h3 {
    font-size: 1rem;
    margin: 0;
}

.admin-link-info p {
    font-size: 0.8rem;
    margin: 0;
}

/* Profile Page */
.profile-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(to bottom right, var(--primary), var(--accent));
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
}

.action-buttons .btn {
    width: auto;
    flex: 1;
    font-size: 0.9rem;
    padding: 0.6rem;
}

.btn-icon-delete {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    margin-left: 1rem;
    padding: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-delete:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Profile Footer */
.profile-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    width: 100%;
}

.create-badge {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.create-badge:hover {
    transform: translateY(-2px);
    background: linear-gradient(to right, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(255, 255, 255, 0.3);
}

.report-link {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.4;
    transition: opacity 0.2s;
    text-decoration: none;
}

.report-link:hover {
    opacity: 1;
    color: var(--danger);
    text-decoration: underline;
}

/* Admin Link Card */
/* Admin Link Card */
.link-card {
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    transition: transform 0.2s, background 0.2s;
}

.link-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.link-content {
    flex: 1;
    min-width: 0;
    /* Truncate fix */
    margin-bottom: 0.5rem;
}

.link-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 0.5rem;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url {
    font-size: 0.85rem;
    color: var(--primary);
    opacity: 0.8;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Light mode overrides for link card */
body.light-mode .link-card {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.light-mode .link-card:hover {
    background: #f8fafc;
}

body.light-mode .link-stats {
    background: #f1f5f9;
    color: #64748b;
}

/* Logout Button */
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: #1e293b;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

input.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

textarea.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    resize: vertical;
    min-height: 80px;
}

select.modal-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    appearance: none;
    /* Custom arrow ideally */
}

/* Light mode modal */
body.light-mode .modal-content {
    background: white;
    border-color: #e2e8f0;
}

body.light-mode textarea.modal-input,
body.light-mode select.modal-input,
body.light-mode input.modal-input {
    background: #f8fafc;
    color: #1e293b;
    border-color: #cbd5e1;
}

.terms-content {
    font-size: 0.9rem;
    color: #ccc;
    line-height: 1.6;
}

body.light-mode .terms-content {
    color: var(--text-muted);
}

/* Link Pill Style */
.link-pill {
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    /* Dark mode default */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.2s;
}

body.light-mode .link-pill {
    background: #f1f5f9;
    /* Light gray visible on white */
    border-color: #e2e8f0;
}

.link-pill:hover {
    background: rgba(255, 255, 255, 0.12);
}

body.light-mode .link-pill:hover {
    background: #e2e8f0;
}