:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Glassmorphism Containers */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

/* Typography */
h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Input Fields */
.input-group {
    margin-bottom: 1.2rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Cards (Links) */
.link-card {
    margin-bottom: 0; /* Espacio manejado por el gap del grid */
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.link-image {
    width: 100%;
    aspect-ratio: 16/9; /* Proporción uniforme */
    height: auto;
    max-height: 120px;
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.link-content {
    padding: 0.8rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.link-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.link-notes-card {
    font-size: 0.75rem;
    color: var(--accent);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.2rem;
}

/* Modal de Detalles Específico */
#detailModal .modal-content {
    max-width: 600px;
}

.detail-img {
    width: 100%;
    border-radius: 15px;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.detail-notes {
    background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-style: italic;
    color: var(--text-main);
}

/* Mobile Nav Bar */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

.nav-item {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.add-btn-main {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    margin-top: -40px;
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.5);
}

/* Utilities */
.container {
    padding: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}
/* Estilos para Compartición Interna */
.shared-by {
    font-size: 0.65rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.unread {
    border-left: 3px solid var(--accent) !important;
}

.link-notes-card {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 0.5rem;
    font-style: italic;
    background: rgba(99, 102, 241, 0.05);
    padding: 0.4rem;
    border-radius: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4757;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid #0f172a;
}

.nav-item {
    position: relative;
}

.hide-mobile { display: inline; }
@media (max-width: 480px) {
    .hide-mobile { display: none; }
}

.status-badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; display: inline-block; }
.status-premium { background: rgba(46, 213, 115, 0.1); color: #2ed573; }
.status-gratis { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* --- DASHBOARD LAYOUT (ADMIN) --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 2rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.main-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    width: calc(100% - 260px);
}

.dashboard-header {
    height: 70px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

.dashboard-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Responsive Dashboard */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
}
